Operating System CentOS

How to Install Forge and SpongeForge (Minecraft) on Ubuntu 26.04 or AlmaLinux 9

Install a Minecraft Forge server with SpongeForge on Ubuntu 26.04 or AlmaLinux 9, matching the Forge build to the Sponge build and running it as a systemd service.

This guide sets up a Minecraft: Java Edition server that loads Forge mods and Sponge plugins together, using Minecraft Forge with SpongeForge added as a mod. The steps are written for Ubuntu 26.04 LTS (24.04 LTS works the same way) and for AlmaLinux 9 or Rocky Linux 9. CentOS 6 reached end of life in November 2020 and ships no Java release that current Minecraft can use, so it is not an option for a new server.

How Forge and Sponge fit together

Forge is the mod loader. SpongeForge is the Sponge implementation that runs on top of Forge: you drop one .jar into the server's mods directory and the server can then load Sponge plugins as well as Forge mods. If you only want plugins and no mods, the Sponge project also publishes SpongeVanilla, which runs without Forge.

Each SpongeForge build is made for one specific Forge build, and the file name tells you which. In spongeforge-1.21.10-60.0.1-17.0.0 the parts are the Minecraft version (1.21.10), the Forge build it was made for (60.0.1) and the SpongeAPI version (17.0.0). A name that ends in -RC plus a number is a release candidate; a name without it is a recommended build.

At the time of writing, 1.21.10 is the newest Minecraft version with a recommended SpongeForge build, so the examples use it. Builds for newer Minecraft versions are listed on the Sponge downloads page but are marked experimental. Check the page before you start and substitute the versions shown there.

Requirements

  • A server with at least 4 GB of RAM. Forge with a handful of mods needs noticeably more memory than a plain Minecraft server.
  • A user with sudo rights.
  • Java 21, which Minecraft 1.21.x, Forge and Sponge require.
  • Agreement to the Minecraft EULA, which the server asks you to confirm on first start.

Step 1: Install Java 21

On Ubuntu 26.04 or 24.04:

sudo apt update
sudo apt install -y openjdk-21-jre-headless wget

On AlmaLinux 9 or Rocky Linux 9:

sudo dnf install -y java-21-openjdk-headless wget

Confirm the version:

java -version

If several Java versions are installed and this does not report 21, select it with sudo update-alternatives --config java (Ubuntu) or sudo alternatives --config java (AlmaLinux).

Step 2: Create a user and directory

Run the server under its own unprivileged account, never as root:

sudo useradd --system --create-home --home-dir /opt/minecraft --shell /bin/bash minecraft
sudo -u minecraft mkdir /opt/minecraft/server

Step 3: Install the Forge server

Open the Sponge downloads page, choose SpongeForge and your Minecraft version, and note the Forge build in the file name of the recommended build. Then download the installer for exactly that Forge build from the Forge file site (expand the full version list if it is not the newest one). The direct links follow a fixed pattern on the Forge Maven server; for Minecraft 1.21.10 and Forge 60.0.1:

cd /opt/minecraft/server
sudo -u minecraft wget https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.0.1/forge-1.21.10-60.0.1-installer.jar

Run the installer in server mode. It downloads the Minecraft server and the Forge libraries into the current directory:

sudo -u minecraft java -jar forge-1.21.10-60.0.1-installer.jar --installServer

When it finishes, the directory contains a run.sh start script, a user_jvm_args.txt file for Java options and a libraries directory. The installer file is no longer needed:

sudo -u minecraft rm forge-1.21.10-60.0.1-installer.jar

Step 4: Add SpongeForge

Create the mods directory and download the SpongeForge .jar into it. Copy the link of the recommended build from the Sponge downloads page and paste it in place of the placeholder:

sudo -u minecraft mkdir -p /opt/minecraft/server/mods
cd /opt/minecraft/server/mods
sudo -u minecraft wget "PASTE_SPONGEFORGE_DOWNLOAD_LINK_HERE"

