How to host a
Minecraft server on a VPS with
Docker
Run PaperMC with Docker, size RAM, open port 25565, configure whitelist, and back up worlds
The XVer team 2 min read 20 min to do Beginner
Also in ภาษาไทย
On this page
Launch a Minecraft Java server on a VPS in 20 minutes using the itzg/minecraft-server Docker image and TCP port 25565. A group of 5 to 10 friends runs smoothly on 4 GB RAM, while modpacks should start at 8 GB.
Need a low-latency server in Thailand? See Game VPS plans.
Choose your server specs#
Minecraft runs most world ticks on a single thread, so single-core speed matters more than core count. Use this table as a starting point.
| Concurrent players | Setup | VPS RAM | JVM memory |
|---|---|---|---|
| 2-5 | Paper | 4 GB | 2 GB |
| 5-15 | Paper + plugins | 8 GB | 5 GB |
| 5-10 | Modpacks | 8-16 GB | 6-10 GB |
Install with
Docker Compose#
Start with Docker installed on Ubuntu (or launch Docker 1-click from XVer Marketplace), then create a working directory.
mkdir -p ~/minecraft/data && cd ~/minecraftservices:
mc:
image: itzg/minecraft-server
restart: unless-stopped
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: PAPER
MEMORY: 2G
TZ: Asia/Bangkok
MOTD: My Minecraft Server
MAX_PLAYERS: "10"
ENABLE_WHITELIST: "true"
ENFORCE_WHITELIST: "true"
volumes:
- ./data:/dataSetting EULA: "TRUE" confirms you accept the Minecraft EULA (opens in a new tab).
docker compose up -d
docker compose logs -fWait until you see Done, then press Ctrl + C to detach from logs while the server keeps running.
Open port 25565#
In the XVer Console, open your server's Firewall tab, add an Inbound TCP rule for port 25565 set to Allow, and share the server IP with your friends.
Add players and operators#
docker compose exec mc rcon-cli whitelist add PLAYER_NAME
docker compose exec mc rcon-cli op PLAYER_NAMEKeep online-mode enabled so nobody can impersonate an operator account.
Back up your world#
cd ~/minecraft
docker compose exec mc rcon-cli save-off
docker compose exec mc rcon-cli save-all flush
tar czf world-$(date +%F).tar.gz data/world*
docker compose exec mc rcon-cli save-onTroubleshooting common issues#
| Symptom | Fix |
|---|---|
| Connection timed out | Open TCP port 25565 in the server Firewall |
| You are not white-listed | Add the player with whitelist add |
| Outdated client | Set VERSION in compose.yaml to match your client |
| Server exits unexpectedly | Out of memory: lower MEMORY or resize the VPS |
| Lag when exploring new chunks | Lower VIEW_DISTANCE and SIMULATION_DISTANCE |
Frequently asked questions#
Can mobile or console (Bedrock) friends join?
Java Edition servers accept Java clients by default. To let Bedrock players join, add the Geyser plugin and open UDP port 19132.
Can I set MEMORY equal to the server's total RAM?
No. Java overhead and the OS also need memory, so always leave at least 1.5 to 2 GB unallocated.
Does powering off the server stop billing?
No. A powered-off Cloud Server still reserves resources and continues billing. Back up your world and delete the server when you want billing to stop.