Run game servers with Docker on a VPS

Docker runs each game server in an isolated container. One VPS can host a Minecraft server, a Palworld server and a Discord bot without them interfering with each other. Each container has its own files, ports and resource limits.

Why Docker for game servers

  • Isolation: a crash in one container does not affect others.
  • Easy setup: pre-built images for most games. A Minecraft server is one command.
  • Reproducible: delete the container, re-create it, and you are back to a clean state. Your data persists in volumes.
  • Resource limits: set CPU and memory limits per container so one server cannot starve the others.

Installing Docker

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER

Log out and back in for the group change to take effect.

Minecraft with Docker

The itzg/minecraft-server image is the gold standard:

docker run -d --name mc \
  -p 25565:25565 \
  -e EULA=TRUE \
  -e TYPE=PAPER \
  -e MEMORY=4G \
  -e VERSION=LATEST \
  -v mc-data:/data \
  --restart unless-stopped \
  itzg/minecraft-server

This starts a Paper server with 4 GB RAM, port 25565, and persistent data in the mc-data volume. Add plugins by placing them in the volume's plugins/ folder.

Docker Compose for multiple servers

Use docker-compose.yml to manage multiple servers:

services:
  minecraft:
    image: itzg/minecraft-server
    ports:
      - "25565:25565"
    environment:
      EULA: "TRUE"
      TYPE: PAPER
      MEMORY: "4G"
    volumes:
      - mc-data:/data
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 5G

  palworld:
    image: thijsvanloef/palworld-server-docker
    ports:
      - "8211:8211/udp"
    volumes:
      - pw-data:/palworld
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 16G

volumes:
  mc-data:
  pw-data:

Start both with docker compose up -d.

Useful commands

  • docker logs mc --tail 100: last 100 lines of the Minecraft server log.
  • docker exec -i mc rcon-cli: access the server console.
  • docker stop mc && docker start mc: restart a container.
  • docker stats: live resource usage of all containers.

Is Docker slower than running directly?

No. Docker uses the host kernel; there is no virtualization overhead. Performance is identical to a direct install.

How do I update the game server?

Pull the latest image: docker pull itzg/minecraft-server. Then recreate the container: docker compose up -d. Your data in the volume is preserved.

Can I use the Pterodactyl panel with Docker?

Yes. Pterodactyl (and its successor Pelican) use Docker containers internally. The panel manages containers through a web interface instead of the command line.

Run Docker on a KVM VPS at HostValues. All plans include full root access.


Still stuck? Open a support ticket and our team will help you out.

Back to the blog