How to Run a Minecraft Server on a Cheap VPS for Friends

A minecraft server on a cheap vps is the easiest way to play with friends without renting an overpriced game server or leaving your own PC running all day. A small VPS costs a few dollars a month, stays online 24/7, and gives you full control over the world, the plugins, and who can join. This guide walks through the whole setup on Ubuntu 24.04, from picking the right plan to letting your friends connect.

Pick the right plan for a Minecraft server on a cheap VPS

Before you install anything, get the sizing right. Minecraft is mostly a single-threaded game, so clock speed and RAM matter more than core count. A server that lags with five players usually runs out of RAM or CPU headroom, not disk space. If you are still comparing plans, read our guide on how to choose VPS specs for RAM, CPU, and storage first, and check the current roundup of best budget VPS providers for small projects — prices change often, so check official pricing before you commit.

Players RAM vCPU Notes
2-4 2 GB 1-2 Vanilla or a few plugins
5-10 4 GB 2 Paper with light plugins
10-20 6-8 GB 2-4 Paper, more plugins, bigger world
20+ 8 GB or more 4 Consider a larger plan or a dedicated box

Pick a location close to where your friends live. A server on the other side of the world adds latency that no amount of RAM can fix. For a group of friends, 2 GB of RAM is the realistic floor, and 4 GB is the comfortable pick if you plan to add plugins later.

Choose your server software: Vanilla, Paper, or something else

Vanilla is the official server jar from Mojang. It works, but it has no plugin support and no performance tuning. For a friends server, a paper minecraft server is the better default: it runs the same game, accepts Bukkit and Spigot plugins, and patches in performance fixes that vanilla lacks. Paper is a drop-in replacement, so your friends connect with the normal Minecraft client and notice nothing different.

Other options exist. Spigot is Paper’s older sibling and still works, but Paper is faster and better maintained. Fabric is the pick if you want mods rather than plugins, and it needs a different setup. For this guide, stick with Paper unless you already know you need Fabric mods.

Match the server version to the Minecraft version your friends play. If they are on 1.21, download the Paper build for 1.21. Mixing versions is the most common reason friends see a “client version outdated” error when they try to join.

Set up the VPS and install Java

Start with a fresh Ubuntu 24.04 VPS and log in over SSH as a non-root user with sudo. Update the system first:

sudo apt update && sudo apt upgrade -y

Paper needs Java. Modern Minecraft versions need Java 21, so install it from the Ubuntu repositories:

sudo apt install -y openjdk-21-jre-headless

Check it with java -version. You should see version 21. If your VPS came with an older Java, install 21 and point the server at it explicitly, because running Paper on the wrong Java version fails with a confusing error.

Create a dedicated user and folder for the server. Running a game server as root is a bad habit, and a separate folder keeps the world files, jars, and backups in one place:

sudo useradd -m -d /opt/minecraft minecraft
sudo mkdir -p /opt/minecraft/server
sudo chown -R minecraft:minecraft /opt/minecraft

Download Paper and start the server

Download the Paper jar from the official Paper website (papermc.io) and place it in the server folder. Rename it to something simple like paper.jar so your start script stays readable. Then switch to the minecraft user and run it once:

cd /opt/minecraft/server
java -Xms2G -Xmx2G -jar paper.jar --nogui

The first run stops and asks you to accept the Minecraft EULA. Open eula.txt, change eula=false to eula=true, and run the command again. The server will generate the world and print “Done” when it is ready. Type stop in the console to shut it down cleanly.

The -Xms and -Xmx flags set the minimum and maximum heap. For a 4 GB VPS, -Xms2G -Xmx2G leaves room for the operating system. That is the single most important piece of minecraft server ram tuning on a small box: never give the whole VPS to Java, or the system starts swapping and everything slows to a crawl.

Run the server as a service so it survives reboots

A server you start by hand dies when your SSH session closes. A systemd service fixes that. Create /etc/systemd/system/minecraft.service:

[Unit]
Description=Minecraft Server
After=network.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft/server
ExecStart=/usr/bin/java -Xms2G -Xmx2G -jar paper.jar --nogui
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Then enable and start it:

sudo systemctl daemon-reload
sudo systemctl enable --now minecraft

Check the log with sudo journalctl -u minecraft -f. If the service restarts in a loop, read the log before changing anything: it usually points at the exact problem, such as a bad flag or a missing file.

Open the firewall and let friends connect

Minecraft listens on port 25565 by default. Your VPS firewall must allow it, or your friends will time out. If you use UFW, the setup is two commands. Our step-by-step guide to setting up UFW firewall rules on Ubuntu covers the full hardening pass; the Minecraft part is this:

sudo ufw allow 25565/tcp
sudo ufw enable

That is the ufw firewall minecraft port rule in its simplest form. If your provider has a separate cloud firewall panel, open 25565 there too, because a blocked cloud firewall overrides anything UFW allows. Keep SSH open and do not open any other game ports you do not use.

Your friends connect with your VPS public IP address, optionally with :25565 after it. If you own a domain, point a subdomain such as mc.yourdomain.com at the VPS IP so nobody has to remember numbers. Set online-mode=true in server.properties so only players with a real Minecraft account can join. Turning it off lets cracked clients in and invites griefers.

Back up the world before you need it

A minecraft server backup is not optional. Worlds corrupt, disks fill up, and a bad plugin can eat a build your friends spent a week on. The simplest routine is a cron job that stops the server, copies the world folder, and starts it again:

0 4 * * * systemctl stop minecraft && tar -czf /opt/minecraft/backups/world-$(date +%F).tar.gz -C /opt/minecraft/server world && systemctl start minecraft

Keep those backups off the VPS as well. A backup on the same disk disappears with the disk. Our guide to backing up a VPS to S3-compatible storage with Restic shows a setup that copies backups to cheap object storage automatically. Test a restore at least once: a backup you have never restored is a guess, not a safety net.

Keep the server updated and secure

Update Paper and your plugins when a new Minecraft version lands, and keep the operating system patched. Unattended security updates handle the OS side with almost no effort; see our guide on automatic security updates on Ubuntu for the setup. A small VPS that never gets patched is an easy target, and a game server is a public service on the open internet.

A few habits keep a friends server healthy. Add plugins one at a time and watch the log after each one. Keep the player count inside what your RAM can handle. Restart the server once a day or so with a scheduled task if memory creeps up. And keep a list of who has operator status: only give it to people you trust, because an operator can change the world, ban players, and run any command.

Fix the most common problems

  • Friends cannot connect: check the firewall on the VPS and in the provider panel, confirm the service is running, and verify they use the right IP and port.
  • Server lags with few players: check free RAM and CPU with htop. If RAM is full, lower -Xmx or remove heavy plugins. If CPU is pegged, the world may need pre-generating or a plugin may be misbehaving.
  • Outdated client error: the Paper version and the client version do not match. Update one or the other.
  • Server crashes on start: read the log. A plugin built for another Minecraft version is the usual cause; remove plugins one by one until it starts.
  • World resets after a restart: the server was killed instead of stopped. Always use stop or the systemd service, never kill -9.

A cheap VPS runs a friends Minecraft server well when the sizing is honest and the basics are covered: enough RAM, Paper instead of vanilla, a systemd service, one open port, and backups that actually leave the server. Get those right and the server fades into the background, which is exactly what a good game server should do.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.