• Stars
    star
    756
  • Rank 60,056 (Top 2 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Containerized Minecraft Bedrock Dedicated Server with selectable version

Docker Pulls GitHub Issues Build Discord

Quickstart

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-server

NOTE: 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.

Upgrading to the latest Bedrock server version

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".

Looking for a Java Edition Server

For Minecraft Java Edition you'll need to use this image instead:

itzg/minecraft-server

Environment Variables

Container Specific

  • EULA (no default) : must be set to TRUE to accept the Minecraft End User License Agreement
  • VERSION (LATEST) : 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 start
    • PREVIEW : determines the latest preview version and will auto-upgrade
    • PREVIOUS : uses the previously maintained major version. Useful when the mobile app is gradually being upgraded across devices
    • 1.11 : the latest version of 1.11
    • 1.12 : the latest version of 1.12
    • 1.13 : the latest version of 1.13
    • 1.14 : the latest version of 1.14
    • 1.16 : the latest version of 1.16
    • otherwise any specific server version can be provided. If it is a preview version, also set PREVIEW to "true"
  • UID (default derived from /data owner) : can be set to a specific user ID to run the bedrock server process
  • GID (default derived from /data owner) : can be set to a specific group ID to run the bedrock server process
  • PACKAGE_BACKUP_KEEP (2) : how many package backups to keep

Server Properties

The following environment variables will set the equivalent property in server.properties, where each is described here.

  • SERVER_NAME
  • SERVER_PORT
  • SERVER_PORT_V6
  • GAMEMODE
  • DIFFICULTY
  • LEVEL_TYPE
  • ALLOW_CHEATS
  • MAX_PLAYERS
  • ONLINE_MODE
  • WHITE_LIST
  • VIEW_DISTANCE
  • TICK_DISTANCE
  • PLAYER_IDLE_TIMEOUT
  • MAX_THREADS
  • LEVEL_NAME
  • LEVEL_SEED
  • DEFAULT_PLAYER_PERMISSION_LEVEL
  • TEXTUREPACK_REQUIRED
  • SERVER_AUTHORITATIVE_MOVEMENT
  • PLAYER_MOVEMENT_SCORE_THRESHOLD
  • PLAYER_MOVEMENT_DISTANCE_THRESHOLD
  • PLAYER_MOVEMENT_DURATION_THRESHOLD_IN_MS
  • CORRECT_PLAYER_MOVEMENT

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

Exposed Ports

  • UDP 19132 : the Bedrock server port. NOTE that you must append /udp when exposing the port, such as -p 19132:19132/udp

Volumes

  • /data : the location where the downloaded server is expanded and ran. Also contains the configuration properties file server.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-server

If 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 /data

If 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: bedrock

Connecting

When 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:

Permissions

The Bedrock Dedicated Server requires permissions be defined with XUIDs. There are various tools to look these up online and they are also printed to the log when a player joins. There are 3 levels of permissions and 3 options to configure each group:

  • OPS is used to define operators on the server.
-e OPS "1234567890,0987654321"
  • MEMBERS is used to define the members on the server.
-e MEMBERS "1234567890,0987654321"
  • VISITORS is used to define visitors on the server.
-e VISITORS "1234567890,0987654321"

Allowlist

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 that should be allowed. The server will look up the names and add in the XUID to match the player.

-e ALLOW_LIST_USERS="player1,player2,player3"

Mods Addons

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

  1. 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.
  2. 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.

  1. On the server's volume we will need to edit valid_known_packs.json, you can just copy and paste the definition of another pack and replace path, uuid and version with the mod being installed, uuid and version can be found on the mod behavior or resource _packs/mod/manifest.json, path is the path to the mod's folder.
	{
		"file_system" : "RawPath",
		"path" : "behavior_packs/Foxy'sOneP",
		"uuid" : "5f51f7b7-85dc-44da-a3ef-a48d8414e4d5",
		"version" : "3.0.0"
	}
  1. 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.json but 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 ]
	}
]
  1. 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=false in server.properties that should be changed to true. 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.

More information

For more information about managing Bedrock Dedicated Servers in general, check out this Reddit post.

Executing server commands

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_ID

While 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

Deploying with Docker Compose

The examples directory contains an example Docker compose file that declares:

  • a service running the bedrock server container and exposing UDP port 19132
  • a volume to be attached to the service

The service configuration includes some examples of configuring the server properties via environment variables:

environment:
  EULA: "TRUE"
  GAMEMODE: survival
  DIFFICULTY: normal

From with in the examples directory, you can deploy the composition by using:

docker-compose up -d

You can follow the logs using:

docker-compose logs -f bds

Deploying with Kubernetes

The 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: normal

The 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.yml

You can follow the logs of the deployment using:

kubectl logs -f deployment/bds

Community Solutions

Tutorials

@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

More Repositories

1

docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
Shell
7,144
star
2

mc-router

Routes Minecraft client connections to backend servers based upon the requested server address
Go
338
star
3

