TheRemote / Legendary-Bedrock-Container

Minecraft Bedrock dedicated server container featuring logging with timestamps, multiple server support, automated backups and more
https://jamesachambers.com/legendary-minecraft-bedrock-container/
MIT License
81 stars 14 forks source link
bedrock bedrock-edition dedicated-game-server dedicated-server docker minecraft minecraft-server

Legendary Bedrock Container - Minecraft Bedrock Dedicated Server for Docker

Legendary Minecraft Bedrock Container

This is the Docker containerized version of my Minecraft Bedrock Dedicated Server for Linux.

My main blog article (and the best place for support) is here.
The official GitHub repository is located here.
The official Docker Hub repository is located here.

The Java version of the container that has Geyser allowing Bedrock players to connect is here
The regular Java version of the Docker container is available here.

Features

Usage

First you must create a named Docker volume. This can be done with:

docker volume create yourvolumename

Now you may launch the server and open the ports necessary with one of the following Docker launch commands:

With default ports:

docker run -it -v yourvolumename:/minecraft -p 19132:19132/udp -p 19132:19132 -p 19133:19133/udp -p 19133:19133 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest

With custom ports:

docker run -it -v yourvolumename:/minecraft -p 12345:12345/udp -p 12345:12345 -p 12346:12346/udp -p 12346:12346 -e PortIPV4=12345 -e PortIPV6=12346 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest

IPV4 only:

docker run -it -v yourvolumename:/minecraft -p 19132:19132/udp -p 19132:19132 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest

Configuration / Accessing Server Files

The server data is stored where Docker stores your volumes. This is typically a folder on the host OS that is shared and mounted with the container.
You can find your exact path by typing:

docker volume inspect yourvolumename
This will give you the fully qualified path to your volume like this:

{
        "CreatedAt": "2022-05-09T21:08:34-06:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/yourvolumename/_data",
        "Name": "yourvolumename",
        "Options": {},
        "Scope": "local"
    }


On Linux it's typically available at:

/var/lib/docker/volumes/yourvolumename/_data

On Windows it's at
C:\ProgramData\DockerDesktop
but if you are using WSL (Windows Subsystem for Linux) it may be located at something more like
\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\

On Mac it's typically
~/Library/Containers/com.docker.docker/Data/vms/0/

If you are using Docker Desktop on Mac then you need to access the Docker VM with the following command first:

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

You can then normally access the Docker volumes using the path you found in the first step with docker volume inspect

Most people will want to edit server.properties. You can make the changes to the file and then restart the container to make them effective.
Backups of the Minecraft are server are created each time the server starts and are stored in the "backups" folder

Log files with timestamps are stored in the "logs" folder.

Version Override

In some scenarios you may want to run a specific version of the Bedrock server. That is now possible by using the "Version" environment variable:

docker run -it -v yourvolumename:/minecraft -e Version=1.18.33.02 -p 19132:19132/udp -p 19132:19132 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest
This is useful if Microsoft hasn't released versions of the client and dedicated server at the same time so you can match whichever version your players can connect with.

Raspberry Pi 5 Support

If you try to use Box64 with the Raspberry Pi 5 using the default ARM64 branch it will give you a block size error.
There are two images for the Raspberry Pi. The default 5K block size as well as a 16K block size image.
These are available as 05jchambers/legendary-bedrock-container:pi5 or 05jchambers/legendary-bedrock-container:pi5-64k
Use those in place of :latest or :arm64 on the Raspberry Pi 5

RK3588 Support

If you are using a RK3588-based board there is a Box64 optimized image available for the board
To use it use 05jchambers/legendary-bedrock-container:rk3588 in place of :latest or :arm64

Clean Environment Variable

If the server is having trouble starting you can clean the downloads folder and force reinstallation of the latest version:

docker run -it -v yourvolumename:/minecraft -e Clean=Y -p 19132:19132/udp -p 19132:19132 05jchambers/legendary-bedrock-container:latest

Disable Box64 (aarch64 only)

Box64 speeds up performance on 64-bit ARM platforms by translating some calls that are normally emulated as native system calls (much faster). If you are having trouble running the dedicated server with Box64 support you can tell it to use QEMU instead with:

-e UseQEMU=Y
For example:
docker run -it -v yourvolumename:/minecraft -e UseQEMU=Y -p 19132:19132/udp -p 19132:19132 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest

TZ (timezone) Environment Variable

You can change the timezone from the default "America/Denver" to own timezone using this environment variable:

docker run -it -v yourvolumename:/minecraft -e TZ="America/Denver" -p 19132:19132/udp -p 19132:19132 05jchambers/legendary-bedrock-container:latest
A list of Linux timezones is available here

QuietCurl Environment Variable

You can use the QuietCurl environment variable to suppress curl's download output. This will keep your logs tidier but may make it harder to diagnose if something is going wrong. If things are working well it's safe to enable this option and turn it back off so you can see the output if you need to:

docker run -it -v yourvolumename:/minecraft 19132:19132/udp -p 19132:19132 -e QuietCurl=Y 05jchambers/legendary-bedrock-container:latest

NoPermCheck Environment Variable

You can skip the permissions check (can be slow on very large servers) with the NoPermCheck environment variable:

docker run -it -v yourvolumename:/minecraft -e NoPermCheck="Y" -p 19132:19132/udp -p 19132:19132 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest

Troubleshooting Note - Oracle Virtual Machines

A very common problem people have with the Oracle Virtual Machine tutorials out there that typically show you how to use a free VM is that the VM is much more difficult to configure than just about any other product / offering out there.
The symptom you will have is that nobody will be able to connect. This is not because of the second set of ports that it shows after startup (that is a nearly 3-4 years now old Bedrock bug and all servers do it).
It is because there are several steps you need to take to open the ports on the Oracle VM. You need to both:


Both of these settings are typically required before you will be able to connect to your VM instance. This is purely configuration related and has nothing to do with the script or the Minecraft server itself.

I do not recommend this platform due to the configuration difficulty but the people who have gone through the pain of configuring an Oracle VM have had good experiences with it after that point. Just keep in mind it's going to be a rough ride through the configuration for most people.

Here are some additional links:

Troubleshooting Note - Hyper-V

There is a weird bug in Hyper-V that breaks UDP connections on the Minecraft server. There are two fixes for this. The simplest fix is that you have to use a Generation 1 VM with the Legacy LAN network driver.
See the following links:
There is a second fix that was shared by bpsimons here.
You need to install ethtool first with sudo apt install ethtool. Next in your /etc/network/interfaces file add "offload-tx off" to the bottom as the issue appears to be with TX offloading.
Here's an example:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
offload-tx off
This can also be done non-persistently with the following ethtool command:
ethtool -K eth0 tx off

Buy A Coffee / Donate

People have expressed some interest in this (you are all saints, thank you, truly)

Update History