Minecraft Bedrock Edition – Ubuntu Dedicated Server Guide

Minecraft Bedrock Edition Logo
Minecraft: Bedrock Edition Logo

Minecraft Bedrock Edition is the version of Minecraft that powers the iPhone / Android versions (formerly Minecraft Pocket Edition), the Xbox / PlayStation / Nintendo Switch editions and the free Windows 10 Minecraft edition.

Mojang has released a dedicated server which is considered to be in alpha testing.  I have found it to be very stable and able to run on a wide variety of hardware.

This script and guide are written to help you get a robust Minecraft Bedrock dedicated server up and running in only a few minutes!

This is the standalone version. The easiest and most problem-free way to run this is using Docker (installed as simply as sudo apt install docker.io): Legendary Minecraft Bedrock Container

I’ve also released a way for Java and Bedrock players to play on the same server using Geyser: Minecraft Java + Bedrock Server Together – Geyser + Floodgate

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
  • Ubuntu / Debian distributions supported
  • Sets up Minecraft as a system service with option to autostart at boot
  • Automatic backups when 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
  • Easy control of server with start.sh, stop.sh and restart.sh scripts
  • Adds logging with timestamps to “logs” directory
  • Optional scheduled daily restart of server using cron

Requirements

  • A computer with a 64 bit processor (if you are trying to use ARM read my article on the limitations). 32 bit binaries of the official server are not available so it needs to be 64 bit!
  • 1 GB of RAM or higher
  • The only officially supported platform by Microsoft is Ubuntu 22.04 / 20.04 (current LTS, recommended)
  • Other Linux flavors supported by this script as well as long as they use systemd (for the service). The script assumes apt is installed but there are minimal dependencies so you could install these on another distro (that doesn’t have apt present) and use the script normally.

Recommended Gear

Game Editions

Minecraft: Bedrock Edition is the “Windows 10” version of Minecraft as well as the version of Minecraft on the Xbox / Playstation / Switch. The versions of Minecraft for Android and iOS are also the Bedrock edition.

All of these versions support cross-platform play with each other (but not with the Java edition).

Minecraft Bedrock Digital Code
Minecraft Bedrock Digital Code

This is the PC Minecraft for Windows 10 (Bedrock) edition of Minecraft. It is able to play cross-platform with other players on Android / iOS / Playstation / Xbox / Switch. Available as a code that is instantly activated to give you permanent access to the game!

Links: Amazon.com*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*

Minecraft Bedrock Playstation
Minecraft Bedrock Playstation

The Sony PlayStation version of Minecraft: Bedrock edition.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.se*, Amazon.sg*

Minecraft Bedrock Nintendo Switch
Minecraft Bedrock Nintendo Switch

This is the Nintendo Switch version of Minecraft: Bedrock edition.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

Minecraft Bedrock Xbox One
Minecraft Bedrock Xbox One

This is the Microsoft Xbox version of Minecraft: Bedrock edition.

Links: Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.sg*

Recommended Storage (Solid State Drive)

I strongly recommend a Solid State drive (SSD) for your server. This is because Minecraft is constantly reading/storing chunks to the disk which makes I/O performance very important.

These are much cheaper than they used to be. Here’s a decent 120 GB one (higher capacity options are available) at a very low price:

Kingston A400 SSD
Kingston A400 2.5″ SATA SSD

The Kingston A400 is reliable, widely available around the world, has low power requirements and performs very well. It’s also very affordable. This drive has been benchmarked over 1000 times at Pi Benchmarks and is the #1 most popular SSD among the community!

Links: AliExpress*, Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

If you have a M.2 NVME slot in your motherboard you can go with a high end drive. This will give your server maximum performance even if a large number of players are running around on the server changing blocks and triggering disk writes.

This is the one I have in my machine. These range from 250 GB to 2 TB depending on how big your server might grow:

The Samsung 980 Pro (NVMe) is a professional grade SSD and one of the fastest in the world. The Samsung NVMe drives have been at the top of this category for a long time and are well trusted for both their performance and reliability / long life.

Links: AliExpress*, Amazon.com*, Amazon.ca*, Amazon.com.au*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.se*, Amazon.sg*

Computer / CPU / Memory

Almost any PC made in the last few years will be a x86_64 bit computer. If you have an older computer around that isn’t being used then it will most likely have the right CPU and amount of memory (as well as fast storage) to run a basic server.

