Back to all guides
Game Servers

How to Set Up a Minecraft Server on Linux

5 read2026-04-10

Running your own Minecraft server gives you full control over plugins, performance, and who can join. This guide walks you through setting up a high-performance Paper server on Ubuntu.

Recommendation: For a lag-free Minecraft server with mods, plugins, and multiple players, we recommend a Prepaid Gaming KVM Server with AMD Ryzen 9 9950X. With up to 5.7 GHz single-core boost, DDR5 ECC memory, and full root access, even heavy chunk-loading runs smoothly.

1. Install Java

Minecraft requires Java 21 or newer. We recommend following our dedicated guide for this step: How to Install Java 21 on Linux.

Once Java is installed, you can verify it by running:

bash
java -version

2. Create a Dedicated User

Never run game servers as root. Create a dedicated system user:

bash
sudo useradd -r -m -d /opt/minecraft -s /bin/bash minecraft

3. Download PaperMC

Paper is a high-performance fork of Spigot that dramatically improves server TPS (ticks per second).

bash
sudo su - minecraft
mkdir server && cd server
curl -o paper.jar https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/411/downloads/paper-1.21.4-411.jar

Note: Check papermc.io for the latest build number.

4. First Run and EULA

Start the server once to generate configuration files:

bash
java -Xms2G -Xmx4G -jar paper.jar --nogui

The server will stop and ask you to accept the EULA. Open the file and change false to true:

bash
nano eula.txt
# Change eula=false to eula=true

5. Optimize server.properties

Open server.properties and configure the basics:

ini
server-port=25565
max-players=20
view-distance=8
simulation-distance=6
motd=\u00A7bMy Ryze Server \u00A77- Welcome!

Lowering view-distance and simulation-distance massively improves performance on smaller VPS instances.

6. Run with PM2 (Keep Alive)

Exit back to root (exit) and use PM2 to keep the server running permanently:

bash
sudo npm install pm2 -g
sudo -u minecraft pm2 start "java -Xms2G -Xmx4G -jar paper.jar --nogui" --name minecraft --cwd /opt/minecraft/server
sudo -u minecraft pm2 save
sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u minecraft --hp /opt/minecraft

7. Firewall

bash
sudo ufw allow 25565/tcp

Your friends can now connect using your server's IP address!

KVM Game VPS

Ready for your own game server?

Launch your own gaming project on our high-performance KVM VPS with maximum AMD Ryzen single-core power, ultra-fast NVMe storage, and real Layer 3/4/7 DDoS protection (PletX & SmartNet). 100% prepaid with no contract lock-in.

AMD Single-Core Power
Datacenter NVMe SSD
4+ Tbps DDoS Protection
100% Prepaid (No Contract)