# How to create a Minecraft server on Linux

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.

<table>
  <thead>
    <tr>
      <th><strong>Minecraft server scenario</strong></th>
      <th><strong>Suitable IONOS package (with Linux as the OS)</strong></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Small game world for 1–2 players</strong></td>
      <td>IONOS VPS Linux M</td>
    </tr>
    <tr>
      <td><strong>Medium-sized game world for 3–5 players</strong></td>
      <td>IONOS VPS Linux L</td>
    </tr>
    <tr>
      <td><strong>Large game world for 6+ players</strong></td>
      <td>IONOS VPS Linux XL</td>
    </tr>
  </tbody>
</table>

## 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](https://www.ionos.com/en-ie/digitalguide/server/know-how/debian-the-universal-system-software/) 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.

Tip Of course, you can also create and set up your own Minecraft server on Windows if you prefer working with the Microsoft operating system.

### Step 1: Install additional software components

Connect to your Linux server by setting up a [remote desktop connection](https://www.ionos.com/en-ie/digitalguide/server/know-how/remote-desktop-success-of-the-application/). 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:

```bash
sudo apt update
```

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

```bash
sudo apt-get install openjdk-21-jdk
```

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](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/7/1/csm_ubuntu-java-versions-check-terminal_938e3f1b03.webp "Ubuntu 24.04: Check the Java version in the terminal")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/ubuntu-java-versions-check-terminal.jpg) 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:

```bash
sudo apt install screen
```

### 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:

```bash
sudo ufw allow 25565
```

[![Image: Port opening (25565) in Ubuntu 24.04](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/d/8/csm_port-opening-in-ubuntu_515233b7b2.webp "Port opening (25565) in Ubuntu 24.04")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/port-opening-in-ubuntu.jpg) 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**](https://www.minecraft.net/en-us/download/server "minecraft.net: Minecraft: Java Edition Server") and copy the download link. You can then use `wget` to download the server files via the terminal:

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

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:

```bash
screen
```

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:

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

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](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/e/6/csm_minecraft-server-on-linux-error_195cd5adb3.webp "Minecraft server on Linux showing an error on first start")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/minecraft-server-on-linux-error.jpg) 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:

```bash
sudo nano eula.txt
```

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](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/0/6/csm_minecraft-server-eula-on-ubuntu-terminal_a8cb335f78.webp "Minecraft server EULA confirmation in the Ubuntu terminal")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/minecraft-server-eula-on-ubuntu-terminal.jpg) 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](https://minecraft.fandom.com/wiki/Server.properties "minecraft.fandom.com: 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:

```bash
sudo nano server.properties
```

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](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/1/9/csm_minecraft-server-linux-standard-configuration_89d1bae6d2.webp "Minecraft server on Linux default configuration in server.properties")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/minecraft-server-linux-standard-configuration.jpg) 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:

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

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

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

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:

```bash
screen -list
```

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](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/4/e/csm_list-of-active-screen-sessions_5b94ff9d08.webp "List of active screen sessions with screen")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2025/list-of-active-screen-sessions.jpg) 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:

```bash
screen -r 6060
```

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](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/b/f/csm_screenshot-from-minecraft-join-server_0c27888f0d.webp "Joining a Minecraft server via the multiplayer menu")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2022/screenshot-from-minecraft-join-server.png) 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)](https://www.ionos.com/en-ie/digitalguide/fileadmin/_processed_/a/b/csm_screenshot-minecraft-java-edition_2920a10c81.webp "Screenshot from Minecraft (Java Edition)")](https://www.ionos.com/en-ie/digitalguide/fileadmin/DigitalGuide/Screenshots_2022/screenshot-minecraft-java-edition.png) Screenshot from Minecraft (Java Edition)  Tip Make a statement with your own [.gg domain](https://www.ionos.de/domains/gg-domain ".gg domain – IONOS") and let the games begin.


This is a markdown version of: [https://www.ionos.com/en-ie/digitalguide/server/know-how/minecraft-server-linux/](https://www.ionos.com/en-ie/digitalguide/server/know-how/minecraft-server-linux/) for AI/LLM consumption.