How to Host Minecraft Server on VPS for Friends in 2026

How to Host Minecraft Server on VPS for Friends in 2026

Running your own Minecraft world on a VPS means your friends can play even when your computer is off. When you host Minecraft server on VPS hardware, the world stays online around the clock, you control the mods and settings, and you stop paying a monthly fee to a game hosting company. This guide shows you how to set one up from scratch: install Java, download the Paper server jar, configure the server, open the right port, and keep the world backed up. You need a VPS with SSH access and about an hour of free time. You do not need prior server admin experience, but you should be comfortable typing a few commands in a terminal.

What You Need Before You Start

Start with a VPS that fits the job. A small private server for a few friends runs fine on 2 vCPU cores and 4 GB of RAM, with at least 2 GB set aside for Minecraft itself. If you plan to add plugins, a large explored world, or more than 10 players at once, 8 GB of RAM gives you more room. How much minecraft server ram you need depends on plugins and world size, so treat these numbers as rough starting points, not hard limits. Use Ubuntu 24.04 for this guide, since the commands below match its package names. Pick a server location close to where most of your friends live to keep ping low. If you have not picked a plan yet, our guide to choosing VPS specs for RAM, CPU, and storage walks through the trade-offs in more detail.

Host Minecraft Server on VPS: Install Java and Download Paper

This java server setup starts with a system update and a Java install. Paper 1.21 needs Java 21, so install the headless runtime on Ubuntu with:

sudo apt update && sudo apt upgrade -y
sudo apt install -y openjdk-21-jre-headless

Next, create a separate user and folder for the server so Minecraft never runs as root:

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

A paper minecraft server is the most common choice for a small private server because it runs Bukkit and Spigot plugins and performs better than the vanilla jar for most groups. Go to papermc.io, open the Paper downloads page, and copy the download link for the latest stable build. Then download it into the server folder, pasting the link you copied:

cd /opt/minecraft/server
sudo -u minecraft wget -O paper.jar "PASTE_PAPER_DOWNLOAD_LINK_HERE"

Accept the EULA and Edit server.properties

Run the jar once so it creates the config files, then it stops by itself:

cd /opt/minecraft/server
sudo -u minecraft java -jar paper.jar nogui

The server stops and asks you to agree to the Minecraft EULA. Open eula.txt and change eula=false to eula=true:

sudo -u minecraft nano eula.txt

Then open server.properties and set the basics. Give the world a name with motd, set max-players=10 for a small group, and set difficulty=normal and view-distance=8. Keep online-mode=true so only players with a paid Minecraft account can join; turning it off lets anyone in with any name. Small config slips cause most first-time failures, so it pays to read our list of common VPS setup mistakes beginners make before you go further.

Start the Server and Run It as a systemd Service

Start the server by hand first to check for errors:

sudo -u minecraft java -Xms1G -Xmx2G -jar paper.jar nogui

If the log ends with “Done”, the server works. Type stop in the console to shut it down cleanly, then create a systemd service so the server starts on boot and restarts after a crash. A service file means the world comes back on its own after a reboot, which is the point of running the server on a VPS instead of your own PC:

sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Paper Server
After=network.target

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

[Install]
WantedBy=multi-user.target

Then load the new service and start it:

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

Check the status with sudo systemctl status minecraft and watch the live log with sudo journalctl -u minecraft -f. If the service fails, the log will show the error, and it is usually a wrong path in the service file or a Java version mismatch.

Open Port 25565 and Handle Minecraft Port Forwarding

Minecraft Java Edition listens on TCP port 25565 by default. Open it in the server firewall:

sudo ufw allow 25565/tcp
sudo ufw enable

On a VPS, minecraft port forwarding works a little differently than on a home network. There is no home router to configure, so you open the port in two places: the firewall on the server itself, and the security group or firewall panel in your VPS provider dashboard. If your provider blocks ports by default, add an inbound rule for TCP 25565 there too. Before you open anything else, run through the first 10 things to do after buying a VPS so the rest of the server stays locked down. Test the port from your own computer with an online port checker, or simply try to join the server from the Minecraft client.

Set RAM Flags and Keep Performance Steady

The two flags that matter most are -Xms and -Xmx. -Xms sets the RAM Java grabs at startup, and -Xmx sets the ceiling. Set both to the same value, and never set -Xmx higher than the RAM you can spare after the operating system takes its share. On a 4 GB VPS, -Xmx2G leaves room for the system; on an 8 GB VPS you can try -Xmx4G or -Xmx6G. On a VPS, the simplest performance win is a lower view-distance in server.properties: 8 or even 6 chunks is fine for a small group and takes real load off the CPU. Watch usage with htop and Glances to monitor disk, RAM, and CPU usage on your VPS while a few friends play. If the server struggles, remove heavy plugins first and pre-generate the area inside the world border before blaming the VPS.

Back Up Your World and Invite Your Friends

Backups are the one step people skip until they lose a world. Stop the server, archive the world folders, and start it again:

sudo systemctl stop minecraft
sudo tar -czf /opt/minecraft/backup-$(date +%F).tar.gz -C /opt/minecraft/server world world_nether world_the_end
sudo systemctl start minecraft

Put the same commands in a small script and run it from cron once a day, and copy the archives off the server now and then. Turn on the whitelist with whitelist on in the server console and add each friend with whitelist add PlayerName, then give yourself operator rights with op YourName. Share your VPS IP address with your friends, and they can join from the Minecraft client by adding a server with that address and port 25565. Your own world, on your own server, online whenever your friends want to play.

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.