What you'll need
- A VPS on Ubuntu 22.04/24.04. For a small group, 2-4 GB RAM is a good start; more players and plugins want more.
- A dedicated IPv4 so friends can connect directly.
- Java 21 (current Minecraft versions require it).
Step 1: Install Java
apt update
apt install -y openjdk-21-jre-headless screen
java -versionStep 2: Create a user and download Paper
Run the server as its own unprivileged user. Grab the latest Paper build jar from the official downloads and save it as server.jar. Check papermc.io for the current build URL for your Minecraft version.
adduser --system --group --home /opt/minecraft minecraft
cd /opt/minecraft
wget -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/latest/downloads/paper.jar
chown -R minecraft:minecraft /opt/minecraftStep 3: Accept the EULA and first run
The first launch generates files then stops because you have not accepted Mojang's EULA. Run it once, accept, and run again.
cd /opt/minecraft
sudo -u minecraft java -Xms1G -Xmx2G -jar server.jar noguiAfter it exits, edit eula.txt and set the flag to true:
eula=trueStep 4: Configure the server
Edit server.properties to taste. A few keys worth setting before your first real launch:
motd=My NoctHost survival server
max-players=10
view-distance=8
difficulty=normal
online-mode=true
server-port=25565Step 5: Open the firewall
ufw allow 22/tcp
ufw allow 25565/tcp
ufw enableJava Edition uses TCP 25565 by default. Bedrock uses UDP 19132 instead; open that if you run a Bedrock or Geyser setup.
Step 6: Run it under systemd
A systemd unit keeps the server up across crashes and reboots. The RAM flags matter: -Xms and -Xmx set the heap. A common rule is to leave the OS 1 GB and give the rest to Minecraft, but never exceed your real RAM.
[Unit]
Description=Paper Minecraft server
After=network-online.target
Wants=network-online.target
[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/usr/bin/java -Xms2G -Xmx3G -jar server.jar nogui
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetsystemctl daemon-reload
systemctl enable --now minecraft
systemctl status minecraftPlayers connect by entering your VPS IP (and :25565 if you changed the port) in the Multiplayer screen.
Backups and keeping it running
Your world is the world folder (plus nether and end dimensions). Snapshot it on a schedule. A nightly cron tar is the simplest reliable approach.
tar czf /opt/backups/world-$(date +%F).tar.gz -C /opt/minecraft world world_nether world_the_end- Read the console live: journalctl -u minecraft -f.
- Run admin commands by attaching to the server console (use an RCON client, or run interactively in screen for quick sessions).
- Copy backups off the box; a backup on the same server does not survive losing the server.
Because billing is hourly from one balance, a seasonal or weekend server is cheap: deploy in about 60 seconds, play for a few dollars over the month, and destroy the box when the session is over so charges stop that hour. NVMe storage keeps chunk loading and world saves snappy.