Minecraft · Guide

How to Host a Minecraft Server on a VPS

Updated October 2, 2026 8 min read

On this page
  1. The short version
  2. VPS or a managed Minecraft plan? The honest comparison
  3. Choosing the VPS, the operating system and the Java version
  4. Installing the server, step by step
  5. Firewall, auto-start and restarts
  6. Backups and updates
  7. FAQ

A VPS gives you a whole Linux server of your own: root access, a public IP, and nothing running on it that you did not put there. For a Minecraft server that means complete control — any version, any software, any number of worlds, and room for a proxy, a Discord bot or a website next to it.

The same steps — the right runtime, a firewall rule, a systemd service and backups — apply to almost any game server you run on a Linux VPS; only the program and the port change.

It also means you are the administrator. This guide covers the full setup on Ubuntu 24.04 — every command in it was run on a clean server before being written down — and starts with an honest comparison, because for a single Minecraft server a VPS is not always the better deal.

The short version

  1. Get a VPS with at least 4 GB of RAM running Ubuntu 24.04. Ubuntu's own repositories carry every Java version Minecraft needs.
  2. Install the Java your Minecraft version requires — Java 25 for the current 26.x releases, Java 21 for 1.20.5 to 1.21.x.
  3. Run the server as its own user from its own folder, never as root.
  4. Open TCP port 25565 in the firewall — after allowing SSH, not before.
  5. Make it a systemd service so it starts on boot and restarts after a crash, and set up backups before you need them.

That is about half an hour of work. The sections below give the exact commands, and the first one helps you decide whether a VPS is the right tool at all.

Full root, NVMe and DDoS protection: a HytHost VPS with 4 GB of RAM starts at €7.00/mo.

See VPS plans

VPS or a managed Minecraft plan? The honest comparison

Both run the same Java server on similar hardware. The difference is who does the work and what else the machine can do.

Linux VPSManaged Minecraft plan
Around 8-9 GB of RAMVPS 3, 8 GB — €15.00/moMC Diamond, 9 GB — €11.65/mo
Memory available to MinecraftWhat is left after the operating systemThe whole plan
Installing versions and modpacksBy handVersion changer and one-click modpack installer
Security updates, firewall, backupsYoursHandled
Other software on the same machineAnythingMinecraft only
Several servers, a proxy, a databaseYes, all on one boxOne server per plan

For one Minecraft server, the managed plan is the better deal: more memory for less money, and no administration. A VPS earns its place when you want more than one server — a Velocity proxy in front of a lobby and a survival world, say — or other things running beside Minecraft: a Discord bot, a website, a database, your own tools. It is also the right choice if running the server is the point and you want to learn Linux along the way.

If that describes you, carry on. If you just want a server for your friends, Minecraft hosting gets you there faster.

Choosing the VPS, the operating system and the Java version

How much VPS

Leave the operating system about 1.5-2 GB, and give Minecraft the rest.

HytHost VPSSpecsGood for
VPS 2 — €7.00/mo4 vCPU, 4 GB RAM, 30 GB NVMeA Paper server for a group of friends
VPS 3 — €15.00/mo4 vCPU, 8 GB RAM, 50 GB NVMeA busier Paper server, or a light modpack
VPS 4 — €27.00/mo6 vCPU, 16 GB RAM, 100 GB NVMeModpacks, or a proxy with several servers behind it

The smallest plans, with 2 GB, are fine for a bot or a test world but too tight for a real Minecraft server once the operating system has taken its share. For how memory relates to players and mods, see how much RAM a Minecraft server needs.

Which operating system

Pick Ubuntu 24.04. Its standard repositories carry OpenJDK 17, 21 and 25, which covers every Minecraft version you are likely to run. Debian 12 is a fine system too, but its repositories only offer Java 17 — too old for any Minecraft release since 1.20.5 — so you would have to add a third-party Java repository first.

Which Java version

Minecraft versionJava it requires
26.1 and newerJava 25
1.20.5 to 1.21.xJava 21
1.18 to 1.20.4Java 17

These come straight from the version data Mojang publishes for each release. Most modpacks still target 1.21.1, so check your pack's version before installing Java.

Installing the server, step by step

