Skip to main content
Logo
Overview

Run a Minecraft Bedrock Server in Docker (5-Minute Setup)

April 30, 2025
3 min read
Run a Minecraft Bedrock Server in Docker (5-Minute Setup)

If you’ve ever tried hosting a Minecraft server, you know the pain: Java versions, port forwarding, manual updates, and that sinking feeling when the server crashes and you don’t know why. Docker fixes almost all of that.

The Problem

Traditional Minecraft server hosting is tedious:

  • Install Java (which version? who knows)
  • Download server JAR, accept EULA, configure properties
  • Open firewall ports manually
  • SSH in to restart when it crashes
  • Manually download updates and pray nothing breaks

And if you want to run multiple servers? Multiply that pain by however many worlds you want to host.

Why Docker + Portainer?

Docker = Your server runs in a container that has everything it needs. One command to start, stop, or update.

Portainer = Web UI for managing containers. No more SSH terminal commands at 2am when your friends want the server back online.

Benefits:

  • 5-minute setup with automated script
  • Auto-updates on container restart
  • Easy backups (whole server is in one folder)
  • Resource limits (no more server eating all your RAM)
  • Multiple servers without port conflicts (with a small DNS trick)

Prerequisites

You’ll need:

  • Host: Windows 10/11 with WSL2, or any Linux server
  • RAM: 2GB minimum, 4GB comfortable for 5-10 players
  • Network: Router access to forward UDP port 19132
  • Tools: Git installed
  • Time: 10 minutes including Docker installation

The Solution: Automated Setup

I built a bootstrap script that handles Docker, Portainer, and the Minecraft container in one shot.

Step 1: Run the Bootstrap Script

Terminal window
wget -O bootstrap.sh https://github.com/Tillman32/minecraft-bedrock-server/raw/refs/heads/main/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh

This script:

  1. Installs Docker (if not present)
  2. Sets up Portainer for container management
  3. Pulls the itzg/minecraft-bedrock-server image
  4. Creates server directory at /opt/minecraft-server
  5. Starts the container with auto-restart enabled

Wait about 60 seconds for the first-time container setup to complete.

Step 2: Configure Portainer

Navigate to https://<your-server-ip>:9443 in your browser.

  • Create an admin account on first login
  • Go to Containers to see your Minecraft server running
  • Click the server name to view logs, restart, or adjust settings

Step 3: Connect from Minecraft

  1. Open Minecraft Bedrock Edition (not Java Edition)
  2. Go to Play → Servers → Add Server
  3. Enter:
    • Server Name: Whatever you want
    • Server Address: Your server’s IP
    • Port: 19132 (default)

Hit Save and join. That’s it.

What I Learned / Gotchas

Bedrock vs. Java Edition: This setup is for Bedrock Edition (Windows 10, Xbox, Mobile, PlayStation). Java Edition requires a different container. Don’t mix them up—they’re not cross-compatible.

Firewall rules matter. If you’re on Linux, open UDP 19132:

Terminal window
sudo ufw allow 19132/udp

On Windows with WSL2, you may need to forward the port from Windows to WSL. Use netsh or Portainer’s built-in port mapping.

Server properties: After first run, edit /opt/minecraft-server/server.properties to change:

  • server-name (what shows up in the server list)
  • gamemode (survival, creative, adventure)
  • difficulty
  • max-players

Restart the container in Portainer for changes to apply.

Add-ons and mods: Drop behavior/resource packs into /opt/minecraft-server/worlds/<world-name>/ directories. The itzg image documentation has details on this.

Backups: Your entire server lives in /opt/minecraft-server. Use a cronjob to rsync or tar that folder to backup storage:

Terminal window
tar -czf minecraft-backup-$(date +%F).tar.gz /opt/minecraft-server

Going Further

Running Multiple Servers

Want separate servers for survival, creative, and modded? Run additional containers on different ports (19133, 19134, etc.) and use Minecraft SRV records to assign subdomains. I wrote about this in Hosting Multiple Minecraft Servers with SRV Records.

Monitoring and Logs

Portainer shows live logs, but for long-term monitoring, consider setting up Grafana + Prometheus to track player count, memory usage, and uptime.

Docker Compose Version

If you prefer infrastructure-as-code, here’s the Docker Compose equivalent:

version: '3'
services:
minecraft:
image: itzg/minecraft-bedrock-server
environment:
EULA: "TRUE"
SERVER_NAME: "Brandon's Server"
ports:
- "19132:19132/udp"
volumes:
- /opt/minecraft-server:/data
restart: unless-stopped

Run with docker-compose up -d.

Resources

Questions? I’m @brandontillman everywhere.