Installing a Minecraft server on Debian or Ubuntu (Paper)

Published on Updated on 5 min read

How to install a Minecraft server (Paper) on Debian or Ubuntu: from the right Java version through the download to a running server under screen.

Do you want to run your own Minecraft server on your Linux root server under Debian or Ubuntu? Then you are in the right place. In this guide we install a Paper server (compatible with Spigot and Bukkit plugins) step by step over the SSH console.

All commands are written for Debian 13, Debian 12 and Ubuntu 24.04 LTS. Older systems such as Debian 10 or Ubuntu 20.04 have already reached their end of support and no longer receive security updates. You should not run those versions on a server that is reachable from the internet.

Requirements for your own Minecraft server

  • A root server or VPS with Debian 13, Debian 12 or Ubuntu 24.04 LTS
  • Root access over SSH
  • At least 2 GB of RAM for the Minecraft server alone, and correspondingly more with plugins or a lot of players
  • TCP port 25565 opened in the firewall, the default port of the Minecraft Java Edition

Updating the package list and installing updates

Before we start, update the package list of your operating system and install all available updates. A single command takes care of that:

apt update && apt upgrade -y

Which Java version does your Minecraft server need?

Minecraft requires a different Java release depending on the server version. If the server is started with a Java version that is too old, it aborts immediately with an error message, usually pointing at an unsupported class file version. For the Java Edition, the mapping looks like this:

  • Minecraft 1.20.5 and newer: Java 21
  • Minecraft 1.18 to 1.20.4: Java 17
  • Minecraft 1.17: Java 16
  • Minecraft 1.16.5 and older: Java 8

Current server versions therefore require Java 21. When in doubt, install Java 21, because a newer Java version can usually start older Minecraft builds as well.

Installing Java 21 on Debian 13 and Ubuntu 24.04 LTS

Both systems ship Java 21 directly in their own package sources:

apt install openjdk-21-jre-headless -y

On Debian 12, the standard package source only carries Java 17. Our separate guide Installing Java 21 on Debian shows how to get Java 21 there anyway.

Java 17 for older Minecraft versions

If you deliberately run an older server version between 1.18 and 1.20.4, install Java 17 instead:

apt install openjdk-17-jre-headless -y

Further ways to install it are described in our guide Installing Java 17 on Debian.

Checking the Java installation

Afterwards, check which Java version is actually active:

java -version

The output has to show the major version you want, for example "openjdk version 21". If a different version appears, a second Java installation is still set as the default.

Installing screen so the server keeps running

Without a helper, the Minecraft server would be terminated as soon as you close your SSH session. The "screen" package keeps the process alive in a session of its own:

apt install screen -y

Creating a dedicated user for the Minecraft server

Never run the server as root. Create a dedicated user instead. This matters above all when further applications run on the same server, because a compromised plugin then cannot reach the entire system.

adduser --disabled-login spigot

The --disabled-login option disables direct login over SSH for this user. You can skip the prompts for name, address or phone number with the Enter key.

Now switch to the new user and into its home directory:

su spigot && cd

There, create a directory for the server ("server" in this example) and change into it:

mkdir server && cd server/

Choosing and downloading a Paper version

You will find the Paper version you want on the official download page: https://papermc.io/downloads. The version selector there also gives you access to older builds.

Copy the download link (right-click the build button, then "Copy link address"), switch back to the SSH console and download the file with wget. That looks roughly like this:

#THIS IS ONLY AN EXAMPLE LINK, PLEASE USE THE CURRENT LINK FROM PAPERMC.IO!

wget https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/45/downloads/paper-1.20.1-45.jar

After that, rename the downloaded file to "spigot.jar" so the start script can always use the same file name. When you switch versions later, you only swap out the file:

mv paper*.jar spigot.jar

Creating the start script and accepting the EULA

Create a file called "start.sh":

nano start.sh

Enter the following content. In the example the server gets 4 GB of RAM, and you adjust that value to your server through -Xmx:

screen -AmdS spigot java -Xmx4G -jar spigot.jar

Save the file with "CTRL + X", then "Y" and "Enter".

Next, make the script executable and accept the Minecraft end user license agreement. No Minecraft server starts without an accepted EULA:

chmod +x start.sh && echo "eula = true" > eula.txt

Starting the Minecraft server and using the console

Now start the server:

./start.sh

The first start takes a little longer, because the world is generated and the configuration files are created.

With "CTRL + A + D" you leave the server console without stopping the server. You can get back into the console at any time with:

screen -r spigot

Important: the screen session belongs to the user "spigot". So switch to that user with su spigot first, before you call screen -r.

Next steps after the installation

The server is running, which completes the base installation. Two points are worth tackling right afterwards:

  • Automatic start: To make the server come back up on its own after a reboot of the operating system, set up a systemd service unit. Our guide Starting a Minecraft server automatically describes the complete procedure.
  • Configuration: In the file "server.properties" you define the game mode, difficulty, maximum player count and port, among other things. Every change requires a restart of the server.

Frequently asked questions

Which Java version does my Minecraft server need?
Minecraft 1.20.5 and newer requires Java 21. Versions from 1.18 to 1.20.4 run on Java 17, and 1.16.5 or older needs Java 8. If the server starts with a Java version that is too old, it aborts immediately with an error message.
How much RAM does a Minecraft server need?
For a small round without plugins, 2 GB is enough. With plugins, mods or more than 20 players, plan for 4 GB to 8 GB. You set the value in the start script through the -Xmx parameter.
Which port has to be open for a Minecraft server?
The Java Edition uses TCP port 25565 by default. That port has to be open in the firewall of your server, otherwise players cannot connect.
What is screen used for on a Minecraft server?
screen keeps the server process alive in a session of its own, even when you drop the SSH connection. Without screen, the Minecraft server would be terminated as soon as you log out.
What is the difference between Paper, Spigot and Bukkit?
Paper is a further development of Spigot, which in turn builds on Bukkit. Paper stays compatible with Spigot and Bukkit plugins, but delivers considerably more performance and additional configuration options.

Minecraft server Paper server Spigot server Debian Ubuntu Java 21 Gameserver Linux