Tutorials / Minecraft

How to Set Up a Minecraft Server on a VPS

beginner45 minLast reviewed: 2026-04-30

Minecraft servers are usually RAM-bound before they are bandwidth-bound. A quiet vanilla world can run on a small server, but Paper, plugins, large view distances, and many players quickly need more memory and CPU headroom. The safest approach is to start with Performance for a small community and move to Pro when the server is public, modded, or expected to handle busy peaks.

This guide installs Paper on Ubuntu 24.04, runs it under a dedicated user, and manages it with systemd. uNode VPS servers already have a public IP, so there is no home-router port forwarding step. You still need to allow the port through the local firewall if you enable one.

Illustration for How to Set Up a Minecraft Server on a VPS

Prerequisites

  • A uNode VPS deployed with Ubuntu 24.04 LTS.
  • A plan with enough RAM for your player count; Performance is the practical starting point.
  • SSH access as root.
  • Players connecting to the VPS public IP or a DNS record pointing at it.
Open console server deploy

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 -version

Step 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/minecraft

Step 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.jar

Step 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 --nogui

Step 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-pager

Step 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 enable

Step 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