Host a Minecraft Java Edition server on your VPS with full control over mods, plugins, and settings.

  1. Install Java (Minecraft 1.21+ requires Java 21):
    apt update && apt install openjdk-21-jre-headless
  2. Create a directory for the server:
    mkdir /opt/minecraft && cd /opt/minecraft
  3. Download the latest PaperMC jar (recommended over vanilla for performance and plugin support).
  4. Accept the Minecraft EULA:
    echo "eula=true" > eula.txt
  5. Start the server — adjust memory to suit your plan (example for 2 GB RAM):
    java -Xms1G -Xmx1500M -jar paper.jar nogui
  6. Edit server.properties to set your server name, game mode, max players, and other settings, then restart.
  7. Open port 25565 (TCP) in the portal upstream firewall and locally: ufw allow 25565/tcp
  8. Players connect using your VPS IP address and the default port 25565.

Keep it running: Create a systemd service for the server so it restarts automatically after a reboot. Set Restart=on-failure and use screen or tmux for an interactive console.

RAM guidance: Allow at least 1 GB for the JVM overhead on top of your server heap. A 2 GB KVM plan can comfortably run a small server (up to ~10 players).

Was this guide helpful?

Thanks for your feedback!