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
wget -O bootstrap.sh https://github.com/Tillman32/minecraft-bedrock-server/raw/refs/heads/main/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.shThis script:
- Installs Docker (if not present)
- Sets up Portainer for container management
- Pulls the
itzg/minecraft-bedrock-serverimage - Creates server directory at
/opt/minecraft-server - 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
- Open Minecraft Bedrock Edition (not Java Edition)
- Go to Play → Servers → Add Server
- 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:
sudo ufw allow 19132/udpOn 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)difficultymax-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:
tar -czf minecraft-backup-$(date +%F).tar.gz /opt/minecraft-serverGoing 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-stoppedRun with docker-compose up -d.
Resources
- Full bootstrap script on GitHub
- itzg/minecraft-bedrock-server Docker Hub page
- Portainer documentation
Questions? I’m @brandontillman everywhere.