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
How many vCPU, how much memory and storage for my VPS?
Practical guidelines to size your VPS for your project, and how to tell when it is time to add resources.
Paying your invoice by Interac e-Transfer
How to pay an invoice by Interac e-Transfer: amount, recipient, message and security question. Your server is then delivered automatically.
Turning on automatic security updates
Install security fixes automatically on Debian, Ubuntu, AlmaLinux and Rocky Linux, and choose when reboots happen.

