Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ARG BOX64_PACKAGE=box64
RUN --mount=target=/build,source=build BOX64_PACKAGE=$BOX64_PACKAGE /build/setup-arm64

EXPOSE 19132/udp
EXPOSE 19133/udp

VOLUME ["/data"]

Expand Down Expand Up @@ -58,7 +59,8 @@ COPY bin/* /usr/local/bin/
# https://minecraft.wiki/w/Bedrock_Edition_1.13.0
# https://minecraft.wiki/w/Bedrock_Edition_1.14.0
ENV VERSION=LATEST \
SERVER_PORT=19132
SERVER_PORT=19132 \
SERVER_PORT_V6=19133

HEALTHCHECK --start-period=1m CMD /usr/local/bin/mc-monitor status-bedrock --host 127.0.0.1 --port $SERVER_PORT

Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
## Quickstart

The following starts a Bedrock Dedicated Server running a default version and
exposing the default UDP port:
exposing the default IPv4 UDP port:

```bash
docker run -d -it -e EULA=TRUE -p 19132:19132/udp -v mc-bedrock-data:/data itzg/minecraft-bedrock-server
```

If your network is dual-stack (IPv4 and IPv6), also map the IPv6 port:

```bash
-p 19132:19132/udp -p 19133:19133/udp
```

> **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](#deploying-with-docker-compose) or [Kubernetes](#deploying-with-kubernetes) to allow for incremental reconfiguration and image upgrades.

## Upgrading to the latest Bedrock server version
Expand Down Expand Up @@ -148,8 +154,10 @@ docker run -d -it --name bds-flat-creative \

## Exposed Ports

- **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 `/udp` when exposing the port, such as `-p 19132:19132/udp` and both IPv4 and IPv6 must be enabled on your host machine.
- **UDP** 19132 : the Bedrock server port for IPv4 clients, set by `SERVER_PORT`
- **UDP** 19133 : the Bedrock server port for IPv6 clients, set by `SERVER_PORT_V6`

**NOTE** that you must append `/udp` when exposing the ports, such as `-p 19132:19132/udp -p 19133:19133/udp`.

## Volumes

Expand Down Expand Up @@ -335,7 +343,7 @@ When finished, detach from the server console using Ctrl-p, Ctrl-q
## Deploying with Docker Compose

The [examples](examples) directory contains [an example Docker compose file](examples/docker-compose.yml) 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 service running the bedrock server container and exposing UDP ports 19132 (IPv4) and 19133 (IPv6). 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`

```yaml
Expand All @@ -346,6 +354,7 @@ services:
EULA: "TRUE"
ports:
- "19132:19132/udp"
- "19133:19133/udp"
volumes:
- ./data:/data
stdin_open: true
Expand Down
2 changes: 1 addition & 1 deletion examples/AzureBedrockServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $STORAGE_KEY=$(az storage account keys list --resource-group mineResGroup --acco
echo $STORAGE_KEY

#to actually create the minecraft server int the dns name "minesvrbedrock"
#the server will be running into server "minesvrbedrock.southcentralus.azurecontainer.io" port "19132", this take some time be patient.
#the server will be running into server "minesvrbedrock.southcentralus.azurecontainer.io" ports "19132" (IPv4) and "19133" (IPv6), this take some time be patient.
az container create --resource-group mineResGroup --name minecotainer --image itzg/minecraft-bedrock-server --dns-name-label minesvrbedrock --ports 19132 19133 --protocol udp --restart-policy OnFailure --environment-variables EULA=TRUE --azure-file-volume-account-name acismineacc --azure-file-volume-account-key $STORAGE_KEY --azure-file-volume-share-name acismineshare --azure-file-volume-mount-path /data

#connect to fileshare drive "M" to edit server.properties and everything else
Expand Down
1 change: 1 addition & 0 deletions examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
EULA: "TRUE"
ports:
- "19132:19132/udp"
- "19133:19133/udp"
volumes:
- ./data:/data
stdin_open: true
Expand Down
4 changes: 4 additions & 0 deletions examples/kubernetes-tailscale-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ spec:
ports:
- containerPort: 19132
protocol: UDP
- containerPort: 19133
protocol: UDP
readinessProbe: &probe
exec:
command:
Expand Down Expand Up @@ -115,3 +117,5 @@ spec:
ports:
- port: 19132
protocol: UDP
- port: 19133
protocol: UDP
10 changes: 9 additions & 1 deletion examples/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data:
#LEVEL_SEED: "33480944"
#SERVER_NAME: "my_minecraft_server"
#SERVER_PORT: "19132"
#SERVER_PORT_V6: "19133"
#LEVEL_TYPE: "DEFAULT" # Options: FLAT, LEGACY, DEFAULT
#ALLOW_CHEATS: "false" # Options: true, false
#MAX_PLAYERS: "10"
Expand Down Expand Up @@ -63,6 +64,8 @@ spec:
ports:
- containerPort: 19132
protocol: UDP
- containerPort: 19133
protocol: UDP
readinessProbe: &probe
exec:
command:
Expand Down Expand Up @@ -92,10 +95,15 @@ metadata:
spec:
selector:
app: bds
ipFamilyPolicy: PreferDualStack
ipFamilies:
- IPv4
- IPv6
ports:
- port: 19132
protocol: UDP
ipFamily: IPv4
- port: 19133
protocol: UDP
# Use LoadBalancer if running on a provider that supports that
# type: LoadBalancer
# or use NodePort on a non-managed system;
Expand Down
Loading