This article is a port of “How to Install Forge and Sponge (Minecraft) on a CentOS 6 Server” for Debian 9.
Sponge is an open-source project that expands the capabilities of Minecraft servers through plugins. Combined with the modding API Forge, server hosts can create a highly unique experience for their players. In this tutorial, you will learn to set up a Minecraft server with both Forge and Sponge on an AKLWEB HOST Instance.
Note: While Sponge plugins only need to be installed on the server, Forge mods will often require any players on your server to also have the mod installed. If you choose to install any mods like that, be sure to give your players a heads-up.
A 1GB RAM VPS or higher with Debian 9 x64
An SSH client and optionally an SFTP client
In order for the Minecraft server to run, we’re going to need Java. We also need a tool called screen that we’ll be using later. To install both of these at once, we’ll use Debian’s apt command. While we’re at it, we’ll also update the whole system.
Note: The # and $ Symbols at the beginning of these lines are not meant to be typed; they are visual indicators of the command prompt.
# apt update && apt upgrade && apt install default-jre screenWhen asked if you want to continue, type y and press Enter.
It’s generally a good idea to create a non-privileged user when running servers. While this isn’t required, it’s recommended to mitigate damage in the event of a security exploit.
First, we will create our new user named minecraft.
# adduser minecraftCreate a password and work your way through the prompts.
After that’s been done, log out of the SSH client and reconnect using your new username and password. Your prompt will now look something like this.
minecraft@my-server:~$Downloading Sponge
Create a new folder for the server files with the mkdir command and cd into it.
$ mkdir minecraft && cd minecraftCreate another folder called mods and cd into that.
$ mkdir mods && cd modsVisit the SpongeForge download page and find a build that matches the version of Minecraft you’ll be using for your server. For this tutorial, we’ll be using version 1.10.2.
Instead of downloading the file, right-click on the download link and click Copy Link Location. Go back to your SSH session and paste the URL into a wget command.
$ wget https://repo.spongepowered.org/maven/org/spongepowered/spongeforge/1.10.2-2477-5.2.0-BETA-2731/spongeforge-1.10.2-2477-5.2.0-BETA-2731.jarTake note of the number after the Minecraft version in the URL. This is the Forge build number. In this case, it’s 2477. We’ll need this in the next step.
Once you’ve finished that, return to the previous folder.
$ cd ..Go to the Forge download page, select your version of Minecraft, and hunt down the build number found in the last step. It will be after the last . in Forge’s full version numbers. For example, 12.18.3.2477 In our case. Click Installer.
Once again, right-click on the Skip button after the timer runs out and use Copy Link Location. Paste this into a wgetcommand.
$ wget http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.10.2-12.18.3.2477/forge-1.10.2-12.18.3.2477-installer.jarWe’ll need to run this file in Java. Type java -jar forge and press the Tab key to automatically complete the filename. Type --installServer to complete the command.
$ java -jar forge-1.10.2-12.18.3.2477-installer.jar --installServerTake note of the Forge installer’s filename as we’ll use part of it in the next step.
Next, we’re going to write a script that can start up the server. We’ll use nano to do this.
$ nano start.shFrom here, write the following lines.
#!/bin/bash
java -Xmx[memory]M -jar [filename]Replace [memory] With the amount of heap memory in megabytes, you’d like the Minecraft server to use. Remember to leave some for the OS. On a 1GB server, use something around 768MB.
Replace [filename] with the filename from earlier, but substitute -installer.jar for -universal.jar.
Here is an example of what it should look like.
#!/bin/bash
java -Xmx768M -jar forge-1.10.2-12.18.3.2477-universal.jarUse “Control+X“, press “y“, and press “Enter” to save and exit.
Next, you need to mark the file as executable.
$ chmod +x start.shYou will now be able to run the script.
$ ./start.shThe server will run for a little while and exit with an error. This is because Minecraft requires server owners to agree to its End User License Agreement. You can accept these terms by opening the newly created eula.txt file and changing false it to true.
$ nano eula.txtAfter making your changes, once again use Control+X, press y, and press Enter to save them.
To keep the server running after closing the SSH window, we’ll use a utility called screen.
$ screenPress Spacebar to move past the information screen and then run the script file again.
$ ./start.shThe Minecraft server will now successfully start.
Lastly, use Control+A and press D to suspend the screen and then log out of your SSH client. You will now be able to connect through Minecraft using the AKWLEB HOST server’s IP address.
Should you need to access the Minecraft server again (e.g., restarting it after installing mods/plugins or running Minecraft commands such as opLog back into the SSH client and use the command screen -r to resume the screen session.
In this tutorial, you learned how to set up a Minecraft server with Minecraft Forge and Sponge. At this moment, however, it’s still a mostly vanilla Minecraft experience. To start extending Minecraft’s functionality, check out Forge mods at CurseForge and Sponge plugins at Ore.
Use an SFTP client or the wget The technique described earlier was used to add these to the server. To install Forge mods, just place them in the mods folder. Sponge plugins belongs in the plugins subfolder of mods. You might have to make this folder, however.
$ mkdir ~/minecraft/mods/plugins