Other Forge mods go into the same directory.

Step 5: Set memory, accept the EULA and start

Set the Java heap size in user_jvm_args.txt, one option per line. Leave at least 1 GB for the operating system:

sudo -u minecraft nano /opt/minecraft/server/user_jvm_args.txt
-Xms2G
-Xmx3G

Start the server once. It creates its configuration files and stops because the EULA has not been accepted:

cd /opt/minecraft/server
sudo -u minecraft bash run.sh nogui

Read the EULA linked in eula.txt, then accept it:

sudo -u minecraft sed -i 's/eula=false/eula=true/' /opt/minecraft/server/eula.txt

Start it again with the same command. The first full start takes a while. When the log prints Done, type sponge version at the server console to confirm that Sponge loaded, then stop to shut down cleanly.

Step 6: Run the server as a systemd service

A service starts the server at boot and restarts it after a crash, which replaces the screen sessions used in older tutorials.

sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Forge server with SpongeForge
After=network-online.target
Wants=network-online.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft/server
ExecStart=/bin/bash /opt/minecraft/server/run.sh nogui
Restart=on-failure
SuccessExitStatus=0 143

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo journalctl -u minecraft -f

Step 7: Open the firewall

The game listens on TCP port 25565. With UFW on Ubuntu:

sudo ufw allow 25565/tcp

With firewalld on AlmaLinux or Rocky Linux:

sudo firewall-cmd --permanent --add-port=25565/tcp
sudo firewall-cmd --reload

Players connect to your server's address, for example 203.0.113.10:25565. A client without Forge can join as long as none of the installed mods needs a client-side counterpart.

Updating

Stop the service and back up the whole server directory first. To move to a newer SpongeForge build made for the same Forge build, replace the .jar in mods. If the new SpongeForge build names a different Forge build, run that Forge installer with --installServer in the server directory before you swap the SpongeForge file. Never leave two SpongeForge files in mods.

Legacy modpacks without a server pack

Some older modpacks were published for the client only. Age of Engineering, a tech modpack for Minecraft 1.10.2 that has not been updated since November 2017, is an example: its author states on the pack's CurseForge page that server files will not be provided.

The method the author describes is to set up a normal Forge server for the pack's Minecraft version and copy the mods, config, resources and scripts folders into it from an installed client, not from the zip file on CurseForge. The server must run exactly the same mod versions as the clients. Minecraft 1.10.2 requires Java 8, and Forge builds of that era do not start on newer Java releases, so the Java 21 setup above does not apply.

Expect two problems. A Forge installer built in 2017 fetches its libraries from the download locations of that time and may stop with a message that libraries failed to download. Run it once more; if the same libraries keep failing, do not work around it with library archives from unofficial sites. And if the server crashes during startup with a report that names a client-only class, one of the copied mods is usually not meant for servers: remove that mod's jar from the server's mods folder only and try again.

Minecraft 1.10.2 also contains the Log4j vulnerability disclosed in December 2021 and no longer receives fixes. Apply the mitigation Mojang published for servers of that age and keep the server private with a whitelist.

Frequently asked questions

The server crashes on start after I added SpongeForge. What should I check?

Compare the Forge build in the SpongeForge file name with the Forge build you installed, and make sure java -version reports 21. A mismatch in either is the usual cause. The full error is in logs/latest.log inside the server directory.

Can I run Bukkit, Spigot or Paper plugins on SpongeForge?

No. Sponge has its own plugin API, and plugins written for Bukkit-based servers do not load. Look for a Sponge version of the plugin instead.

Should I use a release candidate build?

Use the recommended build on a server people rely on. Release candidates are built from every change to the Sponge source and may become recommended after more testing, so they are fine for trying out a fix you need.

Is SpongeForge the only way to combine mods and Sponge plugins?

The Sponge project also publishes SpongeNeo for the NeoForge mod loader. Choose the implementation that matches the loader your mods were written for.

Share story:

Continue reading other guides on How VPS.