How to Set Up a Forge Server
Updated · MCJarHub
Download the official Forge installer for your Minecraft version and run java -jar forge-<version>-installer.jar --installServer in an empty folder. On Minecraft 1.17 and newer, start the server with run.sh or run.bat and set memory in user_jvm_args.txt.
Before you start
- Use the exact Minecraft and Forge version your modpack or mods require. Forge builds are tied to one Minecraft version.
- Install the matching Java: Java 8 for 1.16.5 and older, Java 17 for 1.18–1.20.4 (e.g. 1.20.1), Java 21 for 1.20.5–1.21.11. The installer itself runs on the same Java.
- Download the official installer for your version from the Forge download page — MCJarHub links the installer on Forge's own maven, with its published SHA-256.
Minecraft 1.17 and newer (e.g. 1.20.1)
- Put the installer into an empty folder and run:
It downloads the Minecraft server and all libraries into the folder (
java -jar forge-1.20.1-47.4.28-installer.jar --installServer
libraries/) and createsrun.sh,run.batanduser_jvm_args.txt. The scripts start Java with@user_jvm_args.txtplus Forge's own argument file, which is why there is no single jar to run. - Set the memory in
user_jvm_args.txt— uncomment or add a line such as:-Xms6G -Xmx6G
- Start the server with
./run.sh(Linux/macOS;chmod +x run.shfirst) orrun.bat(Windows). To run without the console window, passnoguito the script:./run.sh nogui(the generated scripts forward extra arguments to the server). - Accept the EULA: set
eula=trueineula.txtand start again. - Put mods into
mods/and restart. You can delete the installer jar andinstaller.log.
Minecraft 1.16.5 and older (e.g. 1.12.2)
- Run the installer the same way:
java -jar forge-<version>-installer.jar --installServer. - It creates a Forge server jar (named like
forge-1.12.2-14.23.5.2859.jar; the oldest versions use a…-universal.jar) plus the vanilla server jar and libraries. There are no run scripts. - Start the Forge jar directly, e.g.
java -Xms6G -Xmx6G -jar forge-1.12.2-14.23.5.2859.jar nogui, then accept the EULA and restart.
Old versions such as 1.7.10–1.16.5 are affected by Log4Shell; apply the mitigation shown on their version pages (for example Forge 1.12.2).
Common problems
- "Unsupported class file major version" or
UnsupportedClassVersionError: wrong Java for this Minecraft version — fix. - Server closes right after "Loading mods": read
logs/latest.logand the crash report incrash-reports/; it usually names a missing dependency or a client-only mod. - Players can't join: they need the same mods and versions; check port problems if nobody can connect.
- Out of memory: modpacks need more RAM than vanilla — see how much RAM.
For Minecraft 1.20.2 and newer, many mods target NeoForge instead. Comparison: Fabric vs Forge vs NeoForge.
FAQ
Why is there no Forge server jar to download?
Forge ships an installer that builds the server from the Minecraft server and Forge libraries. The installer is the official download.
Forge says "Unsupported class file major version"?
You are running it with the wrong Java. See UnsupportedClassVersionError.