---
title: "Minecraft server on a VPS: Java 21, Paper and autostart"
description: "How to run a Minecraft Java server on a VPS: how much RAM it needs, Java 21, the Paper server, eula.txt, -Xms/-Xmx flags, a systemd service, port 25565 and backups."
url: https://tihost.io/en/blog/minecraft-server-vps
language: en
section: "Guides"
published: 2026-10-05
updated: 2026-10-05
publisher: Tihost (https://tihost.io)
---

# Minecraft server on a VPS: Java 21, Paper and autostart

> **In short:** A Minecraft Java server running Paper needs about 2 GB of RAM for a few friends and 4-8 GB for a small community or mods. Versions 1.20.5 and newer require Java 21; run the server as a systemd service under its own user and open port 25565/tcp.

**Key takeaways:**

- A Minecraft Java server running Paper needs roughly 2 GB of RAM for a few friends and 4-8 GB for a small community or a modpack; render distance, plugins and players online decide the exact figure.
- Minecraft Java 1.20.5 and newer requires Java 21: on Ubuntu 24.04 that is the `openjdk-21-jre-headless` package, while Debian 12's standard repository does not have it, so Debian 12 needs Eclipse Temurin 21 from Adoptium.
- The Minecraft server's main loop (20 ticks per second, 50 ms per tick) runs on a single thread, so per-core CPU clock matters more for it than the number of vCPUs.
- A Minecraft server listens on port 25565/tcp: open it with `sudo ufw allow 25565/tcp` and run the server as a systemd service under a dedicated non-root user.
- A Tihost VPS on AMD Ryzen 9 with NVMe and DDoS protection suits Minecraft: a 2 GB RAM configuration starts at $4.00 a month.

> This guide is written for Ubuntu 24.04 and Debian 12 on a KVM VPS with full root access. Do the [first server setup](https://tihost.io/en/blog/vps-first-setup) before you start: a sudo user, key-based login and UFW enabled.

## How much RAM does a Minecraft server need?

A small Minecraft server on Paper for a few friends is fine on a VPS with 2 GB of RAM; a small community or a modpack needs 4-8 GB. Java does not get all of the server's memory: leave about 1 GB to the operating system and give the rest to the server with the `-Xmx` flag. Render distance (`view-distance`), players spread across the map and heavy mods consume the most memory. General memory guidance is in [How much RAM a VPS needs](https://tihost.io/en/blog/how-much-ram-vps).

| VPS RAM | -Xmx flag | Who it is for |
| --- | --- | --- |
| 2 GB | -Xmx1G | A few friends, Paper without heavy plugins |
| 4 GB | -Xmx3G | A group of friends with plugins, a small community |
| 8 GB | -Xmx6G | A small community or a light modpack |
| 12-16 GB | -Xmx11G or -Xmx15G | Large modpacks, many players at once |

*Cautious guidelines, not a guarantee: mods, farms and render distance change the load the most.*

## Why does CPU clock speed matter for Minecraft?

A Minecraft world is simulated on one main thread: 20 times a second the server updates mobs, redstone and blocks, and it has 50 ms for each tick. Paper moves chunk loading and networking to other threads, but the simulation itself stays single-threaded, so one fast core does more than many slow ones. When a tick overruns 50 ms, TPS drops and players see lag and mobs teleporting. How Tihost CPUs differ in single-core speed is covered in [AMD Ryzen 9 5950X vs 9950X](https://tihost.io/en/blog/amd-ryzen-9-5950x-vs-9950x).

## Step 1. Install Java 21

Minecraft Java 1.20.5 and newer, and current Paper builds with it, require Java 21. A server needs no graphics, so install the `headless` variant. On Ubuntu 24.04 it is in the standard repository:

```bash
sudo apt update
sudo apt install -y openjdk-21-jre-headless wget
java -version
```

Debian 12's standard repository has no `openjdk-21-jre-headless` package. Install Eclipse Temurin 21 - the OpenJDK build from the Adoptium project - following the Debian instructions on their website, then check `java -version`. On another Ubuntu release, check for the package first: if the command below shows no install candidate, install Temurin the same way as on Debian.

```bash
apt-cache policy openjdk-21-jre-headless
```

## Step 2. Create a dedicated user

Do not run a Minecraft server as root: a vulnerable plugin would then give access to the whole system. Create a system user `minecraft` with no password and no login shell, with `/opt/minecraft` as its home:

```bash
sudo useradd -r -m -d /opt/minecraft -s /usr/sbin/nologin minecraft
```

## Step 3. Download the Paper server

Paper is an optimized Minecraft Java server with Bukkit and Spigot plugin support; on the same machine it handles noticeably more players than the vanilla server. Open the downloads section at [papermc.io](https://papermc.io), pick the Minecraft version, copy the link to the latest build's jar file and download it as the `minecraft` user:

```bash
sudo -u minecraft wget -O /opt/minecraft/paper.jar "LINK_FROM_THE_PAPER_DOWNLOAD_PAGE"
```

## Step 4. First run and eula.txt

On the first run the server creates `eula.txt` and stops: it will not run until you accept the Minecraft End User License Agreement (EULA). Accept it, start the server again, wait for the world to generate, make yourself an operator with `op YourName` and stop the server with `stop`:

```bash
# the first run creates eula.txt and stops
sudo -u minecraft sh -c 'cd /opt/minecraft && java -Xms1G -Xmx1G -jar paper.jar --nogui'
# accept the Minecraft licence (EULA)
sudo -u minecraft sed -i 's/eula=false/eula=true/' /opt/minecraft/eula.txt
# the second run generates the world; in the console type: op YourName, then stop
sudo -u minecraft sh -c 'cd /opt/minecraft && java -Xms1G -Xmx1G -jar paper.jar --nogui'
```

Server settings live in `/opt/minecraft/server.properties`: `max-players` is the player limit, `view-distance` and `simulation-distance` set render and simulation distance in chunks. Lowering those two values is the simplest way to cut CPU and memory load.

## Step 5. Set memory with -Xms and -Xmx

- `-Xmx` is the maximum Java heap: how much memory the Minecraft server may take. Set it 1 GB below the VPS RAM, as in the table above.
- `-Xms` is the initial heap size. The Paper documentation recommends setting it equal to `-Xmx` so Java does not spend time growing the heap during play.
- Do not give Java all of the server's memory: the system needs memory too, and when it runs out the Linux kernel kills the whole Java process.

## Step 6. Autostart with systemd

A systemd service starts the Minecraft server when the VPS boots and restarts it after a crash. Create `/etc/systemd/system/minecraft.service` (the example is a 4 GB VPS with `-Xmx3G`):

`/etc/systemd/system/minecraft.service`:

```
[Unit]
Description=Minecraft server (Paper)
After=network-online.target
Wants=network-online.target

[Service]
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/usr/bin/java -Xms3G -Xmx3G -jar paper.jar --nogui
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
```

```bash
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
sudo systemctl status minecraft
sudo journalctl -u minecraft -f
```

`sudo systemctl stop minecraft` shuts the server down cleanly: it saves the world before exiting. To send console commands without stopping the service, enable RCON in `server.properties` (`enable-rcon=true` and a password in `rcon.password`) and keep the RCON port closed to the internet.

## Step 7. Open port 25565

A Minecraft Java server accepts players on port 25565/tcp. Open it in UFW - every other port stays closed:

```bash
sudo ufw allow 25565/tcp
sudo ufw status
```

Players now connect by the server's IP address: 25565 is the default port, so they can leave it out. To use an address like `mc.example.com` instead of the IP, [point a domain at the VPS](https://tihost.io/en/blog/domain-to-vps) with an A record.

## How do you back up a Minecraft world?

A Paper world is stored in three directories: `world`, `world_nether` and `world_the_end`. The safest way is to copy them with the server stopped, so the archive never catches the world mid-write:

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

An archive on the same server will not save you if the server itself is lost: keep copies on another machine and check that they extract. Scheduling and off-server storage are covered in [VPS backups](https://tihost.io/en/blog/vps-backup).

## Which Tihost VPS to pick for Minecraft?

A 2 GB configuration is enough for a few friends; a community or mods need 4-8 GB, and you can move to a larger configuration later. Every Tihost server runs on KVM with full root access, NVMe and network-level DDoS protection, and AMD Ryzen 9 CPUs give a high per-core clock. A server is deployed in about 2 minutes after payment.

| Line | Configuration | Germany | Finland | Poland |
| --- | --- | --- | --- | --- |
| Starter | 1 vCPU / 2 GB RAM / 40 GB NVMe | $4.00 | $4.00 | $5.00 |
| Starter | 2 vCPU / 4 GB RAM / 80 GB NVMe | $7.70 | $7.70 | $9.60 |
| Starter | 4 vCPU / 4 GB RAM / 140 GB NVMe | $12.30 | $12.30 | $15.40 |
| Advanced | 4 vCPU / 8 GB RAM / 180 GB NVMe | $15.40 | $15.40 | $19.30 |
| Advanced | 6 vCPU / 12 GB RAM / 240 GB NVMe | $24.00 | $24.00 | $30.00 |
| Advanced | 8 vCPU / 12 GB RAM / 260 GB NVMe | $28.00 | $28.00 | $35.00 |
| Power | 8 vCPU / 16 GB RAM / 300 GB NVMe | $32.00 | $32.00 | $40.00 |
| Power | 12 vCPU / 24 GB RAM / 350 GB NVMe | $49.00 | $49.00 | $61.00 |
| Power | 16 vCPU / 32 GB RAM / 450 GB NVMe | - | - | $77.50 |

*Price per 30 days, USD. A dash means the configuration is not sold in that location.*

**Launch a server in 2 minutes.** AMD Ryzen 9, NVMe and DDoS protection in Germany, Finland and Poland. Pay with crypto or card. [Order a Server](https://tihost.io/login)

## FAQ

### How much RAM does a Minecraft server need?

A Minecraft Java server on Paper for a few friends is fine on a VPS with 2 GB of RAM; a small community or a modpack needs 4-8 GB. Leave about 1 GB to the system and give the rest to Java with `-Xmx`.

### Which Java version does a Minecraft server need?

Minecraft Java 1.20.5 and newer requires Java 21. On Ubuntu 24.04 that is the `openjdk-21-jre-headless` package; on Debian 12 use Eclipse Temurin 21 from Adoptium, because Debian 12's standard repository has no Java 21.

### How is Paper different from the vanilla Minecraft server?

Paper is an optimized Minecraft Java server: it handles more players on the same hardware and supports Bukkit and Spigot plugins. Players need nothing extra and connect with the regular client.

### Can I install mods on a Paper server?

No, Paper runs plugins, not mods. Mods need a Fabric or NeoForge server matching the players' version, and usually more memory - 4-8 GB and up.

### Which port should I open for a Minecraft server?

A Minecraft Java server listens on port 25565/tcp by default. Open it in UFW with `sudo ufw allow 25565/tcp`; the RCON port should not be open to the internet.

### Is a Tihost VPS good for a Minecraft server?

Yes. Tihost VPSes run on KVM with root access, NVMe and DDoS protection, AMD Ryzen 9 CPUs give a high per-core clock, and a 2 GB RAM configuration starts at $4.00 a month.

---

Updated 2026-10-05 · https://tihost.io/en/blog/minecraft-server-vps
