Setting up a Minecraft server on Linux (in this case, Ubuntu 24.04) is quick and straightforward. Once your hosting hardware is ready, you only need a current Java version and the latest server files for the Java Edition of the game, both of which can be installed easily via the terminal.

Minecraft server on a Linux basis with IONOS hosting options

Many hosting providers—including IONOS—offer server packages that allow you to choose between Windows and Linux as the operating system. If you want to get started easily with a smaller Minecraft server on Linux for just a few players, a vServer or VPS (Virtual Private Server) is a practical choice. For a low fixed monthly fee, you gain access to virtualised hardware resources that can be scaled up or down at any time. A suitable option with sufficient computing power is the VPS M package.

In the table below, you’ll find three specific use cases for a Minecraft server on Linux, including matching IONOS server options.

Minecraft server scenario Suitable IONOS package (with Linux as the OS)
Small game world for 1–2 players IONOS VPS Linux M
Medium-sized game world for 3–5 players IONOS VPS Linux L
Large game world for 6+ players IONOS VPS Linux XL

How to set up a Minecraft server on Linux step by step (Ubuntu 24.04)

If you want to run a Minecraft server on Linux, you have a wide range of options to choose from. Popular distributions such as Debian and Ubuntu are just as suitable as OpenSUSE, Arch Linux, Solus, Gentoo Linux, or other, less commonly used Linux distributions. In the tutorial below, we’ll guide you step by step through the setup of a Minecraft server on Linux, using Ubuntu 24.04 as an example.

Step 1: Install additional software components

Connect to your Linux server by setting up a remote desktop connection. Once the connection is established, your first step is to install the additional components required to run a Minecraft server on Linux via the terminal.

First, update the package index of the APT package manager:

sudo apt update
bash

In the next step, install the minimal OpenJDK Java implementation, which is mandatory for running the Minecraft server application written in Java:

sudo apt-get install openjdk-21-jdk
bash

You can then use the sudo java -version command to check whether the Java kit was installed successfully. If so, the terminal will display the installed version of OpenJDK.

Image: Ubuntu 24.04: Check the Java version in the terminal
Ubuntu 24.04: Check the Java version in the terminal

To keep your Minecraft server on Linux running even after you close the terminal, install the screen window manager:

sudo apt install screen
bash

Step 2: Open the Minecraft server port

After you have installed the basic components for your Minecraft server on Linux, the next step is to open TCP port 25565. The server application uses this port by default to communicate with clients, which is why a corresponding firewall rule is essential. Use the following command to add the new policy:

sudo ufw allow 25565
bash
Image: Port opening (25565) in Ubuntu 24.04
Port opening (25565) in Ubuntu 24.04

Step 3: Install the Minecraft server application (Java Edition)

You can now download and install the server software for the sandbox game. For the best compatibility, use the Java Edition and make sure you’re running the latest available version.

To do this, open the official download page for Minecraft: Java Edition Server and copy the download link. You can then use wget to download the server files via the terminal:

wget https://piston-data.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar
bash
Note

The link shown in the code example is only a placeholder. Replace it with the link you copied from the official website.

Step 4: Run the server application for the first time

Once the server.jar file has been downloaded, you can start the server application at any time. To do this, use the screen window manager installed in the first step and start it with the following command:

screen
bash

Confirm that you want to start the session by pressing the spacebar. You will then see the familiar terminal interface, which is now ready to launch the Minecraft server. Run the following command:

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

The Minecraft: Java Edition Server is launched without a graphical interface (nogui). During startup, 1 GB is allocated as the initial memory (Xms1G), while the maximum memory usage is limited to 2 GB (Xmx2G). These values can be adjusted as needed.

When you run the command for the first time, you will see the following two error messages at the end of the startup process:

Image: Minecraft server on Linux showing an error on first start
Minecraft server on Linux showing an error on first start

First, the eula.txt file could not be loaded. In addition, the Minecraft server is missing configuration settings that must be defined in the server.properties file by default.

The file used to accept the End User License Agreement (EULA) is then created directly in the current directory. You can open it with the following command:

sudo nano eula.txt
bash

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

Image: Minecraft server EULA confirmation in the Ubuntu terminal
Minecraft server EULA confirmation in the Ubuntu terminal

Step 5: Configure the server

Once you have accepted the licence agreement, you can move on to the configuration file server.properties. This file is also created in the current directory when the server is started for the first time. Open it using the nano text editor:

sudo nano server.properties
bash

Inside the file, you’ll find a basic default configuration that defines settings such as the difficulty level (difficulty) and game mode (gamemode). Adjust these options to suit your needs, then save the file.

Image: Minecraft server on Linux default configuration in server.properties
Minecraft server on Linux default configuration in server.properties

Step 6: Start the Minecraft server on Linux

After accepting the EULA and saving your custom server configuration, enter the same command you used in Step 4 to start the Minecraft server on Linux again:

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

Once the startup process has completed successfully—which may take a moment—the terminal displays the following message:

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

Now type help, and you will get a list of the available server commands.

Step 7: Keep the server session running

Once you have gotten the Minecraft server on Linux up and running, you will of course want it to remain active when you disconnect the remote connection to the server. To make this happen, first leave the screen session using the key combination [Ctrl] + [A] + [D].

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

screen -list
bash

You will get a list in which you can also find the previously established connection for your Minecraft server, including the preceding session ID. In our case, the ID is ‘6060’:

Image: List of active screen sessions with screen
List of active screen sessions with screen

To keep the session running even after you log off the server, enter the following command in the terminal and replace 6060 with the ID of your screen session:

screen -r 6060
bash

You can now close the screen window at any time using the key combination [Ctrl] + [A] + [D] and log off your server without stopping the Minecraft server.

Step 8: Connect to the 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, start the Minecraft client (Java Edition).
  2. Select ‘Multiplayer’.
  3. Click ‘Direct Connection’.
  4. Enter the IP address of your Minecraft server.
  5. Finally, click ‘Join Server’.
Image: Joining a Minecraft server via the multiplayer menu
Joining a Minecraft server via the multiplayer menu

Once the connection is established, you can start playing on your own Minecraft server on Linux.

Image: Screenshot from Minecraft (Java Edition)
Screenshot from Minecraft (Java Edition)
Tip

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

Go to Main Menu