The following starts a Bedrock Dedicated Server running a default version and exposing the default UDP port:
docker run -d -it -e EULA=TRUE -p 19132:19132/udp -v mc-bedrock-data:/data itzg/minecraft-bedrock-serverNOTE: if you plan on running a server for a longer amount of time it is highly recommended using a management layer such as Docker Compose or Kubernetes to allow for incremental reconfiguration and image upgrades.
With the VERSION variable set to "LATEST", which is the default, then the Bedrock server can be upgraded by restarting the container. At every startup, the container checks for the latest version and upgrades, if needed.
The latest preview version can be requested by setting VERSION to "PREVIEW".
NOTE the Bedrock server software is not bundled into this image. Instead, it is downloaded/upgraded from Mojang only during container startup. As such, releases of this image are independent of releases of Mojang's software.
For Minecraft Java Edition you'll need to use this image instead:
EULA(no default) : must be set toTRUEto accept the Minecraft End User License AgreementVERSION(default isLATEST) : can be set to a specific server version or the following special values can be used:LATEST: determines the latest (non-preview) version and can be used to auto-upgrade on container startPREVIEW: determines the latest preview version and will auto-upgrade- otherwise any specific server version can be provided. If it is a preview version, also set
PREVIEWto "true"
UID(default derived from/dataowner) : can be set to a specific user ID to run the bedrock server processGID(default derived from/dataowner) : can be set to a specific group ID to run the bedrock server processTZ(no default): can be set to a specific timezone likeAmerica/New_York. This will set the timezone for the Docker container and therefore their logs. Addtionally, if you want to sync the time with the host, you can mount the/etc/localtimefile from the host to the container like/etc/localtime:/etc/localtime:ro.PACKAGE_BACKUP_KEEP(2) : how many package backups to keepDIRECT_DOWNLOAD_URL(no default): This environment variable can be used to provide a direct download URL for the Minecraft Bedrock server.zipfile. When set, this URL will be used instead of attempting to automatically look up the download link fromminecraft.net. This is particularly useful for CI/CD environments or when the automatic version lookup is temporarily broken due to website changes. Ensure the URL points directly to thebedrock-server-VERSION.zipfile.ENABLE_SSH(default isfalse) : Enable remote console over SSH on port 2222 if this environment variable is set totrue.
The following environment variables will set the equivalent property in server.properties, where each is described here.
Typically, each property is configured instead by the UPPER_SNAKE_CASE equivalent.
SERVER_NAMEGAMEMODEFORCE_GAMEMODEDIFFICULTYALLOW_CHEATSMAX_PLAYERSONLINE_MODEWHITE_LISTALLOW_LISTSERVER_PORTSERVER_PORT_V6ENABLE_LAN_VISIBILITYVIEW_DISTANCETICK_DISTANCEPLAYER_IDLE_TIMEOUTMAX_THREADSLEVEL_NAMELEVEL_SEEDLEVEL_TYPEDEFAULT_PLAYER_PERMISSION_LEVELTEXTUREPACK_REQUIREDCONTENT_LOG_FILE_ENABLEDCONTENT_LOG_LEVELCONTENT_LOG_CONSOLE_OUTPUT_ENABLEDCOMPRESSION_THRESHOLDCOMPRESSION_ALGORITHMSERVER_AUTHORITATIVE_MOVEMENTPLAYER_POSITION_ACCEPTANCE_THRESHOLDPLAYER_MOVEMENT_SCORE_THRESHOLDPLAYER_MOVEMENT_ACTION_DIRECTION_THRESHOLDPLAYER_MOVEMENT_DISTANCE_THRESHOLDPLAYER_MOVEMENT_DURATION_THRESHOLD_IN_MSCORRECT_PLAYER_MOVEMENTSERVER_AUTHORITATIVE_BLOCK_BREAKINGSERVER_AUTHORITATIVE_BLOCK_BREAKING_PICK_RANGE_SCALARCHAT_RESTRICTIONDISABLE_PLAYER_INTERACTIONCLIENT_SIDE_CHUNK_GENERATION_ENABLEDBLOCK_NETWORK_IDS_ARE_HASHESDISABLE_PERSONADISABLE_CUSTOM_SKINSSERVER_BUILD_RADIUS_RATIOALLOW_OUTBOUND_SCRIPT_DEBUGGINGALLOW_INBOUND_SCRIPT_DEBUGGINGFORCE_INBOUND_DEBUG_PORTSCRIPT_DEBUGGER_AUTO_ATTACHSCRIPT_DEBUGGER_AUTO_ATTACH_CONNECT_ADDRESSSCRIPT_WATCHDOG_ENABLESCRIPT_WATCHDOG_ENABLE_EXCEPTION_HANDLINGSCRIPT_WATCHDOG_ENABLE_SHUTDOWNSCRIPT_WATCHDOG_HANG_EXCEPTIONSCRIPT_WATCHDOG_HANG_THRESHOLDSCRIPT_WATCHDOG_SPIKE_THRESHOLDSCRIPT_WATCHDOG_SLOW_THRESHOLDSCRIPT_WATCHDOG_MEMORY_WARNINGSCRIPT_WATCHDOG_MEMORY_LIMITOP_PERMISSION_LEVELEMIT_SERVER_TELEMETRYMSA_GAMERTAGS_ONLYITEM_TRANSACTION_LOGGING_ENABLEDVARIABLES
For example, to configure a flat, creative server instead of the default use:
docker run -d -it --name bds-flat-creative \
-e EULA=TRUE -e LEVEL_TYPE=flat -e GAMEMODE=creative \
-p 19132:19132/udp itzg/minecraft-bedrock-server- UDP 19132 : the Bedrock server port on IPv4 set by
SERVER_PORT. The IPv6 port is not exposed by default. NOTE that you must append/udpwhen exposing the port, such as-p 19132:19132/udpand both IPv4 and IPv6 must be enabled on your host machine.
/data: the location where the downloaded server is expanded and ran. Also contains the configuration properties fileserver.properties
You can create a named volume and use it as:
docker volume create mc-volume
docker run -d -it --name mc-server -e EULA=TRUE -p 19132:19132/udp -v mc-volume:/data itzg/minecraft-bedrock-serverIf you're using a named volume and want the bedrock process to run as a non-root user then you will need to pre-create the volume and chown it to the desired user.
For example, if you want the bedrock server to run with user ID 1000 and group ID 1000, then create and chown the volume named "bedrock" using:
docker run --rm -v bedrock:/data alpine chown 1000:1000 /dataIf using docker run then simply reference that volume "bedrock" in the -v argument. If using a compose file, declare the volume as an external using this type of declaration:
volumes:
bedrock:
external:
name: bedrockWhen running the container on your LAN, you can find and connect to the dedicated server in the "LAN Games" part of the "Friends" tab, such as:
The Bedrock Dedicated Server requires permissions be defined with XUIDs. There are various tools to look these up online, such as MCProfile. A player's XUID is also printed to the log when a player joins.
There are 3 levels of permissions and 3 options to configure each group:
OPSis used to define operators on the server.
-e OPS="1234567890,0987654321"MEMBERSis used to define the members on the server.
-e MEMBERS="1234567890,0987654321"VISITORSis used to define visitors on the server.
-e VISITORS="1234567890,0987654321"There are two ways to handle a whitelist:
The first is to set the ALLOW_LIST environment variable to true and map in an allowlist.json file (previously known as "whitelist.json") that is custom-crafted to the container.
The other is to set the ALLOW_LIST_USERS environment variable to a comma-separated list of gamer tag usernames and their corresponding XUIDs. Each username should be followed by its XUID, separated by a colon. The server will use these details to match the player.
There are various tools to look XUIDs up online and they are also printed to the log when a player joins the server.
-e ALLOW_LIST_USERS="player1:1234567890,player2:0987654321"Custom server variables are supported by Bedrock. Details and usage instructions can be found on the official bedrock documentation, located here:
Custom server variables are passed in as comma-separated simple key-value pairs or as a full JSON string.
Server variables are parsed into their most likely type (number-like turn into numbers, all other inputs are treated as string) using jq's fromjson command. In the example below, var1 is a string, var2 is a number, and var3 is a string.
For greater control on types, users can provide a full string JSON representation that is used as-is.
All variables are written to the variables file located at config/default/variables.json. There is no support for Module-specific variable handling at this time.
# passing in simple expressions
-e VARIABLES="var1=customStringValue,var2=1234,var3=true"
# pass in a full json object:
-e VARIABLES='{"mobSpawnRate":22,"enableCheats":true,"worldArray":["My World", "Abc", 123]}'Also known as behavior or resource packs, in order to add mods into your server you can follow these steps, tested with OPS (One Player Sleep) and bedrocktweaks
- Install the mcpack or mcaddon on the client side first, just to make it easier to copy the files to the server, for Windows 10 files should be located on
C:\Users\USER\AppData\Local\Packages\Microsoft.MinecraftUWP_*\LocalState\games\com.mojang. - Copy over the folders of the mods from either behavior_packs or resource_packs into the server's volume.
If you want to install them without using a client you should be able to unzip the mods directly into the server's volume, .mcaddon should go into behavior_packs and .mcpack into resource_packs. Both .mcaddon and .mcpack are actually renamed .zip files.
- Lastly create on the server's volume
worlds/$level-name/world_behavior_packs.json, you'll need to add an entry for each mod like on the previous manifest.json, we only need the uuid now called pack_id and the version replacing dots with commas and double quotes with [ ].
You can also create a
worlds/$level-name/world_resource_packs.jsonbut I have seen that putting both resource and behavior packs inside the same json works just fine
[
{
"pack_id" : "5f51f7b7-85dc-44da-a3ef-a48d8414e4d5",
"version" : [ 3, 0, 0 ]
}
]
- Restart the server and the mods should be enabled now! when connecting you will get a prompt asking if you want to "Download & Join" or just "Join", You need to Download & Join if you want to actually see the new resource pack added to the server. This prompt is exclusive to resource packs as these alter how minecraft looks while behavior packs alter how minecraft functions and don't need to be downloaded or installed on the client side.
If you want to force the resource pack on all clients, there's an option
texturepack-required=falseinserver.propertiesthat should be changed totrue. Resource packs can be deleted by going into Settings > Storage > Cached Data, then selecting the pack and clicking on the trash can.
For more information FoxyNoTail did a video explaining the same on a server running on Windows.
For more information about managing Bedrock Dedicated Servers in general, check out this Reddit post.
This image comes bundled with a script called send-command that will send a Bedrock command and argument to the Bedrock server console. The output of the command only be visible in the container logs.
For example:
docker exec CONTAINER_NAME_OR_ID send-command gamerule dofiretick false
Alternatively, with stdin and tty enabled (such as using -it), attach to the container's console by its name or ID using:
docker attach CONTAINER_NAME_OR_IDWhile attached, you can execute any server-side commands, such as op'ing your player to be admin:
gamerule dofiretick false
When finished, detach from the server console using Ctrl-p, Ctrl-q
The examples directory contains an example Docker compose file that declares:
- a service running the bedrock server container and exposing UDP port 19132. In the example is named "bds", short for "Bedrock Dedicated Server", but you can name the service whatever you want
- a volume attached to the service at the container path
/data
services:
bds:
image: itzg/minecraft-bedrock-server
environment:
EULA: "TRUE"
ports:
- "19132:19132/udp"
volumes:
- ./data:/data
stdin_open: true
tty: trueStart the server and run in the background using:
docker compose up -dYou can follow the logs at any time using:
docker compose logs -fThe examples directory contains an example Kubernetes manifest file that declares:
- a peristent volume claim (using default storage class)
- a pod deployment that uses the declared PVC
- a service of type LoadBalancer
The pod deployment includes some examples of configuring the server properties via environment variables:
env:
- name: EULA
value: "TRUE"
- name: GAMEMODE
value: survival
- name: DIFFICULTY
value: normalThe file is deploy-able as-is on most clusters, but has been confirmed on Docker for Desktop and Google Kubernetes Engine:
kubectl apply -f examples/kubernetes.ymlYou can follow the logs of the deployment using:
kubectl logs -f deployment/bds- kaiede/minecraft-bedrock-backup image by @Kaiede
- ghcr.io/edward3h/mc-webhook by @edward3h
- Minecraft Bedrock Server Bridge by @macchie
- Admincraft by @joanroig
@TheTinkerDad provides an excellent tutorial on how to host multiple instances on a single port (19132) so that it's discoverable: https://www.youtube.com/watch?v=ds0_ESzjbfs
When trying to build this Docker Image, ensure that all
.shfiles have a end of line sequence ofLFnotCLRFor the build will fail.
