How to make a Minecraft server on a Linux VPS

This guide sets up a Paper server, the most popular choice for servers with plugins, on a fresh Ubuntu 24.04 VPS. It covers Java, the server files, start flags, the firewall and keeping the server running. It takes about 20 minutes.

By the Nodewave team · Updated 8 November 2026

Before you start

1. Install Java

Current Minecraft versions, 26.1 and newer, need Java 25. Servers on 1.21 versions use Java 21 instead. On Ubuntu 24.04:

sudo apt update
sudo apt install -y openjdk-25-jre-headless tmux
java -version

The last command should report version 25.

2. Open the firewall

Java Edition uses TCP port 25565 by default. Allow SSH first, so you don't lock yourself out:

sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw enable

Nodewave VPS plans have no provider firewall in front of your ports, so ufw on the server is your firewall. If your host has its own firewall panel, open the port there too.

3. Download Paper

Create a user for the server, so it never runs as root, then download Paper into its own folder:

sudo adduser --disabled-password --gecos "" minecraft
sudo -iu minecraft
mkdir -p ~/server && cd ~/server
wget -O paper.jar "paste-the-download-link-here"

Get the link from the Paper downloads page: choose your Minecraft version, then copy the link of the latest stable build.

4. Accept the EULA

Start the server once. It stops straight away and creates eula.txt:

java -Xms2G -Xmx2G -jar paper.jar --nogui

Read Mojang's Minecraft EULA. If you agree to it, change eula=false to eula=true in eula.txt, for example with this command. The server won't start until you do.

sed -i 's/eula=false/eula=true/' eula.txt

5. Create a start script

Paper recommends a set of Java flags, often called Aikar's flags, that keep garbage collection pauses short. Create start.sh with nano start.sh, paste the lines below, save, then run chmod +x start.sh. Set -Xms and -Xmx to the same value: the VPS's memory minus 1 to 1.5 GB for the system.

#!/bin/sh
java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 \
  -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch \
  -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M \
  -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 \
  -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 \
  -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem \
  -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true \
  -jar paper.jar --nogui

6. Start it and keep it running

tmux new -s minecraft
./start.sh

When the console says “Done”, the server is ready. Detach from tmux with Ctrl+B, then D; the server keeps running after you log out. Reattach with tmux attach -t minecraft, and always stop the server with the stop command so it saves the world first.

Players join with your server's IP address. 25565 is the default port, so they don't need to type it.

7. Settings worth changing

Edit server.properties while the server is stopped:

8. Back up the world

Stop the server, then archive the whole folder. Keep several copies somewhere other than the server, and check now and then that one restores.

tar czf ~/minecraft-backup-$(date +%F).tar.gz -C ~ server

Next steps

If the server stops right after you start it, see how to fix a Minecraft server that won't start. To pick the right Java, see which Java version a Minecraft server needs.

Host your Minecraft server in Singapore

Low ping for players in India, Malaysia and Indonesia, on fast AMD EPYC cores with NVMe and DDoS protection.

Minecraft hosting in Singapore →