How to install Minecraft Server on Ubuntu

The classic! Minecraft: Java Edition supports cross-platform play between macOS, Linux, and Windows.

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.

In this tutorial, we will walk you through the installation and configuration of the Minecraft Server on Ubuntu, that will allow playing with other players online.

Before starting the installation of the Minecraft Server, we recommend first to ensure that your Ubuntu is up-to-date using the following commands:

sudo apt update
sudo apt upgrade

Setting up Minecraft Server on Ubuntu

Step 1. Let’s start by creating a new user for the Minecraft Server.

sudo adduser minecraftuser

Create New Minecraft User
Create New Minecraft User

Step 2. Add the new “minecraftuser” to the “sudo” group.

sudo usermod -aG sudo minecraftuser

Add Minecraft User To Sudo Group
Add Minecraft User To Sudo Group

Step 3. Now, let’s switch to the newly created “minecraftuser” using the subsequent command.

su - minecraftuser

Switch To Minecraft User
Switch To Minecraft User

Step 4. Make sure that you have the wget package installed, if not you can install it using the following command.

sudo apt install wget

Install wget Package
Install wget Package

Step 5. Install the java package that will be used on the Minecraft Server.

sudo apt install openjdk-8-jdk -y

Install Java OpenJDK package
Install Java OpenJDK package

Step 6. After installing the java successfully, you can check its version to ensure that it is installed.

sudo java -version

Check Installed Java Version
Check Installed Java Version

Step 7. (This is an optional step.) In case you need the Minecraft server to run in the background, download the “screen” package using the following command.

sudo apt install screen

Install Screen Package
Install Screen Package

Step 8. Next, we will create a new directory to keep our Minecraft Server files in it.

sudo mkdir minecraftdir

Create A Minecraft Directory
Create A Minecraft Directory

Step 9. Move to the newly created Minecraft directory.

cd minecraftdir

Move To New Minecraft Directory
Move To New Minecraft Directory

Step 10. Next, we are going to download the Minecraft Server. But be careful to replace the following URL with the latest release of Minecraft website (Click here!!)

sudo wget -O minecraft_server.jar https://s3.amazonaws.com/Minecraft.Download/versions/1.11.2/minecraft_server.1.11.2.jar

Download Minecraft Server
Download Minecraft Server

Step 11. Set permissions on the downloaded Minecraft Server to be executable.

sudo chmod +x minecraft_server.jar

Set Permissions On Minecraft Server Downloaded Files
Set Permissions On Minecraft Server Downloaded Files

Step 12. You need to create the eula.txt file and agree to the license agreement conditions.

sudo vi eula.txt

Create License Agreement File
Create License Agreement File

Step 13. Add the following line “eula=true” to the created “eula.txt” file. The file should look like the below screenshot.

Edit License Agreement File
Edit License Agreement File

Step 14. Now you can start the Minecraft Server using the subsequent command.

sudo java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

This command will allow you to start the Minecraft Server with an allocated memory 1024MB. In case you need to increase this allocated memory, you can change the “-Xmx” parameter with your desired value.

Start The Minecraft Server
Start The Minecraft Server

Step 15. To stop the currently running Minecraft Server you can use the stop command.

stop

Stop The Minecraft Server
Stop The Minecraft Server

Step 16. (This is an optional step.) If you need to run the Minecraft Server in the background, you can use the screen command as following:

sudo screen -S "Minecraft Server Screen"

Start The Minecraft Server In Background
Start The Minecraft Server In Background

Next, run the java command to start the Minecraft Server.

sudo java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

To exit the screen window, you will need to press the following keys:

CTRL+A+D

The output will look like the below screenshot:

Exit The Screen Window
Exit The Screen Window

To return to the screen window, use the following command.

sudo screen -r

Congratulations you have just learned how to install the Minecraft Server on your Ubuntu.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

24,249FansLike
192FollowersFollow

LATEST ARTICLES

best music players for linux
For sure, there will be Linux users out there who cannot live without music. If you're one of those people, you would know how important it is to have a good music player installed on your computer system. In this article, we present to you the 5 Best Music Players for Linux, which will hopefully be able to satisfy each of our readers' needs.
Uninstall Programs in Ubuntu
Uninstallation of programs can be done by graphical way using the Ubuntu Software Center, and the Synaptic Package manager. Command-line way of doing it is also possible using apt-get and aptitude commands. We shall discuss each one of them in detail.
best video players for linux
Most Linux-based systems come with a built-in video player, but let's be honest, it most definitely won't be able to satisfy all of your requirements, due to the fact that default software is mostly made for basic purposes. In this article, we will review the 5 Best Video Players for Linux and thoroughly discuss their features as well as their pros and cons.