Deployment Options
Docker Compose
The most common and recommended way to deploy is using Docker Compose, which provides:- Easy configuration management
- Volume and network orchestration
- Service dependencies
- Restart policies
- Environment variable management
Simple Deployment
Basic single-server setup with persistent storage
Advanced Features
Multi-service deployments with RCON, proxies, and more
Kubernetes
For production environments requiring:- High availability
- Auto-scaling
- Resource management
- StatefulSets for persistent data
Docker Swarm
Swarm mode provides:- Native Docker clustering
- Service replication
- Load balancing
- Rolling updates
Simple Compose
The simplest deployment requires just a few lines:docker-compose.yml
The
stdin_open and tty options enable interactive console access via docker attach.Advanced Compose
A production-ready deployment with resource limits and named volumes:docker-compose.yml
Key Configuration Elements
Volume Mounts
Volume Mounts
Named volumes (recommended for production):Bind mounts (easier for development):Named volumes are managed by Docker and persist independently of the container lifecycle.
Port Mappings
Port Mappings
Standard Minecraft port:Custom external port:Multiple servers:
Resource Limits
Resource Limits
Control memory allocation:
Restart Policies
Restart Policies
Available restart policies:
no- Never restart automaticallyon-failure- Restart only on erroralways- Always restart regardless of stop reasonunless-stopped- Restart unless explicitly stopped (recommended)
Environment-Specific Configurations
Development
docker-compose.yml
Bind mounts allow you to edit files locally and see changes immediately.
Production
docker-compose.yml
Advanced Deployment Patterns
Auto-pause
Reduce resource usage when no players are online:docker-compose.yml
See the full autopause example for detailed configuration.
With Proxy
Route traffic through a proxy server:docker-compose.yml
Multiple Mounts
Mount specific directories for better organization:docker-compose.yml
Deployment Best Practices
Use Named Volumes
Named volumes are managed by Docker and persist across container recreations
Pin Versions
Specify exact versions in production to prevent breaking changes
Configure Backups
Implement regular backup strategies for world data
Monitor Resources
Track CPU, memory, and disk usage to prevent performance issues
Set Restart Policies
Use
unless-stopped for automatic recovery from failuresUse Health Checks
Implement health checks to detect server issues
Next Steps
Kubernetes Deployment
Deploy on Kubernetes with StatefulSets and Helm charts
Docker Swarm
Set up clustered deployments with Docker Swarm
More Examples
Explore additional deployment configurations and patterns