Minecraft servers in Docker
- Prebuilt Docker images for multiple Minecraft versions
- Minimal Docker Compose setup
- Quick startup and ready-to-play
Tip
When creating your Docker Compose or starting the server, use a supported version as the image tag. Like myferr/mc-server:1.21.6, myferr/mc-server:1.20.6, myferr/mc-server:1.19.4, etc.
docker run -d -p 25565:25565 -e EULA=TRUE --name mc-server myferr/mc-server:1.21.6Set
EULAtoTRUEto agree to Minecraft's EULA. Required for running the server.
services:
mc-server:
image: myferr/mc-server:1.21.6
container_name: mc-server
ports:
- "25565:25565"Start the server:
docker compose up -dYou can configure the Minecraft server through environment variables in either docker run or docker-compose.yml.
| Variable | Values (examples) | Default | Description |
|---|---|---|---|
DIFFICULTY |
peaceful, easy, normal, hard |
easy |
Sets the difficulty level of the world. |
MOTD |
Any string (e.g. "Hello World!") |
"Welcome to my server!" |
Message shown in the server list (supports formatting codes). |
GAMEMODE |
survival, creative, adventure, spectator |
survival |
Sets the default gamemode for new players. |
HARDCORE |
true, false |
false |
Enables or disables hardcore mode. |
A Minecraft server icon is a visual representation of the game's logo or a custom design that can be used to identify the server in the server list, to apply the logo to the server just by placing it in the server-icon.png file in the server directory. Make sure it's a .png and a 64x64 pixel size.
To apply a server icon in your Docker Compose add the following lines:
volumes:
- ~/desktop/server-icon.png:/server/server-icon.pngFull example:
services:
mc-server:
image: myferr/mc-server
container_name: mc-server
ports:
- "25565:25565"
volumes:
- ~/desktop/server-icon.png:/server/server-icon.pngdocker run -d -p 25565:25565 \
-e MOTD="Welcome to my server!" \
-e DIFFICULTY=normal \
-e GAMEMODE=survival \
-e HARDCORE=false \
myferr/mc-server:latestservices:
mc-server:
image: myferr/mc-server:latest
ports:
- "25565:25565"
environment:
- DIFFICULTY=normal
- MOTD=Welcome to my server!
- GAMEMODE=survival
- HARDCORE=false| Version | Supported? |
|---|---|
1.21.11 |
β |
1.21.10 |
β |
1.21.9 |
β |
1.21.8 |
β |
1.21.7 |
β |
1.21.6 |
β |
1.21.5 |
β |
1.21.4 |
β |
1.21.3 |
β |
1.21.2 |
β |
1.21.1 |
β |
1.21 |
β |
1.20.6 |
β |
1.20.5 |
β |
1.20.4 |
β |
1.20.3 |
β |
1.20.2 |
β |
1.20.1 |
β |
1.20 |
β |
1.19.4 |
β |
1.19.3 |
β |
1.19.2 |
β |
1.19.1 |
β |
1.19 |
β |
1.18.2 |
β |
1.18.1 |
β |
1.18 |
β |
1.17.1 |
β |
1.17 |
β |
1.16.5 |
β |
1.16.4 |
β |
1.16.3 |
β |
1.16.2 |
β |
1.16.1 |
β |
1.16 |
β |
1.15.2 |
β |
1.15.1 |
β |
1.15 |
β |
1.14.4 |
β |
1.14.3 |
β |
1.14.2 |
β |
1.14.1 |
β |
1.14 |
β |
1.13.2 |
β |
1.13.1 |
β |
1.13 |
β |
1.12.2 |
β |
1.12.1 |
β |
1.12 |
β |
1.11.2 |
β |
1.11.1 |
β |
1.11 |
β |
1.10.2 |
β |
1.10.1 |
β |
1.10 |
β |
1.9.4 |
β |
1.9.3 |
β |
1.9.2 |
β |
1.9.1 |
β |
1.9 |
β |
1.8.9 |
β |
1.8.8 |
β |
1.8.7 |
β |
1.8.6 |
β |
1.8.5 |
β |
1.8.4 |
β |
1.8.3 |
β |
1.8.2 |
β |
1.8.1 |
β |
1.8 |
β |
This project is licensed under the MIT license and is completely open-source.

