Minecraft is a sandbox video game developed by Mojang. It ranks amongst the most streamed titles on game streaming sites such as Twitch. While players can play the game on their own, there is also a multiplayer mode which boasts quite a healthy online community.
To play Minecraft’s multiplayer mode, players need to either setup their own server, or use a hosting provider. In this tutorial, we will show you how to setup your very own Minecraft server on Ubuntu 16.04. Players using any other variant of Linux can also follow this tutorial, as the steps do not vary.
Table of Contents
Step 1 – Installing Java and Screen
Before you begin, you need to connect to your server via SSH. To login to your server, open up the terminal (or use Putty SSH Terminal if you are on Windows) and type in the following command:
Once logged in, you can formally start setting up your own Minecraft server.
Minecraft server setup requires Java to be installed on your system. To do this, follow these steps:
- You actually might already have Java installed on your system. To check this, execute the following command:1java -version
If you get a message which says Java was not found on your system, you can continue following the rest of these steps. Otherwise, you are done with this section and can move on to step 2.
- Run the following command in your terminal to download the latest packages of software installed on your system, including Java:1sudo apt-get update
- Now you need to install Java. We are installing Java 17 for this tutorial:1sudo apt-get install openjdk-7-jdk
- Just in case you want the latest version of Java, you can run the following instead of the above command:1sudo apt-get install default-jdk
- Here we should also install screen, which will ensure that your server keeps running in the background even if you drop the connection. To do this, type in the following and execute:1sudo apt-get install screen
You should now have Java and Screen installed on your system.
Step 2 – Installing Minecraft Server on Ubuntu
With the pre-requisites out of the way, we can now focus on installing the Minecraft server on Ubuntu VPS. To do this, simply repeat the following steps:
- It is always better to keep things clean and tidy. To avoid making a mess, create a new directory which will hold all your Minecraft files in one location. This step is optional, though for the sake of your sanity, we highly recommend it. To make a new directory, run this:1mkdir minecraft
- Once created, move inside the newly created directory by typing the following:1cd minecraft
- Next, you need to have wget on your system. If you don’t already have it installed, simply execute the following command:1sudo apt-get install wget
- Now download and install your own Minecraft server:1wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/ 1.11.2/minecraft_server. 1.11.2.jar
At the time of the writing, the latest version available is 1.11.2. You should replace this number with whatever the latest version is at the time. To check, visit this link.
- Accept Minecraft’s end-user license agreement:1echo "eula=true" > eula.txt
- Get screen up and running, so that the server can run in the background:1screen -S "Minecraft server 1"
We’ve named the current session ‘Minecraft server 1’, but you can use any other name instead.
And that’s it – you have successfully installed your custom Minecraft server on Ubuntu.
Step 3 – Running Minecraft Server
Now you only need to run the installed server. To achieve this, run the following in the terminal:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
As you can see, Minecraft requires you to have 1024MB or 1GB of RAM available to boot up the server. While this is the minimum requirement, we recommend having more RAM on board for better performance. To allocate more memory to the server, simply replace 1024 in the -Xmx and -Xms parameters with 2048 (2GB) and so on.
And there you have it: your very own Minecraft server setup in merely minutes. The server is running in the background, as per our use of screen. To opt out of screen, press CTRL + A, then D. You can undo this and re-open screen’s window by typing
screen -r in the terminal. Finally, you can fiddle around with your server’s settings through the server properties file:
In this step by step tutorial, we saw how you can setup a custom Minecraft server on Ubuntu. We also learned other useful stuff, like installing Java on Ubuntu, as well as setting up screen so that the server keeps running in a background window.
As stated in the introduction, players have the option to get themselves a hosted server. But this tutorial is for those who want their own server for maximum security and control.