Managing A Simple Family Minecraft Server

4 min read


In the end I utilize my ratcraft script to manage the Minecraft server in the "cloud".



Virtual hardware



I have an Linode shared virtual instance with the following specs: 4 GB RAM 2 Cores, 40 GB SSD, at $20 per month. Cheaper instances may work, but we've experienced no problem with four or more users playing on this particular instance.



Hosting on a home computer is fantastic and will be less expensive after a year. However, having a "cloud" instance is so much easier to manage and easier to connect with friends who are not in the house.



The instance runs Slackware Linux, and I manage the server via SSH.



It also has an DNS subdomain, so it's easy to inform your friends how to connect to it.



Minecraft Server



We've tried mods and created them, so we've also run Spigot servers locally. On the server that is family-owned, we have the "vanilla" Minecraft server (Java Edition).



Launching the server



The server is a Java executable that must be maintained within a process. I have chosen to manage the process using the GNU terminal multiplexer monitor. This is the start command.



It's obvious that I don't want to write that more than once I've written a little application (a small Bash script) to manage this for me. Cranial cavity It's called ratcraft.



It's about 130 lines of Bash and comes with a couple of commands:



Server upgrades



The Minecraft clients automatically update to the most recent version when it's released.



Getting the latest server to match is as simple as grabbing the tarball link from minecraft.net/download/server and downloading it on the host:



Update: I no longer manually change the name of the server according to the version number. The old ones are still available. Instead I let the server.jar that I downloaded server.jar overwrite the previous. Saves a step and I haven't had any need to downgrade (yet).



This is the reason I no longer have to manually edit the script for ratcraft in order to upgrade the server version.



Then, I just restart the server (stop and start) using the program ratcraft.



The server will be up and running in a matter minutes for the new clients.



It's not a high-end solution, but it's:



It's easy enough for me to understand when I revisit it each couple of months



- Automated enough to not be a hassle to use



Backups



The ratcraft script has the ability to backup. It is called each day by a cron task in Slackware's /etc/cron.daily directory. The script calls:



The backup informs the Minecraft server to stop saving, and creates a .tgz using tar -cpvzf from the "world" directory and saves it in a "backups" directory.



The backup command can also perform simple backup rotation so the server doesn't get overloaded. Sometimes, we may need to save an important epoch in our lives So I simply rename one of the backups in order that it won't be removed during the rotation.



Upgrade or Getting the JDK



Perhaps you can use the Java executable that is installed on your system and then update using an application manager. In my experience, it's a bit more manual.



The Minecraft server updates seem to require the latest and most up-to-date versions of the JVM. I don't keep up with the Java world anymore however, it appears that the best place to get the JVM is:



http://jdk.java.net/



I don't think you'll be able to locate the JRE (runtime environment ) without JVM), which is all you need to run the Minecraft server. It's not that important. The JDK is just a bigger download, since it's a subset of JRE as well as compilers and libraries, etc.

In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up