Skip to content

Set up a Paper Minecraft server on Ubuntu 24.04

Install Java, download Paper, accept the EULA, pick your port and keep the server running with systemd on an Ubuntu 24.04 VPS.

Before you start

This guide installs Paper by hand over SSH. It works on any Ubuntu 24.04 VPS where you have root access. If you would rather manage servers from a browser, Velbyr can set up a game panel on eligible VPSs by request.

  • An Ubuntu 24.04 VPS and its SSH connection details.
  • A port your players can reach. On a shared IPv4 address, use a port from your assigned block.
  • Enough memory for the server and the operating system together. Leave about 1 GB for the system.

Install Java

Paper needs a specific Java version for each Minecraft release. Minecraft 26.1 and newer need Java 25, and 1.20 to 1.21.11 need Java 21; the Paper documentation lists older releases. This guide installs Java 25 for a current server.

Paper recommends Amazon Corretto and advises against the headless Java packages, which lack libraries it needs. Connect to your VPS over SSH and add the Corretto package repository.

sudo apt update
sudo apt install -y ca-certificates apt-transport-https gnupg wget
wget -O - https://apt.corretto.aws/corretto.key | sudo gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | sudo tee /etc/apt/sources.list.d/corretto.list

Install Java and check the version. The output should start with openjdk 25.

sudo apt update
sudo apt install -y java-25-amazon-corretto-jdk libxi6 libxtst6 libxrender1
java -version

Create a user for the server

Run the server as its own user, not as root. A plugin or a crafted world file then cannot touch the rest of the system.

sudo useradd --system --create-home --home-dir /opt/minecraft --shell /usr/sbin/nologin minecraft

Download Paper

Open the Paper downloads page at papermc.io/downloads, choose your Minecraft version and copy the link of the latest build. Download it as the minecraft user.

cd /opt/minecraft
sudo -u minecraft curl -fL -o paper.jar "PASTE_THE_DOWNLOAD_LINK_HERE"

Start once and accept the EULA

The first start creates the configuration files and then stops, because the Minecraft EULA has not been accepted yet.

sudo -u minecraft java -Xms1G -Xmx1G -jar paper.jar --nogui

Read the Minecraft EULA at aka.ms/MinecraftEULA. If you agree, record that in eula.txt. You accept it yourself; nobody can accept it for you.

sudo -u minecraft sed -i 's/eula=false/eula=true/' eula.txt

Set the port

Minecraft listens on port 25565 by default. On a shared IPv4 address that port is not yours, so set server-port to a port from your assigned block. Do not use the first port of the block: it carries SSH.

sudo -u minecraft nano server.properties
server-port=YOUR_PORT

If you use a firewall inside the VPS, allow the same port for TCP.

sudo ufw allow YOUR_PORT/tcp

Keep it running with systemd

A systemd service starts the server at boot, restarts it after a crash and stops it cleanly. Create the unit file:

sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Paper Minecraft server
After=network-online.target
Wants=network-online.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/usr/bin/java -Xms3G -Xmx3G -jar paper.jar --nogui
Restart=on-failure
RestartSec=10
SuccessExitStatus=0 143

[Install]
WantedBy=multi-user.target

Set -Xms and -Xmx to the memory you want Minecraft to use. The example gives it 3 GB, which suits a VPS with 4 GB of memory. Then enable and start the service.

sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo systemctl status minecraft

Follow the server log while it starts:

sudo journalctl -u minecraft -f

Connect and invite players

In Minecraft, add a server and enter your VPS address followed by a colon and your port, for example 203.0.113.10:YOUR_PORT. Use the address from your VPS connection details.

If you own a domain, add it under Custom domains in VPS management and players can join at your-domain:YOUR_PORT. An SRV record named _minecraft._tcp that points at your domain and port then lets Java Edition players join with just the domain name.

Updates and backups

To update Paper, stop the service, download the new build over paper.jar and start the service again. Archive the server folder first.

sudo systemctl stop minecraft
sudo tar -czf /root/minecraft-$(date +%F).tar.gz -C /opt minecraft
sudo systemctl start minecraft

A backup on the same disk does not protect you from losing the VPS. Copy backups to another machine as well.