Technology Encyclopedia Home >Run Your Own Minecraft Server on a VPS — Private, Always Online, Full Admin Control

Run Your Own Minecraft Server on a VPS — Private, Always Online, Full Admin Control

My friends and I have been playing Minecraft together on and off for years. At some point we decided we wanted our own dedicated server — one that stays online 24/7, gives us full admin access, and lets us run whatever mods we want.

We set it up on a cloud server. The whole process took about 45 minutes. We've been running it since last summer: 8 players regularly, a few mods installed, the world always accessible.

Here's the full setup, written so anyone can follow it.

We use Tencent Cloud Lighthouse — a VPS you pay for by the month, cancel anytime. No contracts, no setup fees. We picked the region closest to where most of our group is located.


Table of Contents

  1. Why Run Your Own Minecraft Server?
  2. How Much Server Do You Actually Need?
  3. What You'll Need
  4. Part 1 — Get the Server Running
  5. Part 2 — Install Java (Version Matters)
  6. Part 3 — Download and Set Up Minecraft
  7. Part 4 — Keep the Server Running 24/7 with systemd
  8. Part 5 — Configure Your Server Settings
  9. Part 6 — Open the Port So Friends Can Join
  10. Part 7 — Connect and Invite Your Friends
  11. Part 8 — Add Mods or Plugins
  12. Part 9 — Backups (World Files Are Precious)
  13. Squeeze More Performance Out of Your Server
  14. Common Problems and How We Fixed Them

Key Takeaways

  • 2 GB RAM handles 5–8 vanilla players; use 4 GB+ for mods or larger groups
  • Use screen or systemd to keep the server running after SSH disconnect
  • Set eula=true in eula.txt before first server start
  • Java Edition and Bedrock Edition require separate dedicated server software
  • Lighthouse snapshots protect world data before major version updates