minecraft-server-charts

Smarty
260
star
4

docker-mc-backup

Provides a side-car container to backup itzg/minecraft-server world data
Shell
190
star
5

mc-monitor

Monitor the status of Minecraft servers and provides Prometheus exporter and Influx line protocol output
Go
165
star
6

docker-bungeecord

A BungeeCord server to use in conjunction with itzg/minecraft-server
Shell
143
star
7

rcon-cli

A little RCON cli based on james4k's RCON library for golang
Go
122
star
8

docker-rcon-web-admin

A Docker image that runs rcon-web-admin
Dockerfile
69
star
9

saml-auth-proxy

Provides a SAML SP authentication proxy for backend web services
Go
42
star
10

react-mui-login-register

A user login/register React component styled with Material UI that includes options to use an authentication provider
JavaScript
41
star
11

restify

Enables REST-like access to HTML pages by scraping and parsing them into JSON.
Go
37
star
12

mc-image-helper

This tool does the complicated bits for the itzg/minecraft-server image
Java
27
star
13

mc-server-runner

A container entry point to manage graceful shutdown of a Minecraft server
Go
26
star
14

easy-add

A utility for easily adding a file from a downloaded archive during Docker builds
Go
22
star
15

mc-status

A web application that serves up a little REST API to query and convey the status of Minecraft servers using the native MC protocol
Java
18
star
16

go-flagsfiller

Bring your own struct and make Go's flag package pleasant to use
Go
15
star
17

redis-stomp-relay

This Spring Boot application implements a STOMP relay that delegates to Redis pub/sub.
Java
14
star
18

haproxy-gen

Generate an haproxy.cfg file for multi-domain proxying
Go
12
star
19

websocket-stomp-user-queues

A little Spring Boot application to demonstrate the use of several technologies and techniques
Java
11
star
20

kidsbank-js

kids bank is a totally virtual way for parents and kids to keep track of allowance, etc
Java
11
star
21

rcon-hub

Provides an SSH server that enables rcon connections to configured game servers
Go
10
star
22

entrypoint-demoter

Container entry point that can demote uid and gid from environment variables or matching directory
Go
9
star
23

kube-metrics-exporter

Simple application that accesses the Kubernetes metrics API and exports the pod metrics for Prometheus scraping
Go
6
star
24

docker-minecraft-docs

Documentation hub for all the itzg Docker Minecraft images
5
star
25

web-debug-server

A very minimal web server that responds with a page containing the request headers and content
Go
5
star
26

mc-modpacks-starter

5
star
27

kita

An easy-to-deploy and easy-to-use ACME client service for Kubernetes Ingress instances
Java
4
star
28

simple-boot-image-gradle-plugin

A simple Gradle plugin to build very simple Spring Boot application Docker images
Java
4
star
29

try-oauth2-login

This application tests out Spring Boot's OAuth2 support for pre-defined providers
Java
3
star
30

try-luckperms-with-db

3
star
31

go-ssh-shell

Go module that serves SSH sessions with an interactive shell
Go
3
star
32

docker-grakn

This Docker image packages the GRAKN.AI knowledge graph database
Shell
3
star
33

try-nextjs-auth0

React frontend, rendered by Next.js, authenticated by Auth0, and backend API by Spring Boot
JavaScript
3
star
34

example-self-monitor-kafka-app

An example Spring Boot application that is both a Kafka producer and consumer that reports out its own kakfa performance metrics to InfluxDB
Java
3
star
35

discord-github-melder-bot

Discord bot that provides a command for users to link their Github user and apply contributor role
Java
3
star
36

junit-rule-docker

A JUnit rule that manages a Docker container lifecycle around test statements.
Java
3
star
37

itzg

3
star
38

go-tcp-relay

A little experiment to write a Go application that can relay incoming TCP connections to a dynamically requested endpoint
Go
3
star
39

alexa-notes

An Amazon Alexa (aka Echo) skill that provides very basic note taking capability.
Java
3
star
40

cert-helper

A Docker image that helps with self-signed/cluster signed certificate creation for use in other Docker containers
Shell
3
star
41

github-release-watcher

A Spring Boot + React web app that shows most recent releases of repositories you have starred.
Java
3
star
42

draw-legra

Trying out the Legra library in a React app
JavaScript
2
star
43

docker-kafka-multiarch

Shell
2
star
44

maven-metadata-release

A little utility to output the release identified by a maven-metadata.xml local/remote file
Go
2
star
45

kafka-slurp

Java
2
star
46

docker-rabbitmq-stomp

Extension of the official rabbitmq image that enables the rabbitmq_stomp plugin
2
star
47

file-tree-as-json

Walks one or more directories capturing the file/directory tree into a JSON format
Java
2
star
48

docker-apacheds

This image provides a streamlined ApacheDS server
2
star
49

docker-znc

A ZNC, an IRC bouncer, image with an easy option to switch between SSL and non-SSL serving
Shell
2
star
50

