How to Install Minecraft Server on Ubuntu 18.04 Bionic Beaver

Install Minecraft Server on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Minecraft Server on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Minecraft is one of the most famous building games in the world developed by Microsoft Studious. In this game, you are allowed to build anything you need and explore it in a 3D world. If you host your own Minecraft server, you decide the rules, and you and your friends can play together in this interactive adventure game.

Install Minecraft Server on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade

Step 2. Install Java.

In order to run a Minecraft server, we will need Java on the server. Install the latest version:

sudo apt install openjdk-8-jdk

Now, confirm the Java installation:

$ java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

Step 3. Creating Minecraft User.

The next step is to create a new system user and group with home directory /opt/minecraft that will run the Minecraft server:

sudo useradd -r -m -U -d /opt/minecraft -s /bin/bash minecraft

Step 4. Install Minecraft on Ubuntu.

First, before starting with the installation process, make sure you switch to minecraft user:

sudo su - minecraft

Now create three new directories inside the user home directory:

mkdir -p ~/{backups,tools,server}
  • The backups directory will store your server backup. You can later synchronize this directory to your remote backup server.
  • The tools directory will be store the mcrcon client and the backup script.
  • The server directory will contain the actual Minecraft server and its data.

Then, Downloading and Compiling mcrcon.

Start by navigating to the ~/tools directory and clone the Tiiffi/mcrcon repository from GitHub using the following command:

cd ~/tools && git clone
cd ~/tools/mcrcon
gcc -std=gnu11 -pedantic -Wall -Wextra -O2 -s -o mcrcon mcrcon.c
./mcrcon -h

Next steps, downloading Minecraft Server.

wget -P ~/server

Once the download is completed, navigate to the ~/server directory and start the Minecraft server:

cd ~/server
java -Xmx1024M -Xms512M -d64 -jar server.jar nogui

When the server is started for the first time it executes some operations and creates the and eula.txt files and stops:

[14:46:36] [main/INFO]: Loaded 0 recipes
[14:46:36] [main/INFO]: Loaded 0 advancements
[14:46:36] [Server thread/INFO]: Starting minecraft server version 1.13.2
[14:46:36] [Server thread/INFO]: Loading properties
[14:46:36] [Server thread/WARN]: does not exist
[14:46:36] [Server thread/INFO]: Generating new properties file
[14:46:36] [Server thread/WARN]: Failed to load eula.txt
[14:46:36] [Server thread/INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
[14:46:36] [Server thread/INFO]: Stopping server
[14:46:36] [Server thread/INFO]: Saving worlds
[14:46:36] [Server Shutdown Thread/INFO]: Stopping server
[14:46:36] [Server Shutdown Thread/INFO]: Saving worlds

As you can see from the output above you’ll need to agree to the Minecraft EULA in order to run the server. Open the eula.txt file and change eula=false to eula=true:

nano ~/server/eula.txt
#By changing the setting below to TRUE you are indicating your agreement to our EULA (
#Thu Dec 10 03:46:53 PST 2019

Next, enable the rcon protocol and set the rcon password by editing the file. You can use these details to connect to the Minecraft server using the mcrcon tool:

nano ~/server/

Step 5. Creating Systemd Unit File Minecraft.

Open your favorite text editor and create a file named minecraft.service in the /etc/systemd/system/:

sudo nano /etc/systemd/system/minecraft.service
Description=Minecraft Server

SuccessExitStatus=0 1
ExecStart=/usr/bin/java -Xmx1024M -Xms512M -jar server.jar nogui --noconsole
ExecStop=/opt/minecraft/tools/mcrcon/mcrcon -H -P 23888 -p strong-password stop


Start and enable the Minecraft server by executing:

sudo systemctl daemon-reload
sudo systemctl start minecraft
sudo systemctl enable minecraft

Step 6. Configure firewall

If your server is protected by a firewall and you want to access Minecraft server from the outside of your local network you need to open port 25565:

sudo ufw allow 25565/tcp

Step 7. Accessing Minecraft Console.

To access the Minecraft Console you can use the mcrcon utility. The syntax is as follows, you need to specify the host, rcon port, rcon password and use the -t switch which enables the mcrcon terminal mode:

/opt/minecraft/tools/mcrcon/mcrcon -H -P 23888 -p Your-password -t

That’s all you need to do to install Minecraft on Ubuntu 18.04 Bionic Beaver. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.