Why Run Your Own Minecraft Server? {#why-own-server}

Self-hosting a Minecraft server on a VPS gives you a set of capabilities that are hard to get otherwise:

  • Always-on world — the server runs 24/7, even when you're not playing; friends can log in anytime
  • Full admin access — op players, install any mods or plugins, change any server setting
  • No player limits — limited only by your server's RAM
  • Complete world ownership — your world files, backed up on your schedule, stored where you choose
  • Custom region — pick a data center close to your players for low latency
  • Full mod freedom — install Fabric, Paper, or any mod loader without restrictions

For our group of 8, the cost works out to about $1 per person per month. The server hardware is more capable than shared game hosting options in the same price range, and we have root access to configure everything ourselves.


How Much Server Do You Actually Need? {#specs}

Minecraft Java Edition is RAM-hungry. This is the table I wish someone had shown me before I bought an undersized plan:

Players Recommended RAM Notes
1–5 4 GB Vanilla, small world. 2 GB works but is tight.
5–10 6–8 GB Vanilla or light mods, comfortable headroom
10–20 8–12 GB Heavier modpacks, lots of exploration
20+ 16 GB+ Large modpacks, plugins, busy worlds

CPU note: Minecraft is mostly single-threaded for world simulation. More cores don't help much. What matters is clock speed — but any modern cloud CPU handles vanilla Minecraft fine.

We run 8 players on a 4 GB instance with Paper server software (more efficient than vanilla) and it's smooth.


What You'll Need {#prerequisites}

What Notes
A Tencent Cloud Lighthouse account Sign up free
Minecraft: Java Edition Installed on your PC — you'll be the first to connect
A terminal macOS/Linux: already have it. Windows: use Windows Terminal
Port 25565 TCP Minecraft's default port — we'll open this in the firewall

Cost: The Basic plan (4 GB RAM) runs about $8–10/month depending on region. See current deals — new users often get a significant discount.


Part 1 — Get the Server Running {#part-1}

Create the Lighthouse instance

  1. Log in, go to LighthouseNew

  2. Image: Ubuntu 22.04 LTS (System Image)

  3. Plan: Pick based on your player count:

    Plan RAM For
    Basic 4 GB 1–8 players, vanilla
    Standard 8 GB 5–15 players, mods
    Pro 16 GB Modpacks, larger groups
  4. Region: Pick the location closest to most of your players. We're a US/EU split group so we went with US East — it's the middle ground.

  5. Note the public IP address from the dashboard. This is what you give friends to connect.


Part 2 — Install Java (Version Matters) {#part-2}

Minecraft Java Edition requires Java. The version depends on which Minecraft version you're running:

Minecraft Version Java Required
1.17 Java 16+
1.18–1.20 Java 17+
1.21+ Java 21+

SSH into your server (or use OrcaTerm in the Lighthouse console — the browser terminal):

ssh ubuntu@YOUR_SERVER_IP
sudo apt update && sudo apt upgrade -y

# Install Java 21 (works for 1.20 and newer)
sudo apt install -y openjdk-21-jre-headless

# Verify
java -version
# Should show: openjdk version "21.x.x"

Part 3 — Download and Set Up Minecraft {#part-3}

Create a dedicated server directory and user

Running the server as a separate user is a safety best practice:

sudo useradd -r -m -d /opt/minecraft minecraft
sudo mkdir -p /opt/minecraft/server
sudo chown -R minecraft:minecraft /opt/minecraft
sudo -u minecraft bash
cd /opt/minecraft/server

Download the server JAR

Go to minecraft.net/en-us/download/server, copy the download link for the latest version, then:

# Replace the URL with the current one from minecraft.net
wget "https://piston-data.mojang.com/v1/objects/HASH/server.jar" -O server.jar

Accept the EULA

Run the server once — it'll immediately stop but generate the config files:

java -Xmx1G -jar server.jar nogui

Then accept the EULA (you have to, it won't run otherwise):

sed -i 's/eula=false/eula=true/' eula.txt
cat eula.txt  # Verify: eula=true

Part 4 — Keep the Server Running 24/7 with systemd {#part-4}

The simplest method is screen (a terminal session that outlives your SSH connection). But for a permanent server, systemd is better — it starts on boot and restarts automatically if the server crashes.

Exit back to the ubuntu user (exit), then:

sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Server
After=network.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft/server

# Adjust -Xmx to 75% of your total RAM
# For 4 GB server: -Xmx3G
# For 8 GB server: -Xmx6G
ExecStart=/usr/bin/java -Xms1G -Xmx3G -jar server.jar nogui
ExecStop=/bin/kill -SIGINT $MAINPID
Restart=on-failure
RestartSec=20s

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable minecraft   # Start on boot
sudo systemctl start minecraft    # Start now

# Watch it come online (takes 30–60 seconds)
sudo journalctl -u minecraft -f

When you see Done (X.XXXs)! For help, type "help" in the logs, the server is ready.


Part 5 — Configure Your Server Settings {#part-5}

The server.properties file controls everything. Edit it:

sudo -u minecraft nano /opt/minecraft/server/server.properties

The settings I always change first:

# What players see in the server list
motd=Our Private Server

# How many players can join simultaneously
max-players=20

# Game difficulty
difficulty=normal

# Default gamemode for new players
gamemode=survival

# Whitelist = only players you invite can join (recommended)
white-list=true

# NEVER set this to false unless you want cracked clients
online-mode=true

# Lower this if you're getting lag — affects how far chunks load
view-distance=10
simulation-distance=10

After changes, restart:

sudo systemctl restart minecraft

Set up the whitelist

Connect to the server console via the journal, then use these commands:

# In a terminal watching logs, or in a separate session:
sudo -u minecraft bash -c "cd /opt/minecraft/server && java -jar server.jar --nogui"
# Better: use RCON, or just edit ops.json and whitelist.json directly

Or simply edit /opt/minecraft/server/whitelist.json and add your players:

[
  {"uuid": "player-uuid-here", "name": "FriendUsername"},
  {"uuid": "player-uuid-here", "name": "AnotherFriend"}
]

Part 6 — Open the Port So Friends Can Join {#part-6}

In the Tencent Cloud Lighthouse console:

  1. Click your instance → Firewall tab → Add Rule
Port Protocol What for
25565 TCP Minecraft Java Edition (required)
25565 UDP Some mods use this (optional)

Part 7 — Connect and Invite Your Friends {#part-7}

On your Minecraft client:

  1. MultiplayerAdd Server
  2. Server Name: anything (just a label for you)
  3. Server Address: YOUR_SERVER_IP
  4. Done → click the server → Join Server

Pro move: give it a domain name

Instead of sharing a raw IP, add a DNS A record:

play.yourdomain.com   →   YOUR_SERVER_IP

Then friends connect to play.yourdomain.com instead of a string of numbers. Much cleaner.


Part 8 — Add Mods or Plugins {#part-8}

Vanilla Minecraft is great, but the real magic happens with mods and plugins.

Paper (for plugins like EssentialsX, LuckPerms, etc.)

Paper is a drop-in replacement for the vanilla server — faster, more configurable, and compatible with thousands of Bukkit/Spigot plugins:

cd /opt/minecraft/server

# Download Paper (check papermc.io/downloads for latest)
wget "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/LATEST/downloads/paper-1.21.4-LATEST.jar" -O paper.jar

# Update the systemd service to use paper.jar instead of server.jar
sudo nano /etc/systemd/system/minecraft.service
# Change: -jar server.jar → -jar paper.jar

sudo systemctl daemon-reload && sudo systemctl restart minecraft

Put plugin .jar files in /opt/minecraft/server/plugins/ and restart.

Fabric (for content mods)

# Download Fabric installer
wget https://maven.fabricmc.net/net/fabricmc/fabric-installer/LATEST/fabric-installer-LATEST.jar -O fabric-installer.jar

# Install for your Minecraft version
java -jar fabric-installer.jar server -mcversion 1.21.4 -downloadMinecraft

Put mod .jar files in /opt/minecraft/server/mods/.


Part 9 — Backups (World Files Are Precious) {#part-9}

We lost a world once because of a disk issue on a cheap host. Never again.

Automated backup script

sudo nano /opt/minecraft/backup.sh
#!/bin/bash
SERVER_DIR="/opt/minecraft/server"
BACKUP_DIR="/opt/minecraft/backups"
DATE=$(date +%Y%m%d_%H%M%S)

mkdir -p $BACKUP_DIR

# Compress the world directories
tar -czf $BACKUP_DIR/world_$DATE.tar.gz \
  -C $SERVER_DIR world world_nether world_the_end

# Keep last 7 backups only
ls -t $BACKUP_DIR/world_*.tar.gz | tail -n +8 | xargs rm -f

echo "Backup done: world_$DATE.tar.gz"
sudo chmod +x /opt/minecraft/backup.sh
sudo chown minecraft:minecraft /opt/minecraft/backup.sh

# Schedule daily at 4 AM
sudo crontab -u minecraft -e
# Add: 0 4 * * * /opt/minecraft/backup.sh

Lighthouse snapshots

The Lighthouse console → Snapshots tab → Auto Snapshot. Set to daily with 7-day retention.

This creates a complete disk image. If the server ever goes sideways — corrupted world, bad mod, accidental deletion — you restore to yesterday's snapshot in about two minutes. We've used this exactly once and were very glad we had it.


Squeeze More Performance Out of Your Server {#performance}

Aikar's JVM flags (copy these exactly)

These optimize Java's garbage collector to reduce lag spikes. The difference is noticeable:

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 \
  -jar paper.jar nogui

Update your systemd service ExecStart line with these flags.

Reduce chunk render distance if you're hitting CPU limits

view-distance=8          # Default 10 — this is the first knob to turn
simulation-distance=6    # Default 10 — affects mob AI and entity processing

Common Problems and How We Fixed Them {#troubleshooting}

Problem What actually happened Fix
"Can't connect" from client Firewall port not open Check Lighthouse firewall rules — port 25565 TCP
Server lags with 6 players Not enough RAM allocated Increase -Xmx value; upgrade plan if needed
Server stops after SSH disconnect Not using systemd Set up the systemd service in Part 4
World not loading after update Chunk corruption Restore from backup snapshot
Players keep getting kicked RAM exhausted htop → check memory usage; upgrade plan
"Outdated server" error Client and server version mismatch Make sure server JAR version matches client

Troubleshooting {#troubleshooting}

Issue Likely Cause Fix
Connection refused Service not running or wrong port Check systemctl status SERVICE and verify firewall rules
Permission denied Wrong file ownership or permissions Check file ownership with ls -la and use chown/chmod to fix
502 Bad Gateway Backend service not running Restart the backend service; check logs with journalctl -u SERVICE
SSL certificate error Certificate expired or domain mismatch Run sudo certbot renew and verify domain DNS points to server IP
Service not starting Config error or missing dependency Check logs with journalctl -u SERVICE -n 50 for specific error
Out of disk space Logs or data accumulation Run df -h to identify usage; clean logs or attach CBS storage
High memory usage Too many processes or memory leak Check with htop; consider upgrading instance plan if consistently high
Firewall blocking traffic Port not open in UFW or Lighthouse console Open port in Lighthouse console firewall AND sudo ufw allow PORT

Frequently Asked Questions {#faq}

How many players can a 2 GB RAM server handle?
A vanilla Java server with 2 GB RAM handles 5–8 simultaneous players comfortably. For larger groups or mods, use 4 GB RAM.

Does the server run when no players are online?
Yes — a VPS runs 24/7. The world persists and is always accessible.

Can console players join a Java Edition server?
No — Java and Bedrock editions are incompatible. For cross-platform play including consoles, use a Minecraft Bedrock server.

How do I add mods?
Use a mod loader like Fabric or Forge instead of vanilla server software.

How do I update the server software?
Download the new server JAR, replace the old one, restart. Always back up world data first.


Ready to ditch the laggy free hosts?
👉 Tencent Cloud Lighthouse — Flexible VPS plans
👉 View new user discounts and promotions
👉 Explore all active deals and offers