Step 1
Install Java
Paper requires a current Java runtime. Ubuntu's OpenJDK packages are fine for most servers. Update first, then install Java and basic tools.
ssh root@<your-server-ip>
apt update && apt upgrade -y
apt install -y openjdk-21-jre-headless curl screen ufw
java -versionStep 2
Create a Minecraft user and directory
Do not run the server as root. A dedicated system user limits the blast radius if a plugin has a bug or the Minecraft process writes unexpected files.
adduser --system --home /opt/minecraft --group minecraft
mkdir -p /opt/minecraft/server
chown -R minecraft:minecraft /opt/minecraftStep 3
Download Paper
Paper publishes builds through its API and download site. Replace the URL below with the latest stable Paper build for the Minecraft version you want. Keep the file name stable so the systemd unit does not need to change every upgrade.
cd /opt/minecraft/server
curl -L -o paper.jar https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar
chown minecraft:minecraft paper.jarStep 4
Accept the EULA and test boot
Minecraft requires accepting Mojang's EULA before the server runs. Read it first. Then start once to generate config files and world directories. The memory flags below are conservative for an 8 GB plan; lower them if the VPS is smaller and leave memory for the OS.
cd /opt/minecraft/server
echo 'eula=true' > eula.txt
chown minecraft:minecraft eula.txt
sudo -u minecraft java -Xms2G -Xmx6G -jar paper.jar --noguiStep 5
Create a systemd service
systemd keeps the server running after reboot and gives you one place to check logs. Tune Xms and Xmx based on plan size and plugins. Do not allocate all RAM to Java; the OS and disk cache need space too.
cat >/etc/systemd/system/minecraft.service <<'EOF'
[Unit]
Description=Minecraft Paper Server
After=network.target
[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft/server
Restart=on-failure
RestartSec=10
ExecStart=/usr/bin/java -Xms2G -Xmx6G -jar paper.jar --nogui
ExecStop=/bin/kill -SIGINT $MAINPID
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now minecraft
systemctl status minecraft --no-pagerStep 6
Open the Minecraft port
uNode gives the VPS a public IP, so players can connect directly. If UFW is enabled, allow TCP 25565. DNS is optional but nicer for players; create an A record such as play.example.com pointing to the server IP.
ufw allow OpenSSH
ufw allow 25565/tcp
ufw --force enableStep 7
Backups, mods, and tuning
Backups matter because worlds are stateful. Stop the server or use a plugin that safely snapshots the world before copying files. Store backups away from the VPS when possible. For mods and plugins, add one change at a time and watch memory, tick time, and logs. If TPS drops under load, reduce view distance and simulation distance before assuming you need a bigger server.
Performance is tied to player count, plugins, world generation, and storage. Pre-generating chunks can reduce lag during exploration. More RAM is not always the fix; single-thread CPU performance and plugin quality often matter more.
systemctl stop minecraft
tar -czf /root/minecraft-world-$(date +%F).tar.gz /opt/minecraft/server/world /opt/minecraft/server/world_nether /opt/minecraft/server/world_the_end
systemctl start minecraft
journalctl -u minecraft -f