← Back to Blog

How to Host a Minecraft Server on a VPS (Ubuntu 24.04)

Published May 2, 2026  ·  10 min read  ·  Dakota Hopson, Galaxy Cloud Solutions

Running game servers is actually how I got into Linux in the first place. Before starting Galaxy Cloud Solutions, I was running a FiveM RP server — and keeping that running 24/7 with players online taught me more about Linux server management than any tutorial ever did. Minecraft is a lot simpler than FiveM, so if I can keep a GTA V multiplayer server alive, you can definitely keep a Minecraft server running.

This guide covers setting up a vanilla Minecraft Java Edition server on Ubuntu 24.04. The whole process takes about 15 minutes. We actually have a one-click Minecraft installer built into our customer portal, but this guide walks you through doing it manually so you understand what's happening.

⚡ Need a VPS? Start from $5/mo — Use code LAUNCH2026 for 50% off

What Plan Do You Need?

Minecraft's RAM requirements depend on how many players you're expecting:

Step 1 — Update and Install Java

Minecraft Java Edition requires Java. Modern versions need Java 21:

apt update && apt upgrade -y
apt install openjdk-21-jre-headless screen -y

The screen package lets you keep the server running after you disconnect from SSH — you'll need it.

Verify Java installed correctly:

java -version

Step 2 — Create a Minecraft User

Running the server as root is a bad idea. Create a dedicated user:

useradd -m -r -s /bin/bash minecraft
mkdir /opt/minecraft
chown minecraft:minecraft /opt/minecraft

Step 3 — Download the Minecraft Server

su - minecraft
cd /opt/minecraft
wget https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar -O server.jar
Note: The download URL changes with each Minecraft version. Check minecraft.net/download/server for the latest link.

Step 4 — Accept the EULA

Run the server once to generate the eula.txt file:

java -Xmx1024M -Xms512M -jar server.jar nogui

It'll stop and tell you to accept the EULA. Do that:

echo "eula=true" > eula.txt

Step 5 — Configure the Server

Edit server.properties to your liking. The important ones:

nano server.properties

Key settings to change:

Step 6 — Create a Startup Script

Create a script that allocates the right amount of RAM. Adjust the Xmx value based on your plan — give Minecraft about 70% of your total RAM:

cat > /opt/minecraft/start.sh << 'EOF'
#!/bin/bash
cd /opt/minecraft
java -Xmx896M -Xms512M -jar server.jar nogui
EOF
chmod +x /opt/minecraft/start.sh

Step 7 — Open the Firewall Port

Exit back to root and open Minecraft's default port:

exit
ufw allow 25565/tcp
ufw reload

Step 8 — Start the Server with Screen

su - minecraft
screen -S minecraft /opt/minecraft/start.sh

The server will start up. Once you see "Done!" it's ready. Detach from screen with Ctrl+A then D — the server keeps running after you disconnect.

To get back to the server console later:

screen -r minecraft

Step 9 — Make It Start on Boot

Create a systemd service so the server restarts automatically if the VPS reboots:

exit
cat > /etc/systemd/system/minecraft.service << 'EOF'
[Unit]
Description=Minecraft Server
After=network.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/opt/minecraft/start.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable minecraft
systemctl start minecraft

Connect to Your Server

Open Minecraft, go to Multiplayer, and add your server using your VPS IP address. That's it.

Pro tip: If you want a proper domain name instead of an IP address, you can point an SRV record at your server. Reply to this post or open a support ticket and I can walk you through it.

Host your Minecraft server from $10/mo

The Nebula 2 plan (2GB RAM, $10/mo) is the sweet spot for a small Minecraft server with friends. Full root access, Ubuntu 24.04, instant deployment. We also have a one-click Minecraft installer in the customer portal if you prefer. Use code LAUNCH2026 for 50% off your first month.

Get Started