
I’ve been getting asked to put this together for years including in official GitHub issues. I always knew it would be a great idea but it turned out even better than I expected. This image works great on all platforms including Raspberry Pi!
This is based off my Minecraft Bedrock Linux Dedicated Server scripts for Linux project. I’m going to release a version for the Java Minecraft edition as well so stay tuned for that.
The official GitHub repository is located here.
The official Docker Hub repository is located here.
If you are looking for the Java version of the Docker container it is located here. This is for the Bedrock edition of Minecraft.
You can also run my Geyser + Floodgate Java Minecraft Server container and Bedrock players will be able to connect to it!
It’s now possible to convert your worlds between Bedrock and Java versions. Check out my guide on Chunker here for more information.
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
- *NEW* – Box64 support added for improved speeds on aarch64 (ARM 64 bit)
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. I’ll give the usual locations here but if you’re having trouble just do some Googling for your exact platform and you should find where Docker is storing the volume files.
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 may be located at something more like
\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\
if you are using WSL (Windows Subsystem for Linux).
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 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:
-e Version=1.18.33.02
For example:
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.
Clean Environment Variable
If the server is having trouble starting you can clean the downloads folder and force reinstallation of the latest version like this:
docker run -it -v yourvolumename:/minecraft -e Clean=Y -p 19132:19132/udp -p 19132:19132 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest
This is useful if a download corrupted or something modified your container contents as it will clear everything out and reinstall the latest Bedrock server fresh.
Disable Box64 (aarch64 only):
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 --restart unless-stopped 05jchambers/legendary-bedrock-container:latest
A list of Linux timezones is available here.
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.
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.
Troubleshooting Note – Hyper-V
There is a weird bug in Hyper-V that breaks UDP connections on the Minecraft server. The fix for this is that you have to use a Generation 1 VM with the Legacy LAN network driver.
There is a second fix that was shared by bpsimons here. For that fix 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
Additional Support
The comments section right here is the best place for support. The second best place is the GitHub issues section.
I will add additional documentation based on what problems people are running into / questions people are asking because right now I’m not really sure what those will be yet. Definitely let me know if you need any of these things!
Hello. I have an vServer With 24GB RAM and 8 CPUs and Its only for my Minecraft Server. But Docker says it Launch 500% CPU and More and Its a Little Bit laggy in Game. Can someone help ?
Hey Marcel,
It is it a x86_64 server? I doubt it. It’s almost impossible to hit numbers that high with x86_64 on Bedrock. It’s probably ARM which means it’s using emulation. Emulation is definitely slow.
To be honest with you the way to get a faster server is to not use Bedrock. There’s no ARM binaries available.
My recommendation would be to run my Java version of the server with Geyser installed. Why? Because Geyser makes it so Bedrock and Java players can all play together on the same server. It makes Bedrock essentially obsolete. You won’t have any performance issues with Java at all since Java is designed to run on all architectures (including ARM). Bedrock is not.
If you already have an existing Bedrock server you could convert it to Java using my converting servers using Chunker guide.
And finally, if this is an x86_64 then that would point to your storage being woefully inadequate. It’s impossible for it to really use 400% CPU on Bedrock unless you have at least dozens of players. It would suggest to me though that your storage can’t keep up. Are you using a HDD in any way with this setup? That would definitely back things up for sure. A SD card will back them up even more. Upgrading to a SSD may be in order if not already using one.
In other words the reason it says 400% CPU is not because the CPU is actually busy. It’s likely just waiting for the storage to catch up and this happens a lot with SBCs / ARM. If you’re using ARM then yes, it’s going to hit 400% CPU all of the time because it has to use emulation for *everything* unlike Java.
That’s why me (the developer) kind of considers this container obsolete. I have yet to meet someone who wouldn’t have been better off running my Java container + Geyser instead to deliver an identical experience that is much easier to host and performs much better. You can even use Chunker to convert them if you already have an existing Bedrock server.
I still support this one but sometimes I wonder why. I keep thinking maybe someone out there really needs the *real* Bedrock server instead of Geyser. Except I can’t think of a single reason why they would. Bedrock doesn’t allow for any mods anyway. I can’t think of anything Bedrock can do that Geyser can’t.
Hopefully that helps!
This is an AMD-V Server x86_64 With 8 CPUs and AMD EPYC 7452 32-Core Processor. I use This Docker because without Docker and the Same Files it cant load my Mods.
Hey Marcel,
What’s the storage? Is it HDD?
Does it do it if you start a new server?
It’s way, way too high for x86_64.
A Raspberry Pi can easily run this without lag with only a few people *if* they’re using a SSD. Slow storage though will cause bottlenecking.
Have you ran iotop on it? iostat would work as well or any of the other programs meant to measure disk utilization. Your CPU is too powerful to be the bottleneck. It’s going to be your storage I think.
If this is a server with a giant RAID array of HDDs (I have several servers like that in my basement) then depending on how expensive it was it might be fast enough but I’d still really recommend a SSD. Even though those perform better than an individual hard drive they won’t perform better than NVMe (especially on access time / random read/write).
I’d imagine that most of that several hundred % CPU time you are seeing is actually just the CPU waiting for the storage to respond. iotop and iostat will reveal this if it is the case.
I should ask something else I already made an assumption on. How many players are we talking? Is this like 20+ players? If so then that’s going to change things. It would make high performance NVMe a requirement for one. I assume we’re not talking about dozens or hundreds of players but that would certainly explain CPU usage like that if we are.
If you don’t have dozens or hundreds of players though this CPU usage is absolutely crazy. I’d assume it’s really storage bottlenecking at that point which some further testing should help with determining if that’s the case. It’s pretty tough to hit numbers like 400% though unless you are using a Raspberry Pi / ARM server (because of the emulation). Using native x86_64 I would consider this to be some kind of malfunction or major bottleneck somewhere like storage.
If the server is already using NVMe then we would need to still look at the disk utilization. Are there other services/VMs running using up all the storage bandwidth? Because it’s bottlenecking real hard to the point where I mistook it for a Raspberry Pi. That’s the device I’d expect to see those #s on.
Hopefully that helps!
iotop Says Most likely 0K/s and sometimes When it work 36K/s. This is nothing. 88% is on idle. I use an SSD.
Top says bedrock+ use 150% CPU
Hey Marcel,
It’s extremely unusual to have lag on Bedrock when running on x86_64. If you try to google for it it’s hard to even find examples of people saying this is a thing.
What mods are you using? Like I said does this happen if you start a new server? If you have behavior packs those completely change the behavior of Minecraft so there’s probably a lot more going on than normal.
The reason I was asking if you’d tried it with a new server is because it tells us whether the problem is with your server or with your hardware. That’s really the question. There really isn’t anything to be done by either of us for Bedrock to make it run faster. My server is the exact same as the one on Microsoft’s web site. I don’t have the source code to it and they won’t give it to anyone. We can’t really change anything to fix it as far as that goes.
All of the hardware looks okay. We know that a fresh instance won’t lag like this so the question is now what is different about your setup. The mods seem likely. How many mods are installed? Are they behavior packs that modify the behavior of Minecraft? Are they adding new mob types and things like that to the game? That’s all going to have an impact for sure.
Troubleshooting that would be as simple as disabling mods one at a time and monitoring the CPU usage. See which one is making things jump so high. It’s very likely only one or two bad ones. That’s usually the case with these.
If it does happen on a new server however then the troubleshooting direction for that goes to your exact host OS details / configuration. A common problem we run into is people not running the latest versions of their OS. This means that their Docker version will be old as well. This will frequently show up as DNS issues but it could show up as performance issues as well.
It’s not really an issue for the CPU usage to be high. It’s never going to be low if anyone is online. Even with nobody online it’s like 4-5%. When anyone is online though things are always happening around them. It’s only an issue if you are “feeling” the lag which means something isn’t keeping up and your TPS is dropping. I’d really recommend trying it with a new server (without any mods) and seeing what the CPU usage changes to. Without that we still don’t even know whether this is a hardware or software issue. We’re just guessing at this point.
It doesn’t mean you have to start over. It’s a test. You don’t have to give up on your server forever. You just need to find out if your server is the problem and if it’s not then we’re going to have to dive into your exact configuration. OS, versions, Docker version, everything.
Hopefully those give you some ideas!
Works fine, 3 players 15mb Map, Radxa Rock 3a RK3568 8GB Ram
Linux Armibian Kernel v6.1 on 32GB SD Card
Game starts to stuttering after 45mb Map, on ARM v8.2
I use CasaOS docker container Admin.
Hey hotnikq,
Excellent, I love seeing the Radxa boards being used, 8GB of RAM is very nice as well.
So it’s actually the SD card that is the bottleneck. The issue is basically that it can’t access/write the block changes fast enough over micro SD card so you start to hit bottlenecks around the players / map sizes you’re saying.
If you have a SSD you could connect via USB or anything like that it would likely greatly reduce that bottleneck. That’s a common bottleneck we see on Raspberry Pi as well (the storage). Armbian provides a method to boot from a SSD in armbian-config as well.
Hopefully that helps!
Hi there,
I am very new to Linux/Linux-based servers and i’m not quite sure how to get to a stage where i can send commands to the server via the terminal (Similar to how NUKKIT works). Upon powering up the pi, the server starts automatically, and with any attempt to ‘start’ the server from the terminal results in an error saying that the server is already up. I really do need to see this as i need to OP my character in game in order to teleport about.
Please help
Thanks
Hey TinyBean,
Welcome! So I can definitely help. The command to find your container is:
docker container ls
This should give you a container ID that you can attach to. Now just use:
docker container attach xxxx
Replacing the xxxx with the ID you got from the docker container ls command. This will bring up the server console and let you type commands directly into it.
When you are done you can detach again by pressing Ctrl+A and then Ctrl+D. Hopefully that helps!
Thanks very much man, it works perfectly. I appreciate responding so quickly too!
I’m just wondering however, how would I connect to this server over the internet? I Have port forwarded all the ports for minecraft and yet my friends are unable to connect via my IP.
Any solutions?
Thanks again,
Tiny
Hey TinyBean,
Excellent, I’m glad that got that going! So for port forwarding you would want to do 19132 and 19133 as UDP. The default is TCP so make sure you change them to UDP. It’s okay to have “Both” if that’s an option.
You’ll also want to make sure your Linux distro doesn’t have a firewall installed like ufw or firewalld. If it does it probably needs
sudo ufw allow 19132
or something like that. Hopefully that helps!Hey again,
I’ve tried both and neither made a difference (At least not what I can see). I don’t really know what ip i’m using in the first place really. The server defaults to something like 0.0.0.0 i think.
Also, how do i import a custom world to host?
Thx,
Tiny
Hey TinyBean,
The IP you’d want to give out to other people is your public IP. This is what would show up if you go to icanhazip.com in your browser. The IP address you see there is what they should connect to for your server.
For importing a custom world that is actually a 2 part question. I assume you mean import a world from single player into a dedicated server. You’d start with a guide like this to copy the files. Basically if you go through that guide once you get to step 4 or 5ish it will tell you to start using FTP to copy the files. That’s where you can stop. You just need the files in step 4 and then you’ll copy them to the Docker volume instead.
For the second part of the question once you have the files copied out of your single player folder you would just copy them into the Docker volume. This has been done before successfully for sure. You will need to close the server first with
sudo docker container stop xxxx
.Importing a world will be tough. It’s pretty much the hardest question you could have asked me but there is how to do it! It’s really not that hard but since you haven’t done it before just copying the world out of single player is like 5 steps but the guide will walk you all through it. Once you finish that part follow the GitHub issue I linked to above (after finding your Docker volume contents which is covered in the guide if you haven’t already). It requires you to do almost every operation such as stop the container, do a sudo cp to the Docker volume (which means you will need to have found the files first), then you’ll need to restart the container.
It might seem a little overwhelming which is why I wanted to prepare you a bit first. It’s just a lot of steps is all and touches on all operations just a little. Fortunately we’ve already covered a few such as using docker container ls, and then docker attach so you already have learned a few of these commands. That’s exactly how you’ll find the container ID to do
docker container stop xxxx
as well (docker ls).You’ll be much more comfortable with both Docker and the Minecraft server / files though afterward I’m sure. Hopefully that helps!
I think I have managed the world saving part. I just saved it beside the other world in the _data folder and changed it in the server properties.
For the IP part, I put my public ip into my phone and put the correct port in, the phone doesn’t connect when on mobile data, but does when on the same Wi-Fi as the pi. The pi is wired into my router.
Under the ‘ports’ header in the terminal when i start the server, are the numbers:
0.0.0.0:19133->19132-19133/tcp, 0.0.0.0:19132-19133->19132-19133/udp
I think those 0.0.0.0s are meant to be my IP.
Any ideas?
Thanks again man.
Hey TinyBean,
It’s really hard to say without seeing your network setup. Is this a 4G/5G hotspot? Many ISPs don’t allow port forwarding and block it. If you are in a shared apartment / living situation like school internet or the apartment complexes that share it that will all be blocked typically.
It should actually be the opposite of what you are saying. If you are connecting to your public IP like the one that icanhazip.com gives (which does *not* look like 192.168 or 10.10) and it actually works when on WiFi I would say your ISP is blocking it (or there’s more to your network than we’re seeing like if you have multiple routers). If you truly are connecting to the public IP from icanhazip.com and it only works when on local WiFi then I would say it’s a good bet your ISP blocks port forwarding (extremely common).
Why would I say that this sounds blocked? Because if you are using the right public IP and this is happening it’s because the traffic is *blocked* coming from outside of your network by your ISP. Since your phone on WiFi is on your internal network it’s actually getting through (because it’s not going through the ISPs external blocker). It means all of your rules are actually *right* because when you aren’t going through your external connection (but still using the public IP) your router is smart enough to get it to the right place. That means your forwarding rules must be right but your ISP is externally blocking it still.
If this is any type of 4G/5G/shared/apartment/school connection that is managed by someone it’s blocked and you will need to talk to them to have any chance of getting it unblocked for sure. On some ISPs this just means transferring to a slightly higher plan that allows port forwarding. Other ISPs if you call they’ll work with you to set something up for sure.
The port forwarding rule should be forwarded to the Pi which will be a 192.168 or 10.10. That’s not what other people will connect to though. That one will only work on your local network. The one they will connect to is the one in icanhazip.com.
It’s going to be impossible for me to diagnose this over the internet but I have enough experience to say that it sounds like your ISP is blocking it to me (and that this is probably a 5G or shared internet connection of some kind). It could be any one of the rules though. If your local IP in your forwarding rule is wrong (not UDP or pointing to the wrong device) there’s no way I’d be able to find/see that from here so it’s tough. It sounds like your rules are right to me though and that this is external/ISP blocking.
You may just need to do general network troubleshooting and leave Minecraft aside and see if you can open *any* port to the internet and connect to it. That’s really an issue outside the scope of this container and something that would be really hard to diagnose without me remoting into your network and seeing what is wrong with it (generally the ISPs job for stuff like this)!
After doing a little digging, I’ve found that my ISP does allow port forwarding, I don’t know if it has anything to do with my PI being wired into a node on our mesh. The provider is Virgin Media by the way. I know you can port forward on our Wi-Fi as me and some mates have played half life DM over the internet before. I would send a screenshot of the terminal but I can’t here.
Also to save a lil time do you know how to allocate more ram? Thx
Hey TinyBean,
Not possible in Bedrock. Bedrock doesn’t work like Java and is in C++. Only Java servers need to allocate RAM like that. The C++ version will always take how much it needs/wants. Hopefully that helps!
Hey TinyBean,
Yes, that sounds like you are doing double NAT like I alluded to earlier. You have both a wired router and a wireless router. Both of these give out private IPs. You cannot port forward through two different routers.
Which router is the one that connects to your ISP? That’s the only one you can port forward to and the device will need to be connected to it. You can’t port forward from wired across to wireless. That is called double NAT.
I’d say you don’t have an appropriate network to do this. You could try switching the Pi from wired to wireless and put it on your second network that actually works to port forward. I think that’s your only option!
The pi is connected to the node in my room which is connected directly via cat7 to the main router (Which is connected to the virgin media hub) Is that double nat? And also would hooking the pi up to the main router and using remote desktop to use it work?
Hey TinyBean,
Probably. Are you putting your port forwarding rules into the main router? That is definitely double NAT. The rules would need to be put into the Virgin Media hub. Your Pi would probably also need to be directly connected to the Virgin Media hub.
One way to resolve this is you can set your network to bridge mode. I do not want to cover how to do this on the site and you’ll need to google specific Virgin Media instructions to see if it actually supports bridge mode.
If the Virgin Media hub doesn’t have any ports you can plug into then bridge mode may be your only hope (not supported by all ISPs/devices). In bridge mode you eliminate double NAT.
Look at the instructions to configure this with Virgin Media. They are huge.
Not everyone is set up to host services out of their home. You need the right equipment and a provider that is willing to let you do this. It sounds like there is double NAT going on and that your port forwarding rules are probably in the wrong router.
I can’t help further with this. I’m sorry. You are basically asking me how to set up a network service and that’s not what I’m here for. It’s way too much and you are going to need to work with your ISP to get port forwarding working!
If you need further help with the container let me know but I’m not the ISP shop. Call your ISP and get it working that way for sure as they know all of the details about your connection/equipment. They may even be able to help you do this depending on how nice the support is for Virgin Media!
Perfect, I think my ISP can help from here.
Thanks so much for helping me get this far and referring me.
I really appreciate what you are doing here and I’m sure many other do to.
Thanks again,
Tiny.
Hey TinyBean,
No problem, sorry if that seemed forceful/rude but I promise it was only because I wanted to get you into the right hands for this. They have all the tools they need to assist you safely. You wouldn’t want to let some random blog owner remote into your network and that’s essentially what I’d have to do to take a look at it (plus I would need the router password or you to log into me and all kinds of other things that the ISP has better tools to let them do this without you revealing sensitive information).
If you have any further issues related to the container don’t hesitate to stop by and ask. I’m more than happy to help with the container or even Minecraft server related stuff in general. I was only reluctant because I knew I wasn’t equipped to help with this and that the ISP would be able to help you more effectively.
Enjoy and take care!