The Short Answer
Renting a Minecraft server from a game host is convenient but expensive per gigabyte of RAM; running one on a general-purpose VPS gives you more control and often more resources for the same money. For a small survival server for friends, a 2 vCPU / 4 GB VPS running Paper (the optimised server software) handles up to about 10 players comfortably, and the whole setup takes under an hour: install Java, download Paper, accept the EULA, open port 25565, and run the server as a systemd service so it survives reboots. This guide covers Java Edition — the version with the mod and plugin ecosystem — on Ubuntu 24.04.
If you are wondering whether a free server can run Minecraft at all, see Free VPS for Game Servers: What You Can Actually Run. And if you have not picked a server yet, How to Choose a VPS: A Beginner’s Guide covers the basics.
Step 1: Choose the Right Server Size
Minecraft is single-threaded for its main game loop, so single-core CPU speed matters more than core count, and RAM matters more than both once the world grows. Sizing guidance from current hosting guides (checked 23 November 2026):
| Server type | Players | Recommended RAM | Notes |
|---|---|---|---|
| Vanilla or Paper, small group | 1–5 | 2–4 GB | Start here for friends |
| Vanilla or Paper survival | 5–20 | 4–6 GB | The most common setup |
| Paper with many plugins | 20+ | 6–10 GB | Paper’s own guidance suggests 6–10 GB for plugin-heavy servers |
| Light modded (Fabric/Forge, under 50 mods) | Any | 4–6 GB | Follow the modpack author’s minimum |
| Large modpack (150+ mods) | Any | 8–12 GB | Heavy packs need 8 GB before players join |
Two sizing rules that save headaches:
- Leave 1–1.5 GB for the operating system and the JVM itself. The heap you give Minecraft (
-Xmx) is not the server’s total memory use. A 4 GB VPS comfortably runs a 2.5–3 GB heap; if you want a 6 GB heap, buy an 8 GB server. - Never allocate 100% of the server’s RAM to the heap. Keep roughly 20% headroom, or the JVM and the OS fight over memory and the server crashes with out-of-memory errors.
For a first server, 2 vCPU / 4 GB RAM is the sweet spot: it runs a Paper survival world for a group of friends with room to grow. Contabo’s Cloud VPS 4 (4 vCPU / 8 GB, from €4.40/month on a 24-month term, checked 23 November 2026) is generous for a Minecraft server; Hetzner’s CX23 (2 vCPU / 4 GB, €5.49/month excluding VAT, checked 23 November 2026) fits the recommended size exactly. Pick a server region near your players — latency matters in a game, and a Singapore server serves Asian players far better than a German one.
Step 2: Prepare the Server
Log in and update the system. Create a dedicated user for the game server — never run it as root:
sudo apt update && sudo apt upgrade -y
sudo adduser minecraft
sudo usermod -aG sudo minecraft
Switch to the new user for the rest of the setup:
su - minecraft
Also secure the server if you have not already — How to Secure Your VPS covers SSH keys, the firewall and fail2ban. A game server is a public-facing service and gets scanned like any other.
Step 3: Install Java
Minecraft Java Edition needs a Java runtime. The required version depends on the Minecraft version: Java 21 for Minecraft 1.20.5 through 1.21.x; newer Minecraft releases (the 26.x line) require newer Java — check the version you plan to run and match Java accordingly. For the widely used 1.21.x releases, install OpenJDK 21:
sudo apt install openjdk-21-jre-headless
java -version
The -headless variant omits the graphical libraries a server never needs. If you plan to run a newer Minecraft release, install the matching newer JDK (for example openjdk-25-jre-headless for releases requiring Java 25) — Paper’s download page states the required Java version for each build.
Step 4: Download Paper
You have three main server software choices:
- Vanilla — Mojang’s official server. Simplest, least optimised, no plugins.
- Paper — a high-performance fork of Spigot with plugin support and major optimisations. The recommended choice for most servers.
- Fabric / Forge — for modded servers. More setup, more RAM, access to the mod ecosystem.
This guide uses Paper. Download the latest build from Paper’s website (papermc.io) — get the direct link from the downloads page, since the exact version number changes with every release:
mkdir -p ~/server && cd ~/server
curl -o paper.jar https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/133/downloads/paper-1.21.1-133.jar
The URL above is an example for a specific build — always take the current download link from papermc.io, because build numbers change frequently. Alternatively, download the jar in your browser and upload it with SFTP.
Step 5: First Run and the EULA
Start the server once to generate the configuration files:
java -Xms2G -Xmx3G -jar paper.jar --nogui
The flags: -Xms2G sets the starting heap to 2 GB, -Xmx3G caps it at 3 GB (adjust to your server size per Step 1), and --nogui disables the graphical console, which a headless server cannot display.
The server will stop almost immediately with a message about the EULA. Mojang requires you to accept the End User License Agreement before the server runs. Open the generated file:
nano eula.txt
Change eula=false to eula=true, save, and start the server again. This time it generates the world — the first start takes a minute or two — and you will see Done! in the console when it is ready.
Step 6: Configure the Server
The main settings live in server.properties. The important ones for a new server:
# Who can join
online-mode=true
white-list=false
# Gameplay
difficulty=normal
gamemode=survival
max-players=20
view-distance=10
simulation-distance=10
# The message players see in the server list
motd=My VPS Minecraft Server
Key decisions:
online-mode=trueverifies players against Mojang’s accounts. Keep it true unless you have a specific reason not to — turning it off lets anyone join with any username, including impersonating your admins.view-distancecontrols how far players can see. Lower values (8–10) dramatically reduce CPU and RAM load. The default of 10 is a good balance; drop to 8 on a small server.white-list=trueplus/whitelist add <player>in the console restricts the server to named players — recommended for a friends server, since an open server will attract griefers within days.
Paper adds its own configuration in config/paper-global.yml and config/paper-world-defaults.yml, where you can tune entity activation ranges and tick settings. The defaults are good; change them only if you are chasing specific lag problems.
Make yourself an operator (admin) from the server console:
op YourMinecraftUsername
Step 7: Open the Firewall
Minecraft Java Edition uses TCP port 25565 by default:
sudo ufw allow 25565/tcp
If your provider has a separate cloud firewall, allow the port there too. Players connect using your server’s IP address (or a domain pointed at it — see How to Point a Domain to Your VPS) with no port number needed if you use the default 25565.
Step 8: Run the Server as a Service
A server that dies when your SSH session closes is useless. Create a systemd service so Minecraft starts at boot and restarts after crashes:
sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Paper Server
After=network.target
[Service]
User=minecraft
WorkingDirectory=/home/minecraft/server
ExecStart=/usr/bin/java -Xms2G -Xmx3G -jar paper.jar --nogui
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start it:
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
Useful commands from here on:
sudo systemctl status minecraft # is it running?
sudo journalctl -u minecraft -f # follow the live log
sudo systemctl restart minecraft # restart after config changes
To run console commands (such as /op or /whitelist) while the service runs, use screen or tmux instead of a plain systemd service — or install an admin plugin such as a web console. The simplest approach for occasional commands: stop the service, run the server interactively once, issue commands, stop it with /stop, and restart the service.
Step 9: Back Up the World
The world directory is the irreplaceable part of a Minecraft server — everything else can be reinstalled in minutes. Back it up daily, and never copy a live world while the server is running (you will get a corrupt backup).
The safe pattern: stop the server, copy the world, start the server — or use a plugin that saves and snapshots the world without stopping. A simple nightly cron script:
sudo nano /usr/local/bin/mc-backup.sh
#!/bin/bash
systemctl stop minecraft
tar -czf /var/backups/minecraft/world-$(date +%F).tar.gz -C /home/minecraft/server world world_nether world_the_end
systemctl start minecraft
find /var/backups/minecraft -name 'world-*.tar.gz' -mtime +7 -delete
sudo chmod +x /usr/local/bin/mc-backup.sh
sudo mkdir -p /var/backups/minecraft
sudo crontab -e
0 4 * * * /usr/local/bin/mc-backup.sh
This stops the server briefly at 4 a.m., archives the three world dimensions, restarts, and deletes backups older than 7 days. For off-site copies, add the backup directory to your restic routine — see How to Back Up Your VPS.
Improving Performance
If players report lag (block lag, rubber-banding, delayed mob movement), work through these in order:
- Check TPS (ticks per second — 20 is perfect). Run
/tpsin the console. Below 18 consistently means the server is struggling. - Reduce view-distance to 8 and simulation-distance to 6 in
server.properties. This is the single biggest lever. - Pre-generate the world. Exploring new terrain generates chunks, which is the most CPU-intensive thing a server does. Use the Chunky plugin to pre-generate a radius around spawn during off-hours.
- Limit entity counts. Paper’s config lets you cap monsters and animals per chunk. Entity-heavy farms (hundreds of mobs in one place) are the most common cause of lag on survival servers.
- Use Aikar’s JVM flags. Paper’s documentation recommends a tuned set of Java flags (known as Aikar’s flags) that improve garbage collection for Minecraft’s allocation patterns. They are a drop-in replacement for the plain
-Xms/-Xmxflags in the service file — copy them from Paper’s documentation page rather than from memory, as they are long and version-specific. - Upgrade the server if TPS stays low after tuning — single-core CPU speed is what matters most. See How to Upgrade Your VPS.
Troubleshooting
“Connection refused” when joining. The server is not running, or the port is blocked. Check sudo systemctl status minecraft, then the firewall (sudo ufw status — is 25565/tcp allowed?), then the provider’s cloud firewall. Test locally with sudo ss -tlnp | grep 25565 — if nothing listens, the server process is not up.
“Outdated client / outdated server.” The player’s Minecraft version does not match the server version. Either update the server jar to the latest Paper build or have the player switch versions in the Minecraft launcher. Paper builds are per-version, so a version change means downloading a new jar.
Server crashes with OutOfMemoryError. The heap is too small for the world and player count, or too large for the physical RAM (leaving nothing for the OS). Reduce -Xmx to leave 1–1.5 GB for the system, or upgrade the plan. Also check for a memory leak from a misbehaving plugin — remove plugins one at a time if crashes correlate with a recent addition.
“Failed to bind to port.” Another process already uses 25565 — usually a second Minecraft instance, or a previous run that did not shut down cleanly. Find it with sudo ss -tlnp | grep 25565 and stop the duplicate, or change server-port in server.properties (players then connect with IP:port).
Players get “Not authenticated with Minecraft.net.” The server’s online-mode is true but Mojang’s authentication servers are unreachable — or the player’s session expired. Usually transient; if persistent, check the server’s outbound internet access and DNS. Do not “fix” this by setting online-mode=false unless you understand that it disables all identity verification.
The server starts but the world is empty/reset. The server is loading a different world folder than you expect — check the level-name setting in server.properties and the contents of the server directory. If you restored from backup, confirm the world folders landed in the right place with the right ownership (sudo chown -R minecraft:minecraft /home/minecraft/server).
Frequently Asked Questions
Can I host a Minecraft server on a free VPS?
Barely. The Oracle Cloud Always Free Ampere instance (2 OCPUs / 12 GB RAM) can run a small Paper server — it is the only free tier with enough RAM — but capacity is often unavailable and the ARM architecture needs ARM-compatible Java (available in Ubuntu’s repositories). Tiny 1 GB free instances cannot run a playable server. See Free VPS for Game Servers for the full picture.
Java Edition or Bedrock — which should I host?
Java Edition if your players are on PC/Mac/Linux and you want plugins and mods. Bedrock if your players are on console or mobile. They are different games with different server software and cannot cross-play without a proxy such as GeyserMC, which lets Bedrock clients join a Java server — a popular setup for mixed groups, though it adds complexity.
How many players can a 4 GB VPS handle?
For vanilla or Paper survival, roughly 10 players comfortably, more if they stay near each other (loaded chunks, not headcount, drive resource use). Ten players spread across the map load far more chunks than ten players building one base together. Plugins and mods reduce the number; pre-generated worlds and lower view distance increase it.
Do I need a domain name for a Minecraft server?
No — players can connect with the raw IP address. A domain (or subdomain like mc.yourdomain.com) is nicer to share and lets you move servers without telling everyone a new IP. Point an A record at the VPS; no special DNS record is needed for the default port.
Can I run a Minecraft server and a website on the same VPS?
Yes, if the RAM allows. A 4 GB server running a 3 GB Minecraft heap leaves little for a web stack — an 8 GB server handles both comfortably. Keep the services in separate users and firewall rules, and monitor memory (see How to Monitor Your VPS) so one service cannot starve the other.
How do I update the server to a new Minecraft version?
Download the new Paper jar for the target version, stop the server, back up the world, replace the jar, and start. Always back up first — version upgrades can corrupt worlds, and plugins may break until their authors release updates. Test major updates on a copy of the world before applying them to the live server.
The Bottom Line
A 2 vCPU / 4 GB VPS, Paper, Java 21 and a systemd service is everything a friends survival server needs — under an hour of setup for a server you fully control, with plugins, your own rules and no per-player fees. Size the RAM honestly, keep the view distance sane, and back up the world every night: the world is the one thing you cannot reinstall.



Leave a Reply