Minecraft is still one of the most popular games in the world. If you play the game, you probably play on servers all the time. This guide aims to teach you how to install, setup and manage a Minecraft server on Ubuntu 18.04 from scratch.
Prerequisites
Before we begin, you'll need the following:
- Ubuntu 18.04 or newer.
- A standard, non-root user for running the server.
Method
Once you've got the necessary requirements, log into your VPS as the standard, non-root user. This is important, as running a Minecraft Server as root can be extremely dangerous. Once you've logged in, we are going to update our repositories:
sudo apt-get update
sudo apt-get upgrade
Reboot your VPS and we'll be ready to move onto the next step.
Now we'll need to install the latest Java SDK, which can be done by typing the following command:
sudo apt-get install openjdk-7-jdk
Once completed, we are going to download the Minecraft Server executable for install. We will use wget
to do so:
sudo wget https://launcher.mojang.com/mc/game/1.13/server/d0caafb8438ebd206f99930cfaecfa6c9a13dca0/server.jar
Following this, we are going to mark the downloaded file as executable by inputting the following command:
chmod +x minecraft_server.jar
Now that we've downloaded the server, we need to accept the EULA:
echo "eula=true" > eula.txt
Type the following command to start your server, then hit ENTER:
java -Xmx1024M -Xms1024M -jar minecraft_server.1.13.jar nogui
This command will start a Minecraft Server with 1GB (1024MB) of memory (RAM) and no GUI (graphical user interface). You can change the amount of memory used by the server by swapping out 1024 with a different number. For example, if you wanted 2GB of memory you would type out 2048 instead of 1024.
Final words
Now that you've got a basic Minecraft Server setup, you are free to explore further. You can access your server by inputting your VPS's IP Address as the hostname on any Minecraft client.