Kyrnet opens soon. Get notified of the launch on our Discord.

Join our Discord →
KyrnetKyrnet
Games

Hosting a Minecraft server on a VPS

Install a Minecraft Java (Paper) server on a Debian or Ubuntu VPS: Java, first launch, automatic start and opening the port.

1 min read · Updated on

This guide installs a Minecraft Java Edition server with Paper, an optimized build that supports plugins. It assumes a VPS running Debian 13 or Ubuntu 24.04.

What size of VPS?

For about ten players, plan on 2 to 4 vCPU and 6 to 8 GB of memory. Heavily explored worlds and large modpacks need more. You can add resources later from the client area.

1. Install Java

Recent Minecraft versions require Java 21 or newer:

apt update
apt install -y openjdk-21-jre-headless
java -version

2. Create a dedicated user

Never run the game server as root:

adduser --disabled-password --gecos "" minecraft
su - minecraft
mkdir server && cd server

3. Download Paper and accept the EULA

Download the latest Paper build from papermc.io ("Downloads" section), put the file in this folder and rename it paper.jar. Start it once:

java -Xms2G -Xmx4G -jar paper.jar --nogui

The server stops and creates eula.txt. Change eula=false to eula=true, then start it again. Set -Xmx to about 1 to 2 GB less than your VPS memory.

4. Keep it running

Go back to root (exit) and create the file /etc/systemd/system/minecraft.service:

[Unit]
Description=Minecraft server
After=network.target

[Service]
User=minecraft
WorkingDirectory=/home/minecraft/server
ExecStart=/usr/bin/java -Xms2G -Xmx4G -jar paper.jar --nogui
Restart=on-failure

[Install]
WantedBy=multi-user.target

Then enable it:

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

The server now starts automatically with the VPS.

5. Open the port

With the UFW firewall:

ufw allow 25565/tcp

Your players connect with your VPS IP address.

Back up the world

Stop the server (systemctl stop minecraft) before copying the world folder, or use a backup plugin. Always keep a copy outside the server.

Further reading