Legendary Minecraft Bedrock Container

Minecraft Bedrock Docker Edition
Minecraft Bedrock Docker Edition

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!

157 thoughts on “Legendary Minecraft Bedrock Container”

  1. Avatar for Hugoshido

    Hey,

    let me start with an old big thank you for this beautiful docker version you created!!

    Everything works fine but I ran intp a small issue.
    I´m not able to put any commands into the terminal for the server.

    It only shows me an error over and over again: [2023-04-07 04:44:55] Error: unimplemented option 20094 in curl_easy_setopt

    You think you can help?

    Thank you again for everything!

      1. Avatar for James A. Chambers

        Hey Hugoshido,

        Welcome! So this is an interesting one. I’d think the only explanation could be that you’re running a fairly old operating system. Can you share your:

        cat /etc/os-release

        as well as:

        uname -a?

        What the warning means is that it sounds like your libcurl is too old to have the function curl_easy_setopt.

        This probably won’t do anything negative other than spam your console. It’s a sign that your operating system is very old though. There’s no way it’s a current release. I’ve actually never seen anyone get this warning before so I wonder if this is like a 3.x Linux kernel or something like that.

        It’s probably okay to run it this way if it’s working. I’m surprised it’s able to as usually people with older operating systems will have broken DNS and all sorts of other problems and usually have to upgrade before it works at all.

        I’m wondering if this is going to end up being a (older) Mac or Windows potentially. If you’re running something unusual let me know. If this is Linux though then I’m fairly certain it’s going to be an EOL (end of life) operating system that just needs to be upgraded to the latest version to eliminate this.

        Hopefully that helps!

  2. Avatar for Ronny P

    Hey James! I’ve run this for about a year now on Raspberry Pi 4 with Ubuntu and I absolutely love it! I couldn’t help but notice that there is a bit of lag even after optimizing the world and running with minimal mods but that’s to be expected.

    But after looking into this activity monitor is showing only 1 core at a time being utilized [pinned at 100%] while the 3 other cores are all idling. The core being used changes in a random pattern roughly every 1-2 minutes. As far as I know docker should use all cores available and it does on initial server startup, but this weird single-threaded behavior kicks in soon after. Any ideas?

    FYI: I’ve set server.properties’ max threads to 4 and 0 both but no difference is made.

    1. Avatar for James A. Chambers

      Hey Ronny,

      Welcome, I’m glad you’ve been using it for so long successfully! So the bottleneck on the Raspberry Pi 4 is always storage. If it’s running on a SD card then your CPU is just waiting for the storage to catch up.

      As far as the thread usage the Minecraft server is what is called “single-cored”. This does not mean single threaded. It does use multiple threads. All of the main game logic though runs in a single thread.

      It has been this way forever. Check out this reddit thread here. It’s pretty well known that it’s better to run the server on a dual-core server that has higher single-core speeds than it is on a quad-core server with very low clock speeds (exactly what the Raspberry Pi is).

      In other words there’s nothing you can do about the single-cored nature of the Minecraft Bedrock server. The settings will not impact this as you’ve found out. It’s just the way it’s programmed. The one thing you can do though is speed up the storage by using a SSD. That way your one CPU thread won’t be waiting as long.

      You can try my standalone version here if you want to to confirm that this is just the Minecraft server and not Docker. It has nothing to do with Docker or the container. x86_64 also suffers from exactly the same issue and it always has.

      You could try switching to my Java version of the container using Geyser (which lets all Bedrock players play). You’d have to convert your server using Chunker which I’ve covered here but Paper Minecraft has some optimizations that make it run better on multiple cores. There is no such thing for the Bedrock native dedicated server though.

      Hopefully that helps!

        1. Avatar for James A. Chambers

          Hey Ronny,

          No problem at all! We’ve actually had a lot of success stories of people switching lately here in the comments. Everyone has been happier without exception after converting to the Java server running Geyser + Floodgate. You gain the ability to use plugins, have a lot more performance options available and the Paper Minecraft server is optimized for situations like this. I’d highly recommend it (and just to repeat, Bedrock players can join the server together with Java players, your players will *not* have to switch clients).

          I really think you’d be happy running your Minecraft server through Chunker and trying the Java version with Geyser. It wouldn’t hurt to try. You can just make a second volume and keep your existing Bedrock volume the same. That way you could try it out and if it’s performing a lot better you’d probably permanently make the switch. If not you could switch right back to running the Bedrock native server.

          In other words you lose nothing going to Java + Geyser but you gain a lot. Java players can’t play your existing server. Everyone can play the Java + Geyser server. The whole Paper Minecraft project exists to fix the horrible vanilla Minecraft performance so it’s meant to fix problems exactly like you’re experiencing.

          Best of luck and let me know if I can help further!

          1. Avatar for Ronny P

            Thanks for the options! I’ll make sure to try this but we’ve dug ourselves into a bit of a bedrock hole since most server features utilize allow+deny blocks and we have a fair number of bedrock exclusive mods and heavily use movable tile entities in our Redstone. But it’s worth a try!

            1. Avatar for James A. Chambers

              Hey Ronny,

              I totally understand. That’s why I still maintain this version as I know people are using it that way and it definitely has it’s uses.

              I think it’s mostly worth a try to evaluate the performance (knowing some features you’re using won’t be working yet). If it made a big enough difference all of that stuff (and much more) can be done in Java using plugins. It’s definitely a significant investment to set it all up though (as I’m sure it was for this server).

              Take care!

    1. Avatar for James A. Chambers

      Hey Ray J,

      Yes, that should work theoretically. Minecraft PE used to be what Bedrock was called a long, long time ago. When I originally bought the apps for Android/iOS it was still called that. It has just been renamed:

      Minecraft: Pocket Edition (informally known as MCPE or PE) was the former title of the Bedrock Edition of Minecraft developed by Mojang Studios for mobile devices before 1.2.0, although subsequent builds are still commonly (if erroneously) referred to as Pocket Edition.

      My advice for this would be to just try loading the world normally but make sure you have backups first. If something goes wrong then I would recommend using Chunker. Chunker is a service that is officially sanctioned by Microsoft/Mojang. It’s meant to convert worlds from various editions and it’s good at recognizing very old formats / other formats and letting you convert it to either the current Bedrock or Java.

      In other words it will probably load but if you get some kind of error Chunker should take care of it. Hopefully that helps!

      1. Avatar for Ray J

        First off I’d like to thank you for your quick response, James, it was very helpful. Another question I have is whether or not there is any way that I can disable the backups? My raspberry pi only has 16GB of storage and the backups fill it up quickly.

        1. Avatar for James A. Chambers

          Hey Ray J,

          Thank you so much and great question! So there is an easy way to deal with this using the BackupCount environment variable. The way you would use it is:

          -e BackupCount=1

          I’m not sure what will happen if you set it to 0. It might work but I’d definitely recommend just keeping one in case there’s some kind of bad patch/update that you’d have a chance of getting something back. You could try 0 though and theoretically it shouldn’t keep anything.

          Hopefully that helps!

          1. Avatar for Ray J

            It worked perfectly, although I have one more question. Even when I type stop while the server is running and I close the terminal, I can still see and join the Minecraft server with no issues. When I reboot my raspberry pi the server doesn’t show up anymore, but I can no longer use the same port.

            1. Avatar for James A. Chambers

              Hey Ray J,

              Just type:

              docker container ls

              You’ll see the containers running. You can then attach with:

              docker attach xxxx

              If you are running with the instructions it will restart itself. You just need to pull up the console. Hopefully that helps!

          2. Avatar for Ray J

            The server is now up and running perfectly, I am very thankful for someone like you dedicating time and effort to making these projects and helping others out! I just have one quick question, if I were to connect an external drive to my raspberry pi, how could I make the backups go to that drive? Thanks so much and I really, really appreciate it.

            1. Avatar for James A. Chambers

              Hey Ray J,

              No problem at all! So this is just a simple file copy task. I’d just use crontab to do it. You can use crontab-generator if you want something to help you generate this. I would just do:

              sudo crontab -e

              And then paste in this line:

              0 0 * * * cp -r /var/lib/docker/volumes/yourvolumename/_data/backups /your/ssd >/dev/null 2>&1

              This crontab will copy all of the backups once per day at midnight basically. You could use the generator though to change it however you’d like as well.

              Obviously you’d want to fix your paths as I used placeholders in the above example. There’s a ton of other ways you could do it too. People have a lot of preferences for how they want to do automated copying/moving of files. You could do a startup script in /etc/rc.local as well.

              Hopefully that helps!

  3. Avatar for Michael

    Helllo, great job! It works with a Rasberry Pi4. At the first start I could see the server in the friends-tab in minecraft. But now I habe to add another server to play. Is it possible to show the server again in the friends-tab as a lan?
    Thx and Best regards

    1. Avatar for James A. Chambers

      Hey Michael,

      The ping port (the one that shows all of the players online) is notoriously buggy. I think to get that working you’d need to not use the default ports on any server (19132 or 19133).

      You can have as many servers as you want. It doesn’t matter. You’ll have to choose different ports for each one though. Hopefully that helps!

      1. Avatar for Michael

        Thanks for the help. I’ll try it. I would like to have multiple worlds on the server and have tried a plugin called “Multiverse Core”. This is a jar file. Is this suitable for the server, or is it a plugin for the Java version. I created a “plugins” folder, uploaded the files, but it doesn’t know the console commands.
        Another plugin would be Multiworld. This is a phar file. Would this plugin be suitable for the server?

        1. Avatar for James A. Chambers

          Hey Michael,

          There basically are no plugins/add-ons for Bedrock. Those are only for Java. The .phar files are for a special fork of Bedrock called PocketMine and are not for vanilla.

          I basically never recommend running a Bedrock server to be honest. Just run my Java version with Geyser installed. All Bedrock players can play on that server and you can have plugins.

          If you want to do anything outside of run a vanilla Bedrock server you should run a Java server with Geyser installed instead. Even then you should run a Java server with Geyser installed instead. I say this pretty much every comment thread in this post and I’m saying it again here. This is why. You basically can’t do anything with Bedrock. You can do everything with the Java version *and* Bedrock players and Java players can play together. It’s a no-brainer.

          If you want to convert your existing server from Bedrock to Java I’ve covered how to do this in this article.

          The Bedrock server is basically terrible because it can’t be modified and Microsoft/Mojang don’t care about it very much because they would like for you to buy a Realms subscription. They have no motivation to improve the Bedrock server and make it not be an absolutely miserable experience to run. That’s why it basically hasn’t changed since it has been released.

          Why would they improve their server offering to make it a more attractive alternative to buying a paid Realms subscription from them? They make so much money from that. The answer is they wouldn’t and they never have. Not since it was released has it got a single additional feature (or even a planned feature) to allow anything like this. Even if the developers asked to improve it they’re going to be told “why would we make it easier/better to self-host and shoot ourselves in the foot with our Realms subscriptions”? They would then be told to go work on the new Sniffer monster or something like that.

          The Java server predates that mentality (as well as the paid Realms servers altogether) and there’s no taking it away now. Again, this does *not* require people to use Java client if you use my container that has Geyser preinstalled. They can keep playing with their same client. All of the people developing tools understand this which is why they’re *all* for Java and not for Bedrock.

          There’s just no reason to deal with the Bedrock server. There hasn’t been since Geyser was released opening up the Java servers to Bedrock players.

          Hopefully that helps!

          1. Avatar for Michael

            Hello, thank you again for the great support. I deleted the first container, now I have the one with Geyser and. Floodgate and am very happy. Next I will deal with the server.properties file. In Bedrock I can create a world with a bonus chest. In java I need to start the server with the —bonusChest argument. Is it also possible with a container to start with this argument?

            1. Avatar for James A. Chambers

              Hey Michael,

              Fantastic, I’m so glad to hear that you completed the migration! So the way I would do this is to just spawn one with commands. First op yourself with:

              op yourplayername

              You do this from the server console. After that you can use admin commands in-game. The following command will spawn a (legit) bonus chest nearby:

              /place feature minecraft:bonus_chest ~ ~ ~

              Now look around and within about 10-15 blocks of you you should see the bonus chest with the 4 torches around it. This is going to be easier than all of the other solutions for sure and uses the natural bonus chest spawn loot tables (meaning it will be exactly the same as if you had used the –bonusChest argument).

              The –bonusChest argument only works when the server is first generated so it won’t do anything unless it’s a brand new server. The above command will work no matter what though (you can even use it multiple times if you wanted to).

              Hopefully that helps!

              1. Avatar for Michael

                Hey James,
                everything is working fine. Thatś really brilliant tonwork with containers. I learn a lot every day – i.e. The command op: server-console in a container to start. Does the container update the server, if a new version is coming out for the game, or do I have to update it manually. I can create a new container with a special version of server. Does the server change the version?
                Best regards

              2. Avatar for James A. Chambers

                Hey Michael,

                Great question! In the Java version you select the version. You can absolutely choose a special version with -e Version=1.19.4 for example. As long as the version exists on the Paper Minecraft servers you can choose it.

                In this version though you can’t. You can’t select the version in Bedrock. You might want to ask Java questions in that thread instead of here from now on. It’s going to confuse people.

                Hopefully that helps!

  4. Avatar for Marcel

    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 ?

    1. Avatar for James A. Chambers

      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!

      1. Avatar for Marcel

        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.

        1. Avatar for James A. Chambers

          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!

              1. Avatar for James A. Chambers

                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!

  5. Avatar for hotnikq

    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.

    1. Avatar for James A. Chambers

      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!

  6. Avatar for TinyBean

    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

    1. Avatar for James A. Chambers

      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!

      1. Avatar for TinyBean

        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

        1. Avatar for James A. Chambers

          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!

          1. Avatar for TinyBean

            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

            1. Avatar for James A. Chambers

              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!

              1. Avatar for TinyBean

                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.

              2. Avatar for James A. Chambers

                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)!

              3. Avatar for TinyBean

                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.

              4. Avatar for James A. Chambers

                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!

              5. Avatar for James A. Chambers

                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!

              6. Avatar for TinyBean

                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?

              7. Avatar for James A. Chambers

                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!

              8. Avatar for TinyBean

                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.

              9. Avatar for James A. Chambers

                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!

Leave a Comment

Your email address will not be published. Required fields are marked *

Type here..

Exit mobile version