alt-codes

Little next.js web app that shows alt codes
JavaScript
2
star
51

prune-branches

CLI that prunes local git branches that have been merged
Java
2
star
52

test-github-releaser-plugin

Ruby
2
star
53

docker-mongo-backups

A very simplistic container to perform periodic backups of an adjacent mongo container
Shell
2
star
54

homebrew-tap

Homebrew tap for itzg's apps
Ruby
2
star
55

jsonschema2pojo-rules-bettermaps

Custom RuleFactory for the jsonschema2pojo facility that identifies additionalProperties that only declare a simple type and generates a Map without an intermediate property POJO.
Java
2
star
56

forge-downloader

A simple utility for downloading Forge installers
Go
1
star
57

spring-etcd

etcd v2 client based on Spring's RestTemplate
Java
1
star
58

getter

A little Java program that is useful inside containers where curl is not yet installed
Java
1
star
59

spring-boot-with-reactjs

JavaScript
1
star
60

docker-protoc2

This Google Protobuf compiler image is for projects that need an "ancient" version of the protoc compiler.
1
star
61

scoop-bucket

My apps published for installation via scoop
1
star
62

openstack-utils

Helper scripts install OpenStack on Ubuntu
Shell
1
star
63

carina-cli

This is a Dockerization of the Carina CLI, which is used to manage your Rackspace Carina clusters from the command-line.
Shell
1
star
64

artifactory-settings-gen

Java
1
star
65

try-spring-boot-with-jib

Java
1
star
66

go-metrics

This library provides Go applications a simple way to report dimensional statistics with optional support for Influx line protocol
Go
1
star
67

pom-tweaker

A simple Java tool to perform version, etc tweaking of Maven pom.xml files.
Java
1
star
68

try-nextjs-jwt-boot-api

Next.js web application that uses JWT issued by Auth0 to access authenticated Spring Boot API
JavaScript
1
star
69

libvirt-tools

A repo of some tools to simplify working with libvirt, kvm, qemu
Shell
1
star
70

test-webhooks

1
star
71

example-spring-security-impersonate

An example Spring MVC Security application that introduces a custom security filter to allow for user impersonation during development/testing.
Shell
1
star
72

mc-bds-helper

Go
1
star
73

LearningJava

Contains material teaching Java for new programmers
HTML
1
star
74

test-workflows

1
star
75

nextjs-bootstrap-validation

JavaScript
1
star
76

try-jpa-pk-and-fk

Spring Data JPA app that tries out an entity that uses a OneToOne relationship as primary key
Java
1
star
77

mcadmin-versions

Extracts the Spigot and CraftBukkit versions published by mcadmin site.
Java
1
star
78

try-oauth2-validate-aud

Java
1
star
79

utils

Java
1
star
80

img-hacker

A little golang tool to run some image manipulation
Go
1
star
81

spring-security-spa

Provides Spring Security filters and supporting classes that streamline the use of authentication and registration within Single Page web Applications
Java
1
star
82

docker-kodexplorer

This image runs KodExplorer
Dockerfile
1
star
83

logstash-filter-docker_container

A Logstash (>1.5) filter plugin to resolve Docker container IDs into the container's name
Ruby
1
star
84

docker-thrift

A Docker image for running the thrift generator
1
star
85

try-sb-test-properties-loading

This Spring Boot code demonstrates several ways of using a type-safe configuration class during unit testing
Java
1
star
86

imdb-warzat

JavaScript
1
star
87

docker-ubuntu-remote-dev

Shell
1
star
88

spring-security-vault-provider-example

Example Spring Boot web app using Vault as the Spring Security authentication provider
Java
1
star
89

atom-greppen-grok

An Atom editor package to grep and grok text into just what you want
CoffeeScript
1
star
90

nuc-es

My home NUC setup for ES and friends
1
star
91

stackdriver-spring-boot-autoconfigure

Provides a Spring Boot auto-configuration to export actuator metrics to Google Cloud's Stackdriver
Java
1
star
92

try-thanos

Contains a set of Kubernetes manifest files to try out a "single node" deployment of Thanos using MinIO as an S3 object store.
1
star
93

try-spring-jta-rollback-listener

This application tests the use of a @TransactionalEventListener in order to perform custom rollback processing.
Java
1
star
94

try-nextjs-cookie-auth-api

Very contrived Next.js application to simulate an authentication flow that uses next-cookies to provide server and client side with auth code
JavaScript
1
star
95

logstash-output-elasticsearch-groom

A logstash output plugin that will perform event triggered grooming (aka pruning) of time-series indices especially those created by logstash-output-elasticsearch.
Ruby
1
star
96

jenkins-vagrant-example

Brings up three Vagrant VMs with one Jenkins master and two slaves configured to run Docker pipeline jobs
1
star
97

chef-slurper

A little utility to bridge the worlds of Ansible and Chef
Go
1
star