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
  1. Choose your server specs
  2. Install with Docker Compose
  3. Open port 25565
  4. Add players and operators
  5. Back up your world
  6. Troubleshooting common issues
  7. Frequently asked questions

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
PlanNVMe diskBandwidthPer hourPer month
4 vCPU · 4 GB60 GB8 TB฿0.87/hr฿519/mo
4 vCPU · 8 GB80 GB10 TB฿1.37/hr฿819/mo
8 vCPU · 8 GB80 GB10 TB฿1.63/hr฿979/mo
4 vCPU · 8 GB100 GB8 TB฿3.13/hr฿1,879/mo

Prices when this page was built

Install with Docker Compose#

Start with Docker installed on Ubuntu (or launch Docker 1-click from XVer Marketplace), then create a working directory.

Terminal
mkdir -p ~/minecraft/data && cd ~/minecraft
~/minecraft/compose.yaml
services:
  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:/data

Setting EULA: "TRUE" confirms you accept the Minecraft EULA (opens in a new tab).

Terminal
docker compose up -d
docker compose logs -f

Wait 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#

Terminal
docker compose exec mc rcon-cli whitelist add PLAYER_NAME
docker compose exec mc rcon-cli op PLAYER_NAME

Keep online-mode enabled so nobody can impersonate an operator account.

Back up your world#

Terminal
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-on

Troubleshooting 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.

Follow the guide on your own server

Create a Cloud Server with Ubuntu, Debian or Windows Server, billed by the hour in Thai baht. Support answers 24/7 in Thai and English.