Log in over SSH as a user with sudo. The commands below install Java 25 for the current release; swap in openjdk-21-jre-headless for 1.20.5-1.21.x.

  1. Update the system and install Java:
    sudo apt update && sudo apt upgrade -y
    sudo apt install -y openjdk-25-jre-headless
    java -version
  2. Create a user that owns the server and nothing else:
    sudo useradd -r -m -d /opt/minecraft -s /usr/sbin/nologin minecraft
    Running the server as its own user means a compromised plugin can damage the server, not the whole machine.
  3. Download the server jar. Copy the download link for the vanilla server from minecraft.net, or for Paper from papermc.io, and fetch it into the server folder:
    cd /opt/minecraft
    sudo -u minecraft curl -o server.jar "PASTE_THE_DOWNLOAD_LINK_HERE"
  4. Accept the EULA and start it once:
    echo "eula=true" | sudo -u minecraft tee /opt/minecraft/eula.txt
    sudo -u minecraft java -Xms2G -Xmx6G -jar server.jar nogui
    Wait for Done, type stop, and the world and server.properties are now in place. Set -Xmx to your VPS memory minus about 2 GB — -Xmx6G on an 8 GB VPS.

Firewall, auto-start and restarts

Open the port, without locking yourself out

sudo ufw allow 22/tcp
sudo ufw allow 25565/tcp
sudo ufw enable
Allow SSH before you enable the firewall. Turning on ufw without the first line cuts your own SSH session, and the only way back in is the provider's console.

Run it as a service

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

[Unit]
Description=Minecraft server
After=network-online.target
Wants=network-online.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/usr/bin/java -Xms2G -Xmx6G -jar server.jar nogui
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Then load and start it:

sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
journalctl -u minecraft -f

The server now starts when the VPS boots and comes back on its own if it crashes. journalctl shows its console output; sudo systemctl stop minecraft shuts it down cleanly.

Players connect to the VPS's IP address. If they cannot, check in this order: the service is running, sudo ufw status lists 25565, and server-port in server.properties is still 25565.

Backups and updates

On a VPS nobody backs up your world unless you do. Two layers work well together:

  • A snapshot of the whole VPS. HytHost VPS plans offer a snapshot backup option, which captures the machine as it is — the right thing to restore after a broken system update.
  • A copy of the world off the server. A snapshot lives with the VPS; a copy somewhere else survives anything that happens to it. Archive the server folder while the server is stopped, and move the archive off the machine on a schedule with cron.

Updating Minecraft is then routine: take a backup, check the Java table above for the new version, replace server.jar, start it and read the log. If a plugin or mod is not ready for the new version yet, the backup is your way back.

Keep security updates on. sudo apt update && sudo apt upgrade once a week, or unattended upgrades, costs nothing and closes most of the doors that matter on an internet-facing server.
FAQ

Frequently asked questions

Yes, if you want full control or more than one thing on the machine: several servers behind a proxy, a Discord bot, a website or a database. For a single Minecraft server, a managed Minecraft plan usually gives more memory for less money and needs no administration.

At least 4 GB for a small Paper server, 8 GB for a busier server or a light modpack, and 16 GB for heavier modpacks or several servers. The operating system needs about 1.5-2 GB of that, so set -Xmx to the VPS memory minus roughly 2 GB.

According to the version data Mojang publishes, Minecraft 26.1 and newer need Java 25, versions 1.20.5 to 1.21.x need Java 21, and 1.18 to 1.20.4 need Java 17. Most modpacks currently target 1.21.1, which means Java 21.

Ubuntu 24.04 is the simplest choice, because its standard repositories include OpenJDK 17, 21 and 25. Debian 12 only offers Java 17 in its repositories, which is too old for Minecraft 1.20.5 and newer unless a third-party Java repository is added.

Check three things in order: the server is running (systemctl status minecraft), the firewall allows TCP 25565 (ufw status), and server.properties still uses port 25565. Players should connect to the VPS's public IP; a hostname only works once a DNS record points to it.

For a single Minecraft server, usually not. On HytHost, a 9 GB managed Minecraft plan costs €11.65/mo while an 8 GB VPS costs €15.00/mo, and on the VPS part of the memory goes to the operating system. A VPS becomes the better value when it runs several servers or other software.

Yes, that is one of the main reasons to choose a VPS. A proxy such as Velocity with several servers behind it, a Discord bot, a website or a database can share the machine, as long as the RAM and CPU are sized for all of them together.

Your own Linux server, ready in minutes

HytHost KVM VPS with dedicated vCPU cores, NVMe storage, full root access and DDoS protection — 4 GB from €7.00/mo.

Live chat 8 AM – 11 PM (Chișinău time) · tickets answered during business hours

Was this guide helpful?