This Docker image offers a customizable Minecraft server, supporting both Vanilla and Forge editions. For more information, please visit this GitHub repository.
| Setting | Default Value | Notes |
|---|---|---|
| JAVA_MIN_MEM | 1G | |
| JAVA_MAX_MEM | 2G | |
| GAMEMODE | 0 | See notes on acceptable values |
| MAXPLAYERS | 20 | |
| DIFFICULTY | 1 | See notes on acceptable values |
| MOTD | Docker Minecraft Server | Message to be displayed in the server list of players. |
| ENABLE_CMD_BLOCK | null | |
| MAX_TICK_TIME | 60000 | |
| GENERATOR_SETTINGS | null | |
| ALLOW_NETHER | true | |
| FORCE_GAMEMODE | false | |
| ENABLE_QUERY | false | |
| PLAYER_IDLE_TIMEOUT | 0 | |
| SPAWN_MONSTERS | true | |
| OP_PERMISSION_LEVEL | 4 | |
| PVP | true | |
| SNOOPER_ENABLED | true | |
| LEVEL_TYPE | DEFAULT | |
| HARDCORE | false | |
| NETWORK_COMPRESSION_THRESHOLD | 256 | |
| RESOURCE_PACK_SHA1 | null | |
| MAX_WORLD_SIZE | 29999984 | |
| SERVER_PORT | 25565 | |
| SERVER_IP | null | |
| SPAWN_NPCS | true | |
| ALLOW_FLIGHT | false | |
| LEVEL_NAME | world | |
| VIEW_DISTANCE | 10 | |
| RESOURCE_PACK | null | |
| SPAWN_ANIMALS | true | |
| WHITE_LIST | false | |
| GENERATE_STRUCTURES | true | |
| ONLINE_MODE | true | |
| MAX_BUILD_HEIGHT | 256 | |
| LEVEL_SEED | null | |
| PREVENT_PROXY_CONNECTIONS | false | |
| USE_NATIVE_TRANSPORT | true | |
| ENABLE_RCON | false |
Gamemode: Survival mode is gametype=0, Creative is gametype=1, Adventure is gametype=2, and Spectator is gametype=3
Difficulty: Defines the difficulty (such as damage dealt by mobs and the way hunger and poison affects players) of the server. Possible values are 0 (Peaceful)-3(Hard)
The recommended method to start Minecraft servers is by using the mcrun CLI tool, which can be downloaded from here.
To start a Forge server, use the following command:
mcrun forge start --world-name <world_name>
Additional flags are also available to customize the server configuration:
Usage:
mcrun forge start [flags]
Flags:
--enable-cmd-block Enable Command Block (default: true)
--gamemode string Set Gamemode: 0 for Survival, 1 for Creative, 2 for Adventure, and 3 for Spectator (default: "0")
-h, --help Display help for the start command
--max-memory string Set maximum memory limit (default: "3G")
--min-memory string Set minimum memory limit (default: "3G")
--port string Specify server port (default: "25565")
--seed string Set Minecraft world seed
--version string Specify Minecraft version (default: "forge-1.20.1")
--world-name string Set a name for the Minecraft server
Alternatively, you can run the server directly using Docker:
docker run --rm -d -e JAVA_MIN_MEM=3G -e JAVA_MAX_MEM=3G \
-e GAMEMODE=1 -e MAX_PLAYERS=10 \
-v $WORLD_DIR:/opt/minecraft/world -v $MODS_DIR:/opt/minecraft/mods -p 25565:25565 \
dm0275/minecraft-server:latest
Or via Docker Compose
version: '3'
services:
minecraft:
image: "dm0275/minecraft-server:latest"
container_name: minecraft
ports:
- "$PORT:25565"
volumes:
- $WORLD_DIR:/opt/minecraft/world
- $DATA_DIR:/opt/minecraft/data
- $MODS_DIR:/opt/minecraft/mods
environment:
- GAMEMODE
- MAX_PLAYERS
volumes:
world: {}
data: {}
mods: {}
Content type
Image
Digest
sha256:c852ea1ed…
Size
667.3 MB
Last updated
10 months ago
docker pull dm0275/minecraft-server