How to Install a Minecraft Server (PaperMC) on Linux VPS (Ubuntu, AlmaLinux, Debian)

Premium services since 2010

Trusted by thousands of businesses worldwide • 99.9% Uptime Guarantee • Crypto Accepted

Table of Contents

How to install Paper Minecraft Server on Linux VPS Ubuntu AlmaLinux Debian

Hosting your own dedicated Minecraft server on a Linux VPS provides complete administrative freedom, zero player slot restrictions, full mod and plugin support, and low-latency multiplayer performance. While vanilla Minecraft server jars are resource-heavy, running high-performance forks like Paper (PaperMC) dramatically optimizes tick loop calculations, memory utilization, and chunk loading.

This comprehensive guide walks you through setting up a modern Minecraft server on Ubuntu 24.04/22.04 LTS, Debian 12, AlmaLinux 9, Rocky Linux, and CentOS using Java 21 (OpenJDK 21), automated systemd service management, and firewall port configuration.

  • Small Server (1–5 players, Vanilla/Paper): 2 vCPU cores, 2 GB – 4 GB RAM.
  • Medium Server (5–20 players with Plugins): 4 vCPU cores, 6 GB – 8 GB RAM.
  • Modded Server (Forge / Fabric / Large Modpacks): 4+ high-frequency vCPU cores, 12 GB – 16 GB RAM + NVMe SSD storage.

Step 1: Create a dedicated unprivileged user

For security best practices, never run game servers directly as the root user:

# Create dedicated minecraft system user and directory
sudo useradd -r -m -d /opt/minecraft -s /bin/bash minecraft
sudo su - minecraft

Step 2: Install Java 21 (OpenJDK 21)

Modern Minecraft versions (1.20.5+) require Java 21 (LTS). Switch back to your sudo account to install the runtime:

On Ubuntu and Debian:

sudo apt update && sudo apt install openjdk-21-jre-headless screen wget curl -y

On AlmaLinux, Rocky Linux, and CentOS:

sudo dnf install java-21-openjdk-headless screen wget curl -y

Step 3: Download PaperMC (High-Performance Server)

PaperMC delivers massive performance gains over the default vanilla software. Switch to the minecraft user and download the server build:

sudo su - minecraft
mkdir -p /opt/minecraft/server
cd /opt/minecraft/server

# Download the latest Paper 1.21 build
wget https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/119/downloads/paper-1.21.1-119.jar -O server.jar

Step 4: Accept the Minecraft EULA agreement

  1. Run the server once to generate initial configuration files:
    java -Xms1G -Xmx2G -jar server.jar --nogui
  2. The server will stop and create eula.txt. Open the file:
    nano eula.txt
  3. Change eula=false to eula=true. Save and exit (Ctrl + O, Enter, Ctrl + X).

Step 5: Configure systemd service for auto-restart (Recommended)

Running your server under systemd ensures it automatically starts on system boot and restarts if a crash occurs.

  1. Exit back to your sudo user (type exit).
  2. Create the service unit file:
    sudo nano /etc/systemd/system/minecraft.service
  3. Paste the following service configuration (adjust -Xmx4G according to your VPS RAM size):
    [Unit]
    Description=Minecraft Dedicated Server
    After=network.target
    
    [Service]
    WorkingDirectory=/opt/minecraft/server
    User=minecraft
    Group=minecraft
    Restart=always
    ExecStart=/usr/bin/java -Xms2G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -jar server.jar --nogui
    
    [Install]
    WantedBy=multi-user.target
  4. Enable and start the service:
    sudo systemctl daemon-reload
    sudo systemctl enable --now minecraft

Step 6: Open Minecraft Port 25565 in your firewall

Minecraft multiplayer uses TCP/UDP port 25565. Open this port to allow incoming player connections:

On Ubuntu / Debian (UFW):

sudo ufw allow 25565/tcp
sudo ufw reload

On AlmaLinux / Rocky / CentOS (FirewallD):

sudo firewall-cmd --permanent --add-port=25565/tcp
sudo firewall-cmd --reload

Step 7: Connect from your Minecraft game client

  1. Launch Minecraft on your PC.
  2. Click Multiplayer > Add Server.
  3. In the Server Address box, enter your VPS IP address (e.g. YOUR_SERVER_IP or YOUR_SERVER_IP:25565).
  4. Click Done and join your high-speed cloud Minecraft world!

For lag-free gaming with unmetered 1Gbps bandwidth, high clock-speed AMD/Intel NVMe processors, and dedicated DDoS protection, explore Aminserve Linux VPS Hosting and Dedicated Server Solutions with 24/7 dedicated support.

Never Miss an Update

Get expert tips, tutorials, and hosting insights delivered to your inbox weekly. Join 10,000+ subscribers!
🔒 We respect your privacy. Unsubscribe anytime.