Skip to content

Latest commit

 

History

History
291 lines (274 loc) · 17.9 KB

README.md

File metadata and controls

291 lines (274 loc) · 17.9 KB

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

  • Sets up the official Minecraft Bedrock Server (currently in alpha testing)
  • Fully operational Minecraft Bedrock edition server in a couple of minutes
  • Adds logging with timestamps to "logs" directory
  • Multiarch Support - all Docker platforms supported including Raspberry Pi
  • Automatic backups when container/server restarts
  • Supports multiple instances -- you can run multiple Bedrock servers on the same system
  • Updates automatically to the latest or user-defined version when server is started
  • Files stored in named Docker volume allowing for extremely easy access/editing and leveraging more advanced Docker features such as automatic volume backups
  • Uses Box64 for aarch64 (ARM 64 bit) for improved emulation speed due to box64's use of native syscalls where possible
  • *NEW*Raspberry Pi 5 and RK3588 Box64-optimized support

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-16k
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:
  • Set the ingress ports (TCP/UDP) in the Virtual Cloud Network (VCN) security list
  • *and* set the ingress ports in a Network Security Group assigned to your instance

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)

  • PayPal: [email protected]
  • Venmo: @JamesAChambers
  • CashApp: $theremote
  • Bitcoin (BTC): 3H6wkPnL1Kvne7dJQS8h7wB4vndB9KxZP7

Update History

  • December 1st 2024
    • Fix issues with download URL
  • May 19th 2024
    • Added Raspberry Pi 5 and RK3588 support
    • Pull image 05jchambers/legendary-bedrock-container:pi5 for 5k block size and 05jchambers/legendary-bedrock-container:pi5-16k for 16K block size
    • Pull image 05jchambers/legendary-bedrock-container:rk3588 for RK3588 optimized Box64 build
    • Fixed dependencies from latest ldd of bedrock_server
    • Removed OpenSSL 1.1 installation as it is no longer needed
  • December 13th 2023
    • Refresh packages and dependencies
  • October 1st 2023
    • Refresh packages and dependencies
    • Fix arm64 builds
  • January 14th 2023
    • Change connectivity test from google.com to papermc to prevent blocking in some countries
  • January 12th 2023
    • Remove broken ScheduleRestart environment variable -- this needs to be done in your OS using docker restart (typically with crontab in Linux or Task Scheduler in Windows)
  • November 19th 2022
    • Add "QuietCurl" environment variable which will suppress the progress meter on curl keeping the logs much tidier
    • Remove fixpermissions.sh and add 3 lines into main start.sh file
  • November 7th 2022
    • Fail immediately if ran without an interactive terminal (as the Minecraft server won't work without one)
  • October 30th 2022
    • Fix bug with new ScheduleRestart environment variable
  • October 21st 2022
    • Added new environment variable "BackupCount" to control the number of backups the container keeps
  • October 20th 2022
    • Added new environment variable "NoPermCheck" to skip permissions check during startup
    • Added new environment variable "ScheduleRestart" -- this schedules the container to shut down at a certain time which combined with the --restart switch gives daily reboot functionality
  • September 27th 2022
    • Fix SIGTERM catching in certain situations by running screen/java with the "exec" command which passes execution completely to that process (thanks vp-en)
  • August 29th 2022
    • Add TZ environment variable to set timezone
    • Add environment variables to docker-compose.yml template
  • August 22nd 2022
    • Add NoScreen environment variable -- disables screen which prevents needing an interactive terminal (but disables some logging)
  • August 12th 2022
    • Enable "Content Log" in default server.properties which logs errors related to resource and behavior packs
    • Add "Clean" environment variable to force cleaning and reinstallation of the bedrock server for troubleshooting/repair
    • To use it specify -e Clean=Y on your Docker container launch command line
  • August 10th 2022
    • Add nano to have an editor while inside the container (for troubleshooting)
  • August 2nd 2022
    • Added experimental Box64 support for aarch64 -- speeds things up for 64-bit ARM users
    • You must be running a 64-bit OS to benefit from the Box64 increased speeds (both Ubuntu and Raspberry Pi OS have 64-bit versions)
    • An easy way to check and make sure you are running 64 bit is to use
      uname -m
      which will return "aarch64" if you are on 64-bit ARM
    • If you are having trouble with Box64 (file an issue / leave me a comment on my site so I know about it) you can disable it by adding
      -e UseQEMU=Y
      to the command line to tell it to use QEMU instead of Box64
  • July 14th 2022
    • Added over a dozen new very recently introduced dependencies -- update container with docker pull 05jchambers/legendary-bedrock-container:latest to get new dependencies
    • Updated from Ubuntu "Impish" to Ubuntu "Latest" base image as libssl3t64 is now linked in the bedrock_server dependencies
  • July 13th 2022
    • Update base Ubuntu image
  • June 27th 2022
    • Update base Ubuntu image
  • Jun 11th 2022
    • Added allowlist.json and permissions.json default template files to prevent crashes when they are missing
  • Jun 7th 2022
    • Add docker-compose.yml template for use with docker-compose
  • Jun 2nd 2022
    • Added a couple of path safety checks and more information about what paths are being used with Version environment variable
  • May 31st 2022
    • Added default server.properties file to prevent rare container launch issue
  • May 27th 2022
    • Cleaned up qemu-user-static installation
  • May 26th 2022
    • Fixed issue with new Version environment variable that could lead to it not working
  • May 25th 2022
    • Added Version environment variable. Example: -e Version=1.19.10.20
  • May 22nd 2022
    • Fixed container launch issue on aarch64
  • May 21st 2022
    • Added multiarch Docker images
    • Reduced image sizes
  • May 17th 2022
    • Bump Dockerfile base image to ubuntu:latest
    • Add libssl1.1 manual installation baked into base image
  • May 15th 2022
    • Added screen -wipe to beginning of start.sh to prevent a startup issue that could occur if there was a "dead" screen instance (thanks grimholme, issue #2).
  • May 12th 2022
    • Added --platform=linux/amd64 to Dockerfile as on aarch64 platforms the container was not starting successfully without it (thanks Mootch, issue #1).
  • May 9th 2022
    • Initial release -- thanks to everyone who kept asking about it so I would finally put it together!