Throwing a SSD in one of these older computers will provide an excellent server experience for small and larger player counts.

The speed of your storage will make the largest difference. Older HDDs are going to have significantly slower performance than any modern SSD even with all other hardware equal. This is because the Minecraft server is constantly reading/writing chunks of your world as well as updates to it to the disk so this tends to be the bottleneck.

Operating System

I highly recommend using Ubuntu Server to run the Minecraft dedicated server. It is available here.

At the time of writing the current version is Ubuntu Server 20.04. This is a secure and robust operating system and will leave plenty of resources available for the server to run.

The script should run on any Debian based flavor of Linux but since the Minecraft Bedrock server is compiled natively for Ubuntu I recommend sticking with it. If you have a GUI flavor of Ubuntu and a decent PC (>= 2 GB of RAM) the server will work just fine on it.

Note: People have reported in the comments that Ubuntu 16.x is no longer working with the latest official Mojang binaries. Ubuntu 18.04 is the minimum requirement for the latest versions, and 20.04 is recommended!

Installation

Log into your Linux server either using SSH or a mouse and keyboard and paste/type the following command:

curl https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh | bash

The script will setup the Minecraft sever and ask you some questions on how to configure it. I’ll explain here what they mean.

The first question will be the installation path. This is the root installation path for ALL servers you will have. If you add additional servers later you should select the exact same installation path. It should always be left as the default (~).

The only exception is if you have something like a completely dedicated disk for the Minecraft server. In that case you should always use the same root path of /mnt/yourdrive or wherever the path is for every new/additional server you install.

“Start Minecraft server at startup automatically (y/n)?” – This will set the Minecraft service to start automatically when your server boots. This is a great option to set up a Minecraft server that is always available.

“Automatically restart and backup server at 4am daily (y/n)?” – This will add a cron job to the server that reboots the server every day at 4am. This is great because every time the server restarts it backs up the server and updates to the latest version. See the “Scheduled Daily Reboots” section below for information on how to customize the time or remove the reboot.

That is it for the setup script. The server will finish configuring and start!

First Run

The server will start up and start displaying output to the console.

[2019-03-30 20:25:12 INFO] Starting Server
[2019-03-30 20:25:12 INFO] Version 1.10.0.7
[2019-03-30 20:25:12 INFO] Level Name: Bedrock level
[2019-03-30 20:25:12 INFO] Game mode: 0 Survival
[2019-03-30 20:25:12 INFO] Difficulty: 1 EASY
[2019-03-30 20:25:20 INFO] IPv4 supported, port: 19132
[2019-03-30 20:25:20 INFO] IPv6 supported, port: 19133
[2019-03-30 20:25:23 INFO] Server started.

Once you see the “Server started” line you will be able to connect from the client.

To add the server to the client open Minecraft and click “Play”. Then at the top of the screen select the “Servers” tab and click “Add Server”.

This will ask you for a Server Name and Server IP Address. For the name you can put anything and for the server IP address put the address of your Linux server. Leave the port as the default 19132. For more information on how to let people from outside your network on go to the “Port Forwarding” section below.

Now choose the server you just added in the list and connect!

Start, Stop and Restart Server

The server can be started, stopped and restarted two different ways. You can use the provided scripts in the Minecraft folder or you can use systemctl. Here are the commands:

cd ~/minecraftbe
./start.sh
./stop.sh
./restart.sh

-OR-

sudo systemctl start minecraftbe
sudo systemctl stop minecraftbe
sudo systemctl restart minecraftbe

Automatic Backups

The server backs up each time it starts. This helps you recover easily if something goes wrong. This system works best if you configured the server to restart daily since it means you will have a backup every day.

To access these backups type:

cd ~/minecraftbe/backups
ls

When a backup is made the filename will be the date and time the backup was taken. If you need to restore a backup it’s very easy. Substitute the timestamp in my example to the backup you want to roll back to. Type:

cd ~/minecraftbe
./stop.sh
rm -rf worlds
tar -xf backups/2019.02.15.22.06.30.tar.gz
./start.sh

Your world has now been restored! It’s a good idea to download these backups off the server periodically just in case the server’s storage fails.

Installing Resource Packs / RTX Support

For instructions on how to install resource packs (including optional RTX support) view my step by step Minecraft Bedrock Dedicated Server Resource Packs guide here.

