A Minecraft server on Linux (in this case: Ubuntu 20.04) is quick and easy to set up. Once you have the right hardware ready for hosting, all you need is a current Java version and the latest program files of the sandbox computer game. You can obtain both con­veni­ently via the terminal in Linux.

Minecraft server on Linux: Hosting options from IONOS

Hosting options where you can choose between Windows and Linux as the server operating system are available from a wide range of providers — including IONOS. Here, the vServer or VPS (Virtual Private Server) server model is re­com­men­ded for an easy start with a smaller Minecraft Linux server for a few people. For a low monthly fixed price, you get access to vir­tu­al­ised hardware resources that you can scale up and down at any time. As a generally suitable package with the required computing power, we recommend VPS M.

In the table below you can find three concrete example use cases for a Minecraft server with Linux including matching server options from IONOS.

Minecraft server scenarioRe­com­men­ded IONOS package (with Linux as OS) 
Small game world for 1-2 playersIONOS VPS M
Medium game world for 3-5 playersIONOS VPS M RAM
Large game world for 6+ playersIONOS VPS XL
Tip

Start your online adventure today and rent your gameserv­er from IONOS. Install and host your Minecraft server based on Linux – plus it is reliable and secure!

Set up your Minecraft server on Linux: Step-by-step (Ubuntu 20.04)

If you want to run your Minecraft server on a Linux dis­tri­bu­tion, the choice is yours. The usual suspects such as Debian, Ubuntu, or OpenSUSE are possible as a system base as well as Arch Linux, Solus, Gentoo Linux or other, less common Linux dis­tri­bu­tions. In the following tutorial, we show the in­di­vidu­al steps for setting up a Minecraft server using Ubuntu 20.04 as an example.

Tip

More in­form­a­tion about hosting as well as detailed in­struc­tions for in­stalling a Minecraft server on Windows can be found in our article “Create and set up your own Minecraft server for beginners”.

Step 1: Install ad­di­tion­al software com­pon­ents

Connect to your Linux server by setting up a remote desktop con­nec­tion or by making an SSH con­nec­tion with PuTTy.

Once the con­nec­tion is es­tab­lished, your first step is to install the ad­di­tion­al com­pon­ents required to run a Minecraft server via the terminal.

To do this, first update the package index of the package manager APT:

sudo apt update

In the next step, you install the minimal OpenJDK Java runtime en­vir­on­ment (headless), which is mandatory for running the Minecraft server ap­plic­a­tion pro­grammed in Java:

sudo apt install openjdk-17-jre-headless

With the command `sudo java - version´ you can then check whether the in­stall­a­tion of the Java kit was suc­cess­ful. In this case, the terminal will give you the installed version of OpenJDK.

To keep the Minecraft server active when you leave the terminal, also install the full-screen window manager Screen:

sudo apt install screen

Step 2: Enable Minecraft server port

After you have installed the basic com­pon­ents for your Minecraft server on Linux, the next step is to enable TCP port 25565. By default, the server ap­plic­a­tion uses this port to com­mu­nic­ate with clients, so a cor­res­pond­ing firewall rule is essential. Use the following command to add the new policy:

sudo ufw allow 25565

Step 3: Install Minecraft server ap­plic­a­tion (Java edition)

Now you can download and install the server software of the sandbox game. For the best com­pat­ib­il­ity, use the Java edition, and it is equally important that you use a recent version of this variant.

To do this, go to the official download page of Minecraft: Java Edition server and copy and paste the link displayed there.

Now find the in­stall­a­tion files behind the copied link using wget:

wget
https://launcher.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar
Note

The link in the code above is only an example — you paste the copied link at this point.

Step 4: Running the server ap­plic­a­tion for the first time

After you have down­loaded the server.jar file, you can run the server ap­plic­a­tion at any time. Use the window manager screen installed in the first step, which you start with the following command:

screen

Confirm the start of the manager with the space bar. Af­ter­wards you will see the familiar terminal interface, which is now ready for the start of the Minecraft server. To do this, execute the following input:

sudo java -Xms1G -Xmx2G -jar server.jar nogui

Minecraft: Java Edition server (here version 1.18.2) is sub­sequently loaded without a graphical user interface (`nogui´). For the execution, 1 gigabyte is granted as `start´ memory (`Xms1G´) — the maximum memory usage is limited to 2 gigabytes (`Xmx2G´). Of course, you can adjust these values in­di­vidu­ally.

When you execute the command for the first time, you will get the following two error messages at the end of the loading process:

So, on the one hand, the eula.txt file could not be loaded, and on the other hand, the Minecraft server is missing con­fig­ur­a­tion in­form­a­tion that is to be defined by default in the server.prop­er­ties file.

The End User License Agreement (EULA) consent file is sub­sequently generated directly in the current directory. You can open the file as follows:

nano eula.txt

You will find a link to the contract, which you copy and open in the browser. After reading through the terms, change the `eula=false´ entry to `eula=true´. Save and close the text file.

Step 5: Configure server

Once you have agreed to the license agreement, you can turn to the server.prop­er­ties con­fig­ur­a­tion file. This was also created in the current directory when the server ap­plic­a­tion was started for the first time. Open the file with the text editor nano:

nano server.properties

You will find an initial, simple standard con­fig­ur­a­tion in which, among other things, the dif­fi­culty level and the server port (`query.port´) are defined. Adjust the con­fig­ur­a­tion in­di­vidu­ally and finally save the file. A detailed list of all possible settings can be found in the official Minecraft fandom wiki.

Step 6: Start Minecraft server

After you have agreed to the EULA con­di­tions and saved your in­di­vidu­al server con­fig­ur­a­tion, you can now type the command already used in Step 4 for starting the Minecraft server in the Linux terminal one more time:

sudo java -Xms1G -Xmx2G -jar server.jar nogui

After suc­cess­ful startup process — which takes some time — the terminal displays the message:

[Server thread/INFO]: Done (….s)! For help, type "help"

Now type `help´ and you will get a list of possible server commands.

Step 7: Maintain server session

Once you have the Minecraft server up and running on Linux, you will of course want it to remain active when you dis­con­nect remotely from the server. To initiate this, first exit the screen session with the key com­bin­a­tion [Ctrl] + [A] + [D].

Then run the following command to display all active screen sessions:

screen -list

You will get a listing where you will also find the pre­vi­ously es­tab­lished con­nec­tion of your Minecraft server including the prefixed session ID. In our case, this is the ID `2385´:

Now, to keep this session active even if you log off the server later, enter the following into the terminal — replacing the value `2385´ with the in­di­vidu­al ID of your screen session:

screen -r 2385

Now you can close the screen window at any time with the key com­bin­a­tion [Ctrl] + [A] + [D] and log out of your server without closing the Minecraft server.

Step 8: Connect to Minecraft server

Your server is running and you can now connect to the generated game world at any time. To do this, proceed as follows:

  1. To do this, launch the Minecraft client (Java Edition).
  2. Select `Mul­ti­play­er”.
  3. Click Direct Con­nec­tion.
  4. Enter the IP address of your Minecraft server.
  5. When you are finished, press `Join Server´.

Once connected, your online adventure on your own Minecraft server on Linux can begin!

Tip: .gg Domain

Make a statement with your own .gg domain and let the games begin. Register your own .gg domain now with IONOS.

Domain Checker

Author

Go to Main Menu