Blog / Tutorials

How to run a Minecraft server on a VPS

By the NoctHost TeamJune 10, 20268 min read

Hosting your own Minecraft server means no player caps you did not choose, no rented-slot pricing, and full control over plugins, mods, and config. A small VPS handles a few friends comfortably; a slightly larger one runs a busy survival world.

This guide uses Paper, a high-performance drop-in for the vanilla server that runs the same worlds with far better tick performance and plugin support. You will install Java, configure the server, open the port, and run it as a systemd service so it survives reboots.

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

Step 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/minecraft
Tip — Always match the Paper version to the Minecraft version your players use. Mismatched clients and servers refuse to connect.

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

After it exits, edit eula.txt and set the flag to true:

/opt/minecraft/eula.txt
eula=true

Step 4: Configure the server

Edit server.properties to taste. A few keys worth setting before your first real launch:

/opt/minecraft/server.properties (excerpt)
motd=My NoctHost survival server
max-players=10
view-distance=8
difficulty=normal
online-mode=true
server-port=25565
Tip — Keep online-mode=true unless you are deliberately running a cracked/offline server. Online mode verifies accounts with Mojang and blocks username spoofing.

Step 5: Open the firewall

ufw allow 22/tcp
ufw allow 25565/tcp
ufw enable

Java 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.

/etc/systemd/system/minecraft.service
[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.target
systemctl daemon-reload
systemctl enable --now minecraft
systemctl status minecraft

Players 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.

Spin one up in about a minute

Email signup, pay with crypto, hourly billing. Trying a box costs cents — destroy it when you are done.

Deploy a server

Frequently asked

How much RAM do I need?
For a handful of friends on vanilla or light Paper, 2-3 GB of heap is plenty. Heavy plugin or modpack servers and bigger player counts want 4-8 GB or more. Set -Xmx below your total RAM so the OS keeps room to breathe.
Paper or vanilla?
Paper runs the same worlds as vanilla but with major performance optimizations and plugin support, and it is a drop-in replacement. For a self-hosted server there is little reason to run the plain vanilla jar.
Why systemd instead of just screen?
screen is handy for poking at the console, but it will not restart the server after a crash or a reboot. systemd gives you boot persistence and auto-restart; you can still use an RCON client for interactive admin commands.

Keep reading