Scheduled Daily Reboots

The daily reboots are scheduled using cron. It’s very easy to customize the time your server restarts.

To change the time that the server restarts type: crontab -e

This will open a window that will ask you to select a text editor (I find nano to be the easiest) and will show the cronjobs scheduled on the server. The Minecraft one will look like the following:

0 4 * * * /home/ubuntu/minecraftbe/restart.sh
Crontab's syntax layout
Crontab’s syntax layout

There are 5 fields here. The default restart time is set to reboot at 0 minutes of the 4th hour of the day (4 AM). The other 3 fields are left as * to represent every day of every month. Make any desired changes here and press Ctrl+X to exit nano and update the cronjob.

To remove the daily reboot simply delete the line and save.

Reconfigure / Update Scripts

The scripts can always be reconfigured and updated by downloading the latest SetupMinecraft.sh and running the installer again. It will update all of the scripts in the Minecraft directory and reinstall the startup service for you.

Running SetupMinecraft.sh again will also give you a chance to reconfigure options such as the memory dedicated to the server, daily reboots, starting the server on boot, etc.

This will not overwrite your world or any other data so it is safe to run!

Port Forwarding

If everyone on your server is on the same LAN or WiFi network as you then you don’t need to do this. If you want people to connect from outside your local network then you need to set up port forwarding on your router.

The process for this is different for every router so the best thing to do is just look at your router and find the model # and put that in google with port forwarding for easy instructions on how to do it for your specific router.

You want to forward port 19132. The type of connection is both TCP and UDP. On some routers you need to do both a TCP entry and then a second entry as UDP.

Once you do this people will be able to connect to your Minecraft server through your public IP address. This is different than your local IP which is usually a 192.x.x.x or 10.x.x.x. If you don’t know what that is just go to google and type “what’s my ip” and Google will kindly tell you!

Version Override

You can revert to a previous version with the revert.sh script included in your directory like this:

james@jamesgigabyte-linux:~/minecraftbe/james$ ./revert.sh
Set previous version in version_pin.txt: bedrock-server-1.19.10.20.zip

If you have a specific version you would like to run you can also create version_pin.txt yourself like this:

echo "bedrock-server-1.18.33.02.zip" > version_pin.txt

The version hold can be removed by deleting version_pin.txt. This will allow it to update to the latest version again!

Wired vs. Wireless

Going with an ethernet (wired) connection is going to be faster and more reliable. There’s so much wireless traffic and other interference in the air that running your server on WiFi is not recommended.

Even if it is working great 99% of the time it can ruin your experience very quickly if the WiFi drops for a couple of seconds and you get blown up by a creeper!

All that being said, the server works fine on wireless. The script will work fine as is with a wireless connection.

Benchmarking / Testing Storage

If you’re getting poor performance you may want to run my storage benchmark with:

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

PC results won’t show up on the site yet (it’s meant for Raspberry Pi) but it will run on Linux just fine and give you a score. If you search for the model of your drive on Pi Benchmarks you can compare your score with others and make sure the drive is performing correctly!

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.

Conclusion

The Minecraft Bedrock Edition dedicated server runs much better than previous third party servers in the past that were missing critical features. The performance is very good even on low end hardware. It has never been easier to set up a Minecraft Bedrock server.

If you have any feedback or suggestions let me know in the comment section. A lot of the changes and developments in this script and guide are directly from readers.

Have fun!

Other Resources

For a guide on how to set up resource packs check out my Minecraft Bedrock Resource Pack guide

If you’re trying to run this on the Raspberry Pi check out the Raspberry Pi specific guide here

1,529 thoughts on “Minecraft Bedrock Edition – Ubuntu Dedicated Server Guide”

  1. Avatar for Sebastien

    Hi James, so I had an unusual error message when starting (1st run) my server.
    [2021-08-15 09:48:48] [2021-08-15 09:48:48 ERROR] Unknown authority mode true, expected one of [ 'client-auth', 'server-auth', 'server-auth-with-rewind' ]
    That’s odd enough. I basically just ran the curl command you posted, then rand screen-r, and now 1st run I get this. I’m not familiar enough with linux to understand where I must go from there, or if this will affect anything.

    1. Avatar for James A. Chambers

      Hey Sabastien,

      It sounds like server.properties has things in it it should not. That error message is saying something is sent to “true” instead of “client-auth, server-auth-with-rewind”.

      Are you trying to do something like run a Java server using the Bedrock server or something like that? I know you said this was your first run but these are not the defaults to server.properties so something must be coming from somewhere here.

      Maybe delete the folder completely and try from scratch as something is in there that shouldn’t be!

      1. Avatar for Sebastien

        Looks like I was able to get it running. You were right, there must have been something in there not right… but as it turns out, I didn’t change a thing to your install.
        HOWEVER I did have a previous install on there of the alpha direct from the Mojang site, and that was months ago… which I’d totally forgotten about. It was Bedrock, but it must’ve left behind something it didn’t need.
        That said, all worked on the second try. Must’ve gotten overwritten!

  2. Avatar for Rhod

    Greetings James, thank you very much for this great guide.
    I was wondering if it is possible to add plugins, since my daughters have like 3 worlds, one in which I play with them and another in which they play with their cousins.

    If it is not possible to add “plugins” I would like to know if it is possible to add a kind of “teleportation”.
    A few years ago I was able to configure a minecraft server in Ubuntu 14.02 and the initial world was a kind of “welcome room” and I could choose different worlds, you just had to put a sign with a command with the name of the world required to teleport, I have I wanted to do this with servers like “Pocket-Mine” but they are very outdated, they do not have many features and it is a bad gaming experience, because it is incomplete, and when trying to load the worlds that I have created it does not recognize them.

    I would like to know if there is any solution to this problem, because I would like to leave everything configured without having to edit “server.properties” to choose which world to load and restart the server, I want my daughters to just enter and directly choose which world to play.

    I reiterate my gratitude for this guide and in advance thank you very much for your support.

    1. Avatar for James A. Chambers

      Hey Rhod,

      This kind of stuff doesn’t really exist for Minecraft Bedrock in the same way as Java. It certainly could though. The Java version doesn’t really support plugins either officially and never has.

      Bukkit / Spigot / Paper (which dominates the server hosting scene, especially for larger servers) are totally unofficial projects. They add support into the server that doesn’t exist. Microsoft/Mojang never did this for anyone and I don’t expect them to do it for Bedrock.

      Basically unless someone makes this it will remain totally possible but nobody has done it before. The people who seem capable of doing it seem to be trying to write their own servers. As you pointed out, these projects are awful. They always have been too. Even when I originally wrote the guide years ago these versions were woefully incomplete, missing most features and probably a good 5-6 MAJOR revisions behind the main Bedrock dedicated server.

      The closest thing I’ve seen is people using paid mods from the store. It’s difficult, but you can extract these “.mcworld” files and actually use some mods on the Bedrock dedicated server but most of these cost money and have to be purchased for *each* game client because the DRM is insane.

      It’s super, super tricky for sure but people have got the “Skyblock challenge” map where you start on a floating island in the sky. As far as picking the server when you enter the server though I’ve only seen very much of that on Java. If you wanted to do this stuff on Java it would be extremely trivial.

      I wish I had better news. Basically the answer is that this stuff doesn’t exist for Bedrock because nobody ever made it. The people capable of making it seemed to want to run a crappy homebrew project that is so far behind most things won’t work unfortunately. It has been like this for years now.

      It still remains one of the most requested features.
      My current information matches this too which is that everyone, literally everyone should use the Bedrock Dedicated Server *unless* they need plugin support.

      Sorry I don’t have better news on this front. Surprisingly there just still is no such thing as doing this on Bedrock without using one of the incomplete modded versions. Very sorry about that, and hope it changes eventually here and that someone makes a “Paper” for Bedrock or something like that!

      1. Avatar for Rhod

        Hello James.
        I appreciate your quick response and so meticulously provided.
        I understand what you are saying, I come to confirm what I was afraid of, since I had not been able to find any solution on the web.
        I thought that if anyone could solve it or have an answer to this, it is you.
        I reiterate my huge thanks for your answer, I will continue using your script, I hope you continue to support us and above all you continue to be patient with us.

        Greetings from Mexico.

        1. Avatar for James A. Chambers

          Hey Rhod,

          No problem at all! I always hate to give out bad news for sure and I especially hate it when I don’t have any answer and that’s not exactly true. I do have *some* answers potentially, they just aren’t as high of quality and definitive answers as I usually try to give. Since you have scoured the internet and there’s very little out there (my experience as well) your words have inspired me to write down everything I know about mods on Bedrock as it looks like there is some new (limited) activity happening in this area.

          First let’s start with the easy stuff. Resource packs. These are linked to in the main guide (and I have a guide on setting up resource packs here). What I don’t talk about as much in there though is that there are also paid resource packs in the market place that have “mod-like” effects like adding new things into the game. This is not the same as being able to join a world portal like you asked about, but you can make significant modifications to how the game looks and even the game rules with these mods. There’s some overlap between paid marketplace “resource packs” and “addons” but I’ll cover add-ons in a moment here.

          The reason I didn’t bring this up at first is because my encounters with the marketplace resource packs (usually the cool ones that do more than just reskin the base tiles) are that they’re pretty expensive. You also have to buy a copy. For each player. You also have to extract a copy of it from one of people’s client’s that purchased the pack (although other players will still need to also own a copy of the same pack to play) so it’s honestly a pretty terrible deal. The marketplace isn’t the only place to get these packs though and that is where this still may help. You can see the marketplace and a lot of the mods here.

          I actually have seen something even fancier though. Observe this project: BDSAddonInstaller. This looks like it was updated about 5 months ago so it doesn’t seem inactive. It loads both resources packs and “addons” to Bedrock. This is what I would recommend trying.

          Here’s some legit real full blown addons here: mcpedl.com. If you click on the mods a lot of them are saying they are compatible with the 1.17 branch which is the currentish version for Bedrock (it is 1.17.1 for Java, for Bedrock it’s like 1.17.200 or something weird like that right now but it’s the 1.17 series). This is the most promising thing I know of and it’s on my list of things to try.

          Someone even made a Bedrock mod to add a jar of mayonnaise into the game apparently: manoyeise-addon. This is certainly something.

          This was apparently the guy’s first mod he has ever made and he literally made it yesterday so frankly I give him props even though it was a curious choice. August 8th 2021.

          Hopefully that is a more satisfying answer as it looks like you have scoured the internet quite a bit looking for information on this. It looks like there really are a lot of addons available now on mcpedl. Most of these are going to be client mods so it’s hard to say how compatible they will be with a dedicated server. I imagine some of these will work just fine in multiplayer but I doubt the jar of mayo one would work on a dedicated server as it will have no idea what that item type is.

          Maybe the GitHub tool I linked to earlier could successfully still integrate one of these addons into the BDS. These won’t be as powerful as maybe you are looking for but it’s *much* better than nothing and some of these look pretty interesting. Definitely still no perfect answer but that’s everything even *close* to modding that I know of.

          Hopefully that helps more than the last one!

  3. Avatar for Brian

    Hey James,

    When I set this up, it updated my su password, previously I had none, and now I cannot use su without a password. Any ideas here?

    Thanks,
    Brian

    1. Avatar for James A. Chambers

      Hey Brian,

      That’s very odd. Those passwd prompts are not supposed to be able to be fed automatic input very easily and the script doesn’t attempt to ever set any passwords. You will not find a ‘passwd’ command or anything to do with passwords anywhere in the script. The script should not be able to do this as it never runs a “passwd” command or attempts to mess with the accounts.

      Not to worry, it’s an easy fix! Just do a:

      sudo passwd

      or

      sudo passwd root

      to set the root / sudo / superuser account’s password! If you want to remove it altogether then once you su after changing the password you can use:

      passwd -d root

      and that should remove this! It’s really the only way to set / unset the password so I’m puzzled to how the script could have anything to do with this (no new accounts are ever created, no passwords are ever set of any kind) but that should get it for you! You may even be able to get around it with just a:

      sudo su and then using passwd.

      Hopefully it’s not a sign of other trouble. If you’re positive you didn’t accidentally maybe run a passwd as sudo at some point and it just magically got a password out of nowhere that would point to a corrupt partition / failing disk like a few other high profile recent examples lately (both here and on the GitHub issues page)! I can assure you though the script is not capable of doing this and so if impossible things are happening it’s not capable of doing then you’re probably a week or two away from a reimage / reinstall here if luck is not on your side here and history is any indication!

      Maybe it’s related to the sudoers file? You can try removing it with:

      sudo rm /etc/sudoers.d/minecraftbe

      Some functions like the automatic restarts will break without the passwordless sudo command but setting passwords is not within scope of this script in any way. If this fixes it (worth a try) then I wonder why your system isn’t allowing passwordless sudo and how it would explain it suddenly having a sudo password. Who typed the password / then typed the confirmation again / or where did it come from? What could it possibly be that would have matched the password input challenge twice to perform a successful change?

      A sudoless password like this file enables is literally the opposite of this. The sudoers file is meant to allow it to sudo without having to put the password in (with extreme restrictions down to the commands and parameters for those commands, nothing else is allowed) basically so this is not making a lot of sense here but is worth a try. Running SetupMinecraft.sh again will replace this file. Definitely try those and let us know!

      P.S.: I should also mention this could be a security breach. If the root account just got a random password out of nowhere and you’re positive you’ve never ran a sudo passwd or maybe ran passwd while you were using su without realizing it then you may have literally got hacked.

      This happens all the time, especially if you’re not keeping up on your updates (sudo apt update && sudo apt dist-upgrade -y) or are running outdated insecure web stuff, etc. because automated bots scan for this stuff 24/7/365.25 and will hit any forwarded ports / public IP basically constantly! Forwarding *all* ports on your router to your server also greatly increases the chances of this happening and you should only forward very specific ports like the exact Minecraft ones you’re using and nothing else (no wildcards, no ranges).

      Web ports 80/443 are especially dangerous because your apache/nginx/etc. is often running things from installed packages you aren’t aware of that may not be getting updated and may be exposed if you aren’t extremely careful. Think the /var/www folder is empty so it’s fine? sudo apache2ctl -S will reveal any dark secrets. sudo nginx -T for nginx.

      The way you described your former security setup sounds very concerning. You *never* had to put in a password when using sudo before? The consequence of that is that literally the tiniest breach, of any service or user or anything that has sudo rights, would be able to do *anything* to your system. Was root allowed to log into SSH without a password? Did you configure /etc/ssh/sshd_config to not allow root login at all / without a password? How about every other exposed service? Even background only CLI ones often have remote login interfaces that can exploit this. Was port 22 forwarded from your router to the server?

      You do not want to have a setup like this for sure. If you have certain commands that you need sudo to work with without entering a password you can follow my lead and use the /etc/sudoers.d/minecraftbe file and just put the exact commands you will be using in there like I did and that would be infinitely safer.

      If you’re getting unusual denials trying the stuff I said then it is likely you are actively being locked out and should probably yank the networking at the very least if anything at all unusual seems to be going on.

      1. Avatar for Brian

        Hey James,

        I was able to reset the root password using the sudo passwd root command so thank you. I had root access directly before running the curl to install the packages, it wasn’t until directly after that I had this issue. After looking at my flow logs there are no other connections besides mine so I do not believe it was a hack.

        The instance I have is a bare bones Ubuntu 18.04.5 AWS Lightsail instance (only minecraft beckrock server installed) and my security group is configured to only allows SSH via port 22 to my specific IP address (and my keys are locked away), or if I am logged into the console I can SSH via the browser. All other ports besides 80, 19132, and 19133 are blocked.

        Thanks for your help,
        Brian

        1. Avatar for James A. Chambers

          Hey Brian,

          Perfect, that sounds much more promising! It shouldn’t let you run it as root at all but theoretically if you did your /etc/sudoers.d/minecraftbe file would show as the username “root” and so would all the other files. That is also who would own the permissions on everything (root).

          From your additional information I wonder if something like this was still able to work even with the root check in SetupMinecraft. It certainly would explain things.

          This is the first time I’ve seen it but I’ll be keeping an eye out for this issue just in case. Thanks Brian and take care!

          1. Avatar for Brian

            Hey James,

            I think I was in root when I tried to run it, but the script made me exit out back to user.

            I had the server up and running, but needed to upgrade to 1.17.100 for some of my users to connect via nintendo switch (wouldn’t let them connect because the switch client was updated and the server wasn’t). Most tutorials out there for upgrading your server are based off of you using a hosted server, whereas mine is just bare bones ubuntu so there wasn’t much to go on. In the future as mojang comes out with updated server versions, is there an easier way to install it?

            Thanks again,
            Brian

  4. Avatar for Lennard

    Hey James,

    I never had a server before and your guide really helped me, thank you!
    I was wondering, how can I upload an already existing world on the server?

    Sincerely,
    Lennard

    1. Avatar for James A. Chambers

      Hey Lennard,

      Great question! If this is a single player world the world folders are available at:

      %LocalAppData%\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang\minecraftWorlds

      I created a new world and in that folder I have a folder called “Zh0MYY87AAA=”. Inside that folder you will see the same type of files that the dedicated server uses such as level.dat. These are your world files.

      These files (as well as the “db” folder) can go inside your dedicated server’s “worlds\’Bedrock Level'” folder. The only trick is that all the “names” have to match. In server.properties you would need to change level-name= to what you used for the name of the single player world. The name of the folder would also need to match the single player world. This part can be tricky. There’s some more information on how to do this here. Check that reddit thread as people talk about which folders need to be named what and which ones to change (there’s a lot of small details to remember).

      It’s still the exact same method today!

  5. Avatar for Derek

    Hi James, so we started over. The game kept crashing even with fixing the permissions and doing an overlay install. So I renamed the minecraftbe folder and ran Setupminecraft.sh again but this time I named the server something different. Now my son could log in and play without it crashing. But when I moved the worlds folder from backup (and ran fixpermissions.sh) to the new install location, it crashed again. So something is definitely wrong with the worlds folder. I don’t know if there is any way to finesse the restoring of the worlds folder so he may have to start the world from scratch.

    1. Avatar for James A. Chambers

      Hey Derek,

      It depends on what crashes you are getting. What do the logs in the “logs” folder say is crashing it exactly? Usually if you punch those error messages into Google you will get a pretty good hint of what might be doing it for sure.

      Sometimes it can be specific things in the world like a certain corrupt NPC / player item / etc. but we won’t really be able to tell until we take a look at the exact crashes for sure. Can you post some of your log files of these crashes?

      Usually restoring from older backups is the way to go (from before the problem started) but if progress has been made since then that would obviously be lost so it may not be worth it from that point of view. Let’s see what the logs look like first here!

      1. Avatar for Derek

        Well it’s the same crash error as before (the various log files have the same crash):

        Minecraft Bedrock Crash

        I didn’t have much luck with googling it.
        Thanks again for checking!

        1. Avatar for James A. Chambers

          Actually I have seen this before. Very recently.

          Your root partition is corrupted somehow. You’re losing curl permissions while the server is running just like this individual did. Only a corrupt disk/partition has ever done that. Specifically the file that contains the curl.so library is actually the file “bedrock_server”. That message means that bedrock_server executable itself is losing +x permissions *while* it is running even though you wouldn’t have been able to start the server if it didn’t have +x permissions when you ran it. This is not possible and has always been a corrupt partition / bad install / failing drive.

          I had to prove it to them over 20 messages. They sent me smart reports and all this stuff but when I asked for his mount command he was never heard from again (because it had to have been on the wrong disk in that case, likely a known failed disk it wasn’t supposed to be using/installed on).

          You may be able to fix it with a normal fsck but honestly everyone who has tried to fix a server that is this broken/corrupted has ended up wasting days/weeks of time and then reinstalling anyway. Then they never had problems again (and the other stuff they were doing on the server worked better like this guy).

          I’ll give you the same word of caution that I gave the last person on this one: your server is having issues way beyond anything to do with this script. It has at best a corrupt partition table and at worst a completely failed HDD/SSD that will need replacement. I would strongly recommend reinstalling your OS on this one.

          All the troubleshooting is going to lead you to this exact place so I’m trying to tell people earlier that getting this is a DEFCON maximum emergency. There’s nothing you can find that would cause the bedrock_server executable to start with +x permissions and then lose it that will be an easy fix. For this to even happen things are very, very messed up here at the disk/hardware level. Things are magically losing +x permissions which is a serious failure and not possible on a system functioning normally!

          Restoring from a backup should be fine after reinstalling. This is a failure beyond the server files and actually has nothing to do with your “world” folder. The bedrock_server binary is a generic file that is the same for every server and it is losing +x permissions while running. This does not point to the world at all for sure and libcurl is a static dependency literally built into the server itself (which is how I know it’s bedrock_server losing permissions, it’s a statically built binary that has it all in there already which is why it’s a very large file).

          All of the changes of behavior, just like the example I linked to at the top, are because of specific areas of the disk you are writing to that are triggering those. With a corrupt partition table a file pointer may point to both the permissions for bedrock_server and then part of your Minecraft map for example because things are scrambled. None of this is possible on normal functioning hardware so the server/world files are irrelevant here in this case because we can’t even maintain permissions on the files in the current state so all bets are off on everything else and it ends up crashing eventually. Strongly recommend a reimage here!

  6. Avatar for Baklid

    James, I (and surly many others) greatly appreciate your scripting skills.
    This setup has worked like a charm for me (and the kids). But, after setting up a new server I am experiencing some new behaviors I am unable to understand fully.
    The server is a dedicated ubuntu server 20.4.something (the latest).
    I ran the setup first time, worked like a charm.
    But, after altering some server properties I ran the restart shell script, and things stopped working.
    Looks like the script removes all the start, stop restart scripts, and when attempting to start it is unable to do so due to the missing script, and also it is trying to change the mode of “bedrock_server” folder, that is not there.
    Any thoughts on what went wrong here..?

    1. Avatar for James A. Chambers

      Hey Baklid,

      This sounds like a pathing issue. When you run SetupMinecraft.sh use the default (~) for your installation folder. Make no attempts to try to type in where the old folder is or try to choose some different “root” path to install it on. It’s looking for the “root” folder that ALL servers are in, NOT your individual server. From there it uses your “server label/name” to find the right folders.

      That is why you should always use ~. I’ve never seen anything else cause this and it has only happened once or twice before. I’m not sure how I can fix it further other than taking the feature away / making it so you have to download and remove commented out lines or something like that. The prompts use very strong language to suggest never changing it unless you’re absolutely certain you know how it’s working / what it’s doing / etc. and the only use cases are completely separate disks and things like that.

      The path should always be the same. The installation path should be *exactly* the same as your other server. It will not go on top of it unless you choose the same “server name/label” and even then it will detect it’s an existing installation and go into “update mode” where it downloads the latest versions of the scripts but it will never replace/overwrite an existing world. It supports multiple servers. Anything else is going to be an invalid path and all bets are off for sure (thus the warning that almost nobody should ever change this when it asks for the installation path). I am going to update the documentation / prompts to make this piece a little bit more clear (I don’t think it specifically says to always choose the same path for the root, but it should).

      I’m guessing you have manually put the path to the individual server in the installer. This will prune files that aren’t where they are supposed to be and all kinds of other bad behavior. I added a check to make sure the folder was valid but if you actually put a valid path to an old/updated server or a couple of folders too deep you probably ended up pruning the installation.

      You may have also put in a path like “myserver” which is not a fully qualified Linux path and would for sure result in a mess. A fully qualified path would be something like /home/myuser and start with a forward slash. The script no longer allows invalid paths but if you installed a few weeks ago before I added that it may have allowed it (although this sounds more recent).

      The path structure of the script is:

      $ROOTDIRECTORY/minecraftbe/yourservername

      so if you pick a different name it will be a different folder within the base minecraftbe folder. If you’re using a custom path it would end up being something like /mnt/externaldisk for ALL of your servers and then they would all be on a different disk like:

      /mnt/externaldisk/minecraftbe/yourservername

      Otherwise you want to always leave this setting alone.

      Can you run it again and use the default installation path of ~? You’ll likely need to restore from a backup as it sounds like your main files have been pruned but if this is a brand new server I would set it up as completely fresh using the default paths and that should get it for you!

  7. Avatar for Derek

    Hi again James, looks like the game is crashing every time my son attempts to log in. I changed the ports and that didn’t fix it – I found what seemed to be the same issue here.

    Here are the log files for two failed connections:
    First time:
    Minecraft Crash Login #1
    Every time after:
    Minecraft Crash Login #2

    Is this just a matter of waiting for an game update and simply checking daily for it?

    1. Avatar for James A. Chambers

      Hey Derek,

      That looks like it’s most likely a permissions error. It’s possible when an update was extracted that some libraries (or bedrock_server itself) lost their “chmod” bit. Can you stop the server (if it’s still in running condition after that crash) and run the ./fixpermissions.sh file from inside your server folder?

      The posted bugs look like they’re related to the curl library. It’s very unlikely that your curl library has changed in any way. You can do a sudo apt install libcurl4 or run SetupMinecraft.sh again (SetupMinecraft.sh will recheck your dependencies/libraries) to be sure, but I’m guessing ./fixpermissions.sh will take care of it!

Leave a Comment

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

Type here..

Exit mobile version