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.
Key Takeaways
- 2 GB RAM handles 5–8 vanilla players; use 4 GB+ for mods or larger groups
- Use
screenor systemd to keep the server running after SSH disconnect- Set
eula=trueineula.txtbefore first server start- Java Edition and Bedrock Edition require separate dedicated server software
- Lighthouse snapshots protect world data before major version updates
Self-hosting a Minecraft server on a VPS gives you a set of capabilities that are hard to get otherwise:
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.
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 | 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.
Log in, go to Lighthouse → New
Image: Ubuntu 22.04 LTS (System Image)
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 |
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.
Note the public IP address from the dashboard. This is what you give friends to connect.
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"
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
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
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
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.
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
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"}
]
In the Tencent Cloud Lighthouse console:
| Port | Protocol | What for |
|---|---|---|
| 25565 | TCP | Minecraft Java Edition (required) |
| 25565 | UDP | Some mods use this (optional) |
On your Minecraft client:
YOUR_SERVER_IPPro 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.
Vanilla Minecraft is great, but the real magic happens with mods and plugins.
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.
# 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/.
We lost a world once because of a disk issue on a cheap host. Never again.
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
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.
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.
view-distance=8 # Default 10 — this is the first knob to turn
simulation-distance=6 # Default 10 — affects mob AI and entity processing
| 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 |
| 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 |
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