TABLE OF CONTENTS
Few games have been able to cultivate such a large and endearing following as Minecraft.
Hosting a Minecraft server not only brings friends together but is an excellent introduction to operating a Linux platform and the responsibilities of system administration.
The Minecraft server is a java application and can be run on any machine, even your own computer. However, there are two benefits of hosting the Minecraft server on a cloud platform: availability and bandwidth. The server will be running 24/7, allowing anyone to connect and play regardless of whether your computer is on. Additionally, ISP's will throttle residential internet connections to preserve their quality of service, however, a cloud platform will provide much larger upload and download bandwidth at a lower latency, which is important for a multiplayer game.
There are three characteristics of a computer which impact the performance of a Minecraft server:
Hard drive storage space and speed are not critical for dedicated servers, as active chunks of the map are loaded into the much faster RAM and served out to players as needed. However, all of our VPS offerings use SSDs, which greatly improves loading times. As for the amount of storage space required, a Minecraft map does not require a large amount of space, but the disk usage of your VPS should be monitored frequently. Always remember: the disk size can be increased but not decreased. Start small, and grow as needed.
By default, SkySilk VPS provides a bash shell (via SSH) as a means of controlling and administering the VPS. While using the command line is resource-friendly, a graphical user interface can be installed on the VPS - check out our How-To article!
To get started, you will need to download the Java runtime environment (as root, or sudo):
apt install openjdk-8-jre
Optional: Specify the location of the Minecraft server.
The Minecraft server will generate several files and folders, and it is helpful to keep everything in a specific folder - and necessary if you plan on hosting multiple servers!
The below commands will create a new folder (mkdir $folder_name) for the server in your present directory, and we will be working from within this folder for the remainder of the guide.
mkdir minecraft
cd minecraft/
Then download the Minecraft server file. The command below will download the file into the directory you are currently in.
wget https://s3.amazonaws.com/Minecraft.Download/versions/1.12.2/minecraft_server.1.12.2.jar
When the Minecraft server is started for the first time, it will create the rest of the files necessary for the server. If starting from scratch, the run the server once to generate the configuration files and the world file.
If the server is started now, you will be notified to read the Minecraft EULA.
To streamline the process, the following command will acknowledge the EULA:
echo "eula=true" > eula.txt
Now run the Minecraft server and wait for files to be generated.
java -Xmx1G -Xms1G -jar minecraft_server.1.12.2.jar nogui
A plain Minecraft server with default settings is now running, ready for adventure! Make sure that you and your friends are using the same version of Minecraft as the server (in this case 1.12.2)
The "-Xmx" and "-Xms" flags tell the java application the maximum and minimum RAM to allocate to the Minecraft dedicated server, and the maximum available should not exceed the maximum RAM available on your VPS.
You can specify the amount using capital G for gigabytes, capital M for megabytes, and other letters referring to the byte size for fine-tuning.
The Minecraft Server configuration file is generated the first time the server is run and is located in the same directory as the Minecraft server .jar file.
You may edit the configuration file using:
nano server.properties
A complete breakdown of the server configuration file and how each item affects the server can be found on the Minecraft Wiki.
However, there are a few items in the server properties which affect the performance and function of the Minecraft server:
So you've created an awesome Minecraft world on your own computer and want to share it with your friends? Great! There are a few things which you will need to do in order to upload your world file to the server.
Navigate to your world file on your own computer. In windows, press Win+r to open the run prompt, and enter the following:
%appdata%\.minecraft
This will open an Explorer window at the location of your local Minecraft files. Your saved games will be in the "saves" folder.
Then create a .zip archive of the Minecraft world file.
Next, you will need to transfer the .zip file to your SkySilk VPS, here are a couple of programs which provide an intuitive GUI for transferring files:
When uploading the file, it is convenient to navigate to the location of the Minecraft server and place the world.zip file, in the case of this guide that would be:
/root/minecraft
Lastly, extract the .zip file of your world file (you may need to install 'unzip' if it is not already installed on your VPS, e.g. apt install unzip)
unzip New\ World.zip
In this case, my world was called "New World.zip", and the backslash was added to tell the command that the space following "New" is part of the file name. If you are having troubles specifying the file, type the first few characters and press the 'tab' key, this should auto-complete the rest of the file name.
Be sure to specify the name of the world file in the "level-name=" section of the "server.properties" configuration file, so that the Minecraft server knows which world to load.
One very important behavior that you will notice when you terminate your SSH session is: all programs running in that shell session are also terminated!
This could spell disaster if your laptop loses connection, for example, and the Minecraft server is terminated - the Minecraft world will not be saved.
There are two very popular programs which will allow you to disconnect and reconnect without closing the shell - GNU Screen and TMUX. Both of these programs are wrappers which separate the programs from the shell which spawned them, which will also allow you to run multiple sessions concurrently, i.e. host and manage multiple servers.
GNU Screen is very easy to use and easy to set up. To install (as root or sudo):
apt install screen
To get started, simply type:
screen
In order to control Screen, press Ctrl+a (which is an "escape key" - essentially tells Screen to listen for a command) and then press one of the following keys:
c - Create a new window
k - Kill current window
d - detach from Screen
n - next window
p - previous window
Ctrl+a (again) - toggle between current and previous window
There are many more commands available for GNU Screen, but these are enough for hosting a Minecraft server.
To reconnect to a Screen session:
screen -R
You can even (accidentally maybe) close your connection to your VPS and the Minecraft Servers launched in the Screen session are still running!
TMUX is a "Terminal Multiplexer" and does many of the same things that GNU Screen can do, and more! While it is exceedingly popular with many system administrators and developers, there is a learning curve to TMUX which can be prohibitive to new users.
To install (as root or sudo):
apt install tmux
And to get started:
tmux
TMUX has a similar method for passing commands to TMUX, Ctrl+b, and press one of the following keys:
c - create new window
" - splits the window vertically into panes
% - splits the window horizontally into panes
x - kills current pane
& - kills current window (including panes!)
d - detach from current session
s - switch to a session (from a list)
There are many, many more commands and configuration options for TMUX, but these are enough for hosting a Minecraft server.
Reconnecting to the TMUX session is as simple as
tmux attach
While the commands presented here are enough to get you going, there are many more commands and functionality available for both GNU Screen and TMUX.
An excellent reference guide for GNU Screen can be found here.
An excellent reference guide for TMUX can be found here.
CLICK HERE TO DEPLOY A LINUX VPS FOR MINECRAFT HOSTING
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article