How to Run a Minecraft Server on a VPS
Written by the ApexVPS team • Last updated: July 2026 • 8 min read
Running a Minecraft server on a VPS gives you dedicated performance, low latency, and full root control. The first thing to get right is your Minecraft server VPS requirements, and the single biggest factor is RAM. Get the memory sizing correct for your player count and mods, and the rest — installing Java, launching Paper, keeping the process alive, and opening the firewall — is straightforward. This guide walks through the whole setup with accurate, copy-paste commands for Ubuntu and Debian.
Why run Minecraft on a VPS?
Shared or "budget" hosting oversells CPU and RAM, so your tick rate drops the moment a neighbour spikes. A VPS with truly dedicated resources avoids that: no overselling, no noisy neighbours, and consistent performance around the clock. You also get full root access to install any Java version, tune JVM flags, run backups on your own schedule, and add plugins or mods. If you want the trade-offs spelled out for multiplayer workloads, read our dedicated guide to a VPS for game servers.
Minecraft server VPS requirements: RAM and CPU by player count
Memory is what makes or breaks a Minecraft server. The world, loaded chunks, entities, and plugins all live in RAM, so undersizing it causes lag spikes and out-of-memory crashes. CPU matters too — the main game loop is largely single-threaded, so strong per-core performance keeps your tick rate at a healthy 20 TPS.
RAM is the key factor
Use the table below as a starting point, then adjust upward if you add plugins, mods, or a larger world border. Note that you should never hand every gigabyte to Java: leave at least 1 GB free for the operating system, SSH, and backups.
| Server type & players | Allocate to Minecraft | Suggested ApexVPS plan |
|---|---|---|
| Vanilla / Paper, 1–5 players | ~2–3 GB | Starter Pro (4 GB RAM) |
| Paper + a few plugins, 5–15 players | ~4–6 GB | Business (8 GB RAM) |
| Modpacks or 15–30+ players | ~8–12 GB | Enterprise (16 GB RAM) |
CPU and single-thread performance
Every ApexVPS plan ships with dedicated vCPU rather than shared cores, so the CPU cycles you pay for are always available. Starter Pro gives you 2 vCPU, Business 4 vCPU, and Enterprise 8 vCPU. World generation, redstone, and mob-heavy areas are the most CPU-intensive moments; more cores help with chunk loading and background tasks, but a single fast core is what sustains your tick rate during normal play.
Mods and modpacks
Forge and Fabric modpacks are far heavier than vanilla. A large modpack can easily demand 8–12 GB of RAM on its own, before you add players. If you plan to run a popular modpack, start with the Business or Enterprise tier and monitor memory use before scaling.
Pick a low-latency location
Latency is felt directly by players as "lag," so host close to them. ApexVPS operates 39 locations worldwide — 18 privacy jurisdictions and 21 standard regions — with low latency in major regions, including Frankfurt, New York, Singapore, London, Los Angeles, Tokyo, Amsterdam, and Sydney. Pick the region nearest the bulk of your community; you can note your preferred location in the optional field at signup.
Install Java
Modern Minecraft (1.20.5 and newer) requires Java 21. Update the system and install the headless JRE, which is lighter because it skips desktop libraries you do not need on a server:
sudo apt update && sudo apt upgrade -y
sudo apt install -y openjdk-21-jre-headless
java -version
The last command should print a Java 21 version string. If you are pinned to an older Minecraft release that needs Java 17, install openjdk-17-jre-headless instead.
Set up a Paper (or Vanilla) server
Create a dedicated system user and directory so the server never runs as root:
sudo adduser --system --group minecraft
sudo mkdir -p /opt/minecraft
sudo chown minecraft:minecraft /opt/minecraft
Paper is an optimized, drop-in fork of the vanilla server that handles more players per gigabyte and supports plugins — it is the most common choice for self-hosting. Vanilla is the official jar and matches single-player behaviour exactly. Download your chosen jar into the server directory. For Paper, copy the current build URL from the official downloads page and substitute it below:
cd /opt/minecraft
# Grab the current download URL from papermc.io/downloads, then:
sudo -u minecraft wget -O server.jar "PASTE_PAPER_DOWNLOAD_URL_HERE"
Run the server once to generate its files. It will stop immediately and ask you to accept the EULA:
cd /opt/minecraft
sudo -u minecraft java -Xms2G -Xmx3G -jar server.jar --nogui
Open the generated eula.txt and set the flag to true (this confirms you accept Mojang's End User License Agreement), then start the server again:
sudo -u minecraft sed -i 's/eula=false/eula=true/' /opt/minecraft/eula.txt
While you are here, it is worth tuning server.properties: lowering view-distance (for example to 8) and simulation-distance is the fastest way to reduce RAM and CPU load on busy servers.
Allocate RAM with JVM flags
Set the initial (-Xms) and maximum (-Xmx) heap to the same value so the JVM does not spend time resizing. Pair that with the widely used G1GC tuning flags to smooth out garbage-collection pauses. On a Business plan (8 GB), allocating 6 GB to Minecraft is a sensible split:
java -Xms6G -Xmx6G \
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC \
-XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M \
-jar server.jar --nogui
Scale -Xms/-Xmx to match your plan and the sizing table above, always leaving headroom for the OS.
Keep the server running: screen or systemd
Your SSH session will close eventually, so the server needs to run detached from your terminal.
Quick start with screen
screen is the fastest option for testing. Start a named session, launch the server, then detach with Ctrl+A followed by D. Reattach any time to reach the server console:
sudo apt install -y screen
screen -S minecraft
# start the server with your java command, then press Ctrl+A then D to detach
# reattach later with:
screen -r minecraft
Production setup with systemd
For anything long-lived, a systemd service is better: it starts on boot and restarts after a crash. Create /etc/systemd/system/minecraft.service:
[Unit]
Description=Minecraft Server
After=network.target
[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/usr/bin/java -Xms6G -Xmx6G -XX:+UseG1GC -jar server.jar --nogui
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Reload systemd, then enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo systemctl status minecraft
Open the port in UFW
Minecraft's Java Edition listens on TCP port 25565 by default. Before enabling the firewall, always allow SSH first so you do not lock yourself out of the server:
sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw enable
sudo ufw status
Players connect using your VPS IP address (Business and Enterprise plans include dedicated IPv4). ApexVPS also provides always-on DDoS protection, which matters for public game servers.
Back up your world
Back up before every update and on a regular schedule. The cleanest approach is to stop the server (or run save-off and save-all in the console) so files are not being written, then archive the world folders:
mkdir -p ~/backups
sudo systemctl stop minecraft
sudo tar -czf ~/backups/world-$(date +%F).tar.gz -C /opt/minecraft world world_nether world_the_end
sudo systemctl start minecraft
Automate it with a cron job that runs during off-peak hours. On top of your own archives, ApexVPS runs daily backups on Starter Pro and hourly snapshots on Business and Enterprise, giving you a second layer of recovery if a world corrupts.
Pay with crypto, no card required
ApexVPS checkout is crypto-only through OxaPay and accepts Bitcoin, Ethereum, USDT, and 30+ other coins — no credit card and no bank account. Signup is email-only: we ask for an email to send access details plus optional notes for your SSH key, OS, or preferred location, with no name, address, or KYC. The invoiced crypto amount is locked at invoice creation and valid for 90 minutes, and provisioning starts once the payment confirms on-chain. For the full picture of anonymous, card-free hosting, see our overview of crypto-friendly VPS hosting. When you are ready to launch, compare our VPS plans and pricing and pick the RAM tier that matches your player count.
Frequently asked questions
How much RAM do I need for a Minecraft server?
RAM is the key factor. A small vanilla or Paper server for 1–5 players runs on about 2–3 GB, a plugin server for 5–15 players usually wants 4–6 GB, and 15–30+ players or heavy modpacks often need 8–12 GB. Always leave at least 1 GB free for the operating system rather than allocating everything to Java.
Is a VPS good for a Minecraft server?
Yes. A VPS with dedicated CPU and RAM delivers consistent tick performance without noisy neighbours, plus full root access to install Java, tune JVM flags, and manage backups. Choosing a nearby data center keeps latency low for your players.
Should I use Vanilla or Paper?
Vanilla is the official server and matches single-player behaviour exactly. Paper is an optimized, plugin-capable fork that serves more players per gigabyte of RAM, which is why most self-hosted servers use it.