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)

  1. Put the installer into an empty folder and run:
    java -jar forge-1.20.1-47.4.28-installer.jar --installServer
    It downloads the Minecraft server and all libraries into the folder (libraries/) and creates run.sh, run.bat and user_jvm_args.txt. The scripts start Java with @user_jvm_args.txt plus Forge's own argument file, which is why there is no single jar to run.
  2. Set the memory in user_jvm_args.txt — uncomment or add a line such as:
    -Xms6G
    -Xmx6G
  3. Start the server with ./run.sh (Linux/macOS; chmod +x run.sh first) or run.bat (Windows). To run without the console window, pass nogui to the script: ./run.sh nogui (the generated scripts forward extra arguments to the server).
  4. Accept the EULA: set eula=true in eula.txt and start again.
  5. Put mods into mods/ and restart. You can delete the installer jar and installer.log.

Minecraft 1.16.5 and older (e.g. 1.12.2)

  1. Run the installer the same way: java -jar forge-<version>-installer.jar --installServer.
  2. 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.
  3. 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.log and the crash report in crash-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.
Can I add Bukkit plugins to Forge?
Not to Forge itself. Hybrid servers such as Mohist or Arclight try to run both, with compatibility caveats.