HowTo: Modded Minecraft Server with ATLauncher
In this article I'll show you how to set up a custom minecraft server for any mod pack that's available in the ATLauncher mod package (on Linux). For this and also what's running on the minecraft server for my friends and me it's going to be DNSTechPack.
I'm going to use Digital Ocean for showing how to set up the dedicated and modded Minecraft Server from scratch. Using my referral link you'll get 10$ to start out with, which covers a month with a 1GB server with them. Another great host for your VPS would be Linode!
I rarely blog about gaming, since also most of all these things are covered over at unganked.com, but this I thought also related to Linux server administration in general.
[Client]: Getting the ATLauncherTo get the ATLauncher, you just have to head to the ATLauncher website and pick a pack to install. You'll have to log in to your Minecraft account for this, only on your client, not the server.
[Server]: Getting a ServerOnce I've set up a new virtual server with a recent Ubuntu version on Digital Ocean, we can get started and log in to our server through SSH.
If you're on Windows I can recommend Putty, if you're on Mac OS or Linux in the first place, you can start your respective Terminal and type:
ssh root@IP where IP represents the IP address of your freshly created server.
Technically you should not run servers as the
root user, but as another user with lower privileges, so you avoid giving an attacker root permissions if your service is compromised. I'll skip this part for now, but you can add other users through the
useradd command on the server. If you want to know more about this, just type
man useradd into a Linux shell.
[Server]: Installing the ATLauncher ModpackUsing the search function on the atlauncher website, you can easily find the server download on the page of the respective modpack. You'll be provided a .zip file with a name that includes mod pack name and version, like this:
DNSTechpack - 126.96.36.199.zip.
An example of this can be found here: https://www.atlauncher.com/pack/DNSTechpack/
You can unpack it to see how it looks, but I would recommend uploading the .zip file, because it's significantly faster to upload one file through scp/sftp compared to hundreds when it's extracted.
To upload the file/files to your server, you can use an FTP/SFTP client like Filezilla or Cyberduck. After uploading to the server, we have to use our SSH client of choice to log into the server with
ssh root@IP, root should be replaced by your username, IP with the IP of your server (in case you're not doing it locally).
To install the java dependencies, you can run:
sudo apt-get update sudo apt-get install default-jre # optional: sudo apt-get install openjdk-7-jre
Firstly now we'll create a separate directory for the modpack server and afterwards move the .zip file into it and extract it:
mkdir minecraft-server mv DNSTechpack\ -\ 188.8.131.52.zip minecraft-server cd minecraf-server unzip DNSTechpack\ -\ 184.108.40.206.zip
Now the directory you're in should look like this:
config libraries options.txt scripts DNSTechpack - 220.127.116.11.zip liteconfig pack.json SetupServer.jar forge-1.7.10-10.13.4.1481-1.7.10-universal.jar mods resources
Next, we'll run the
SetupServer.jar with the following command:
java -jar SetupServer.jar, which will download the correct vanilla Minecraft server version for the modpack. The console output was:
No graphics environment detected, so running command line only! Setting up the server! Downloading http://s3.amazonaws.com/Minecraft.Download/versions/1.7.10/minecraft_server.1.7.10.jar to /home/geronimo/Downloads/mc-server-tut/minecraft_server.1.7.10.jar Server has now been setup! You can now run forge-1.7.10-10.13.4.1481-1.7.10-universal.jar to start the server or alternatively use the LaunchServer script!
Afterwards these should be the contents of your directory:
config DNSTechpack - 18.104.22.168.zip forge-1.7.10-10.13.4.1481-1.7.10-universal.jar LaunchServer.bat LaunchServer.sh libraries liteconfig minecraft_server.1.7.10.jar mods options.txt pack.json resources scripts SetupServer.jar
To run your server, you can now run the
LaunchServer.sh. Firstly we will make sure the file is executable.
chmod +x LauncherServer.sh ./LaunchServer.sh
Depending on the speed of your server, this might take up to a whopping 10 minutes. Since this is the first time we run server, we will get an error message, but the essential part is NOT in the last lines of it.
[20:24:13] [Server thread/WARN]: Failed to load eula.txt [20:24:13] [Server thread/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info. [20:24:13] [Server thread/WARN] [FML]: Can't revert to frozen GameData state without freezing first. [20:24:13] [Server thread/INFO] [FML]: Applying holder lookups [20:24:13] [Server thread/INFO] [FML]: Holder lookups applied [20:24:13] [Server thread/WARN] [EnderIO]: Failed to write Transciever Channels on exit: java.util.concurrent.ExecutionException: java.lang.NullPointerException [20:24:13] [Server thread/ERROR] [HatStand]: Skipping event FMLServerStoppedEvent and marking errored mod HatStand since required dependency Hats has errored [20:24:13] [Server thread/INFO] [mcjty.rftools.RFTools]: RFTools: server is stopping. Shutting down gracefully [20:24:13] [Server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded. [20:24:13] [Server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded.
It fails because it could not load the correct eula.txt, which we fix by opening it in a text editor. If you're on an ssh connection, I would recommend nano or vim. Alternatively, you can also download, edit and upload it again. You will need to change the eula from:
#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula). #Sun Aug 30 20:24:13 CEST 2015 eula=false
eula=true. Now we can start the server again. Again, expect this to take a while.
You know it's done when you see the following lines in your terminal:
[20:37:28] [Server thread/INFO]: Preparing spawn area: 53% [20:37:29] [Server thread/INFO]: Preparing spawn area: 62% [20:37:30] [Server thread/INFO]: Preparing spawn area: 72% [20:37:32] [Server thread/INFO]: Preparing spawn area: 80% [20:37:33] [Server thread/INFO]: Preparing spawn area: 91% [20:37:33] [Server thread/INFO]: Done (20.079s)! For help, type "help" or "?"
[Server] Tweaking the Launcher.shThe default memory sizes in the
LauncherServer.shfile are not optimal, so you might want to play around with that and tweak it a little, here's mine:
java -Xmx3500M -XX:MaxPermSize=3500M -jar forge-1.7.10-10.13.4.1481-1.7.10-universal.jar nogui -Dfml.queryResult=confirm
Dfml.queryResult=confirm means that you will automatically confirm any questions on startup and let forge take care of it. This could damage your world, use with caution!
[Server] Keeping it Running with ScreenTo make sure your server keeps running after you quit the connection through ssh, I would recommend screen. You can start a screen session, by simply typing
screenafter you have installed that with
apt-get install screen.
Afterwards, you navigate to the location of your
LauncherServer.sh and run it with
./LaunchServer.sh. Now you can press the combination: CTRL+A+D to background it, type
exit and you've terminated your SSH connection, but the minecraft server still runs.
To resume your screen session, simply type:
screen -r after reconnecting and you're right in the minecraft server again.
[Server] Managing white listsTo only allow certain players on your server, you can enable it by finding your
server.propertiesfile and setting the
Afterwards, from within the server shell you add the individual users through
whitelist add playername.
I would recommend whitelisting for every server that wants to avoid random players joining, that technically could just destroy your world or loot your treasures.
SummaryIn this article I've thrown around with program names and ways to make this work, truth be told, there are many different ways to make your server work for you! If you have some great ideas, setups or experiences, let me know in the comments! If you have a question, post it as well, if I know, I will answer!