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

Subscribe
Notify of
guest

1.5K Comments
Inline Feedbacks
View all comments
Kyk
Kyk
1 year ago

Hello. I use Google translator, I apologize if there are errors somewhereHello. I use Google translator, I apologize if there are errors somewhere.
I ran the script, everything went well, in screen -r also all is well, ports are open. But when I enter the ip and port into Minecraft and try to connect, I get nothing “could not connect to the world” I receive such a message. Minecraft cannot find the server, what should I do?

Bob
Bob
1 year ago

Hi there,
Thanks for your guide. Unfortunately I seem to be running into a problem and I can’t figure it out, originally I thought it was similar to Gerry’s but I still can’t figure it out.
It appears to be running fine, but when I try to telnet to the port I get no response, and I can’t connect.
My log file looks normal:

[2021-12-20 07:51:22] NO LOG FILE! - [] setting up server logging...
[2021-12-20 07:51:22] [2021-12-20 07:51:22:670 INFO] Starting Server
[2021-12-20 07:51:22] [2021-12-20 07:51:22:670 INFO] Version 1.18.2.03
[2021-12-20 07:51:22] [2021-12-20 07:51:22:670 INFO] Session ID cb2e6ab3-bc1c-4097-841a-b7f5a4f7f601
[2021-12-20 07:51:22] [2021-12-20 07:51:22:670 INFO] Level Name: Bedrock level
[2021-12-20 07:51:22] [2021-12-20 07:51:22:672 INFO] Game mode: 0 Survival
[2021-12-20 07:51:22] [2021-12-20 07:51:22:672 INFO] Difficulty: 1 EASY
[2021-12-20 07:51:22] [2021-12-20 07:51:22:707 INFO] opening worlds/Bedrock level/db
[2021-12-20 07:51:23] [2021-12-20 07:51:23:482 INFO] IPv4 supported, port: 31808
[2021-12-20 07:51:23] [2021-12-20 07:51:23:482 INFO] IPv6 supported, port: 31809
[2021-12-20 07:51:23] [2021-12-20 07:51:23:787 INFO] Server started.
[2021-12-20 07:51:23] [2021-12-20 07:51:23:814 INFO] IPv4 supported, port: 19132
[2021-12-20 07:51:23] [2021-12-20 07:51:23:814 INFO] IPv6 supported, port: 19133

However netstat doesn’t show anything on any of those ports:
sbob@www:~/$ sudo netstat -tnlp | grep :31808

returns blank, same as all the other ports. But I can see those ports using ss
sbob@www:~/$ sudo ss -tunlp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 0.0.0.0:39078 0.0.0.0:* users:(("/usr/sbin/amavi",pid=566434,fd=15))
udp UNCONN 0 0 0.0.0.0:47431 0.0.0.0:* users:(("/usr/sbin/amavi",pid=566441,fd=15))
udp UNCONN 0 0 0.0.0.0:39837 0.0.0.0:* users:(("/usr/sbin/amavi",pid=566443,fd=15))
udp UNCONN 0 0 0.0.0.0:31808 0.0.0.0:* users:(("bedrock_server",pid=686862,fd=8))
udp UNCONN 0 0 127.0.0.1:8125 0.0.0.0:* users:(("netdata",pid=3596,fd=61))
udp UNCONN 0 0 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=1043,fd=12))
udp UNCONN 0 0 0.0.0.0:631 0.0.0.0:* users:(("cups-browsed",pid=665964,fd=7))
udp UNCONN 0 0 0.0.0.0:58540 0.0.0.0:* users:(("/usr/sbin/amavi",pid=566440,fd=15))
udp UNCONN 0 0 0.0.0.0:19132 0.0.0.0:* users:(("bedrock_server",pid=686862,fd=10))
udp UNCONN 0 0 0.0.0.0:43833 0.0.0.0:* users:(("/usr/sbin/amavi",pid=566442,fd=15))
udp UNCONN 0 0 0.0.0.0:44032 0.0.0.0:* users:(("/usr/sbin/amavi",pid=566435,fd=15))
udp UNCONN 0 0 0.0.0.0:60933 0.0.0.0:* users:(("avahi-daemon",pid=1068,fd=14))
udp UNCONN 0 0 0.0.0.0:37239 0.0.0.0:* users:(("/usr/sbin/amavi",pid=566436,fd=15))
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:* users:(("avahi-daemon",pid=1068,fd=12))
udp UNCONN 0 0 *:31809 *:* users:(("bedrock_server",pid=686862,fd=9))
udp UNCONN 0 0 [::]:48736 [::]:* users:(("avahi-daemon",pid=1068,fd=15))
udp UNCONN 0 0 *:19133 *:* users:(("bedrock_server",pid=686862,fd=11))

but as you can see, it’s finding the udp ports, not the tcp ports.
I’ve tried chmod +x bedrock_server with no luck.
My ufw is currently disabled, iptables shows no rules so it should be letting everything through. The webserver on the same machine is working correctly.

Any help would be so appreciated.

Bob
Bob
1 year ago

Thank you for your help. In the end it was a problem with the Firewall after all. I think it was maybe because I am also using iRedmail on that box, but it had nftables configured to refuse the connection. Once nftables was configured it worked.
Now to figure out how to connect a switch to it πŸ™

Moses
Moses
1 year ago

Hello James! πŸ™‚

For some reason I just can’t make it to work! I downloaded and followed your guide step by step. But when i try to use this command “./start.sh”, I get this:

moses@localhost:~/minecraftbe/Test$ ./start.sh Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Network interface not up, will try again in 1 second
Waiting for network interface to come up timed out - starting server without network connection ...
Checking for the latest version of Minecraft Bedrock server ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- -100 63522 0 63522 0 0 169k 0 --:--:-- -100 303k 0 303k 0 0 537k 0 --:--:-- --:--:-- --:--:-- 537k
Minecraft Bedrock server is up to date...
Starting Minecraft server. To view window type screen -r Test
To minimize the window and let the server run in the background, press Ctrl+A then Ctrl+D
~~~~~~~~~

And then nothing happens. The server isn’t running or anything. Do you know why? πŸ™

Moses
Moses
1 year ago

I get this when I write screen -r:

moses@localhost:~/minecraftbe/Test$ screen -r
There is no screen to be resumed.
~~~~~
So that’s a no go πŸ˜›

And about the logs, I have a few log files in the “log” folder but they are all completely empty. No text or anything πŸ™

So it won’t work anymore? I think I’m going to try another Ubuntu Xfce4 version.

Moses
Moses
1 year ago

Hi again James! πŸ™‚

I wrote “Sudo systemfel status” and this popped up;

“System has not been booted with systemd as init system (PID 1). Can’t operate. Failed to connect to bus: Host is down”

It’s strange since I do have internet connection and everything works!

I have no plans to port-forward this so other outside my network can join. I just want to use this using LAN only.
I opened the “server-properties” file and changed the “online-mode=true” to false. But it still doesn’t work. But this time i get this instead, even though it doesn’t work:

**** I got like 9 of those network thingy, so I removed them and only put 2** πŸ˜›

Network interface not up, will try again in 1 second Network interface not up, will try again in 1 second Waiting for network interface to come up timed out - starting server without network connection ... Checking for the latest version of Minecraft Bedrock server ... % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- - 0 0 0 0 0 0 0 0 --:--:-- -100 303k 0 303k 0 0 346k 0 --:--:-- --:--:-- --:--:-- 346k

Minecraft Bedrock server is up to date…
Starting Minecraft server. To view window type screen -r test
To minimize the window and let the server run in the background, press Ctrl+A then Ctrl+D

Mark
Mark
1 year ago

Hi – I start and restart the server from a terminal command line it requires sudo password. It’s also not restarting with the backup and reboot each night until I terminal in and use ./start.sh and enter the sudo password when prompted. Anyway to have sudo password requirement removed?

Mark
Mark
1 year ago

Thanks for the quick reply – ran it again, but no luck. I’m on Ubuntu 20.04.3. Generic kernel etc – nothing custom as such. I checked the sudoers user list, and the minecraftbe user hasn’t been added.

Mark
Mark
1 year ago
Reply to  Mark

And just like that… did a full update/upgrade and my Minecraft server starts with every reboot.

Mark
Mark
1 year ago

Bummed to say that it’s been back for a while. I ran the fixpermissions script i didn’t see anywhere were mincraftbe sudoer got ownership of anything. It’s either my own user account or this… mode of '/home/amoc/minecraftbe/Hearnecraft/start.sh' retained as 0755 (rwxr-xr-x).

I checked the sudoer file too and minecraftbe is not a user (I’m a bit new to Ubuntu, so please forgive the ignorance).

Mark
Mark
1 year ago

I reran SetupMinecraft.sh and ran a reboot – had to manually restart the Minecraft server again.

Why are you trying to fix the permissions? Is the issue still that the server won’t start up on reboot again?
Yes. Backups work as designed, but every morning I need to jump in run ./start.sh via a terminal to get the Minecraft server restarted (incidentally, it asks for my sudo password to run the script).

Which Ubuntu version is this?

20.04.3

Is it up to date / a fresh install?

Yes. I ran apt-get update and upgrade again. Livepatch reports no updates needed.

How about log files? What does sudo systemd status minecraft say when this happens as well as your server log files?

From auth log:
Jan 6 04:00:32 amocserver sudo: amoc : a password is required ; TTY=unknown ; PWD=/home/amoc ; USER=root ; COMMAND=/usr/bin/systemctl start Hearnecraft

From syslog:
Jan 6 04:00:01 amocserver CRON[369920]: (amoc) CMD (/home/amoc/minecraftbe/Hearnecraft/restart.sh 2>&1)
Jan 6 04:00:01 amocserver CRON[369921]: (amoc) CMD (/home/amoc/minecraftbe/mc/restart.sh)
Jan 6 04:00:01 amocserver CRON[369922]: (amoc) CMD (/home/amoc/minecraftbe/hearnecraft/restart.sh 2>&1)
Jan 6 04:00:01 amocserver CRON[369923]: (amoc) CMD (/home/amoc/minecraftbe/hearnecraft/restart.sh)
Jan 6 04:00:01 amocserver CRON[369919]: (CRON) info (No MTA installed, discarding output)
Jan 6 04:00:01 amocserver CRON[369917]: (CRON) info (No MTA installed, discarding output)
Jan 6 04:00:01 amocserver CRON[369918]: (CRON) info (No MTA installed, discarding output)
Jan 6 04:00:32 amocserver CRON[369916]: (CRON) info (No MTA installed, discarding output)
Jan 6 04:09:01 amocserver CRON[370299]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jan 6 04:09:12 amocserver canonical-livepatch.canonical-livepatchd[798]: Client information is recent, not refreshing.

Systemmd check (Minecraft server is running)
amoc@amocserver:~/Desktop$ systemctl status minecraft
Unit minecraft.service could not be found.

I want to restate it is not typical to have to mess with *any* of this stuff especially on Ubuntu. I think something else is wrong here but we’re going to need more info I think to figure it out but I’m sure we can get it!

Thank you for your help, and patience.

Mark
Mark
1 year ago

Result from sudo systemctl status Hearnecraft
● Hearnecraft.service - Hearnecraft Minecraft Bedrock Server
Loaded: loaded (/etc/systemd/system/Hearnecraft.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-01-07 04:00:35 MST; 2 days ago
Process: 1041 ExecStart=/bin/bash /home/amoc/minecraftbe/Hearnecraft/start.sh (code=exited, status=0/SUCCESS)
Process: 56708 ExecStop=/bin/bash /home/amoc/minecraftbe/Hearnecraft/stop.sh (code=exited, status=1/FAILURE)

Jan 06 07:23:06 amocserver bash[2417]: % Total % Received % Xferd Average Speed Time Time Time Current
Jan 06 07:23:06 amocserver bash[2417]: Dload Upload Total Spent Left Speed
Jan 06 07:23:06 amocserver bash[2417]: [158B blob data]
Jan 06 07:23:06 amocserver bash[1041]: Minecraft Bedrock server is up to date...
Jan 06 07:23:06 amocserver bash[1041]: Starting Minecraft server. To view window type screen -r Hearnecraft
Jan 06 07:23:06 amocserver bash[1041]: To minimize the window and let the server run in the background, press Ctrl+A then Ctrl+D
Jan 06 07:23:06 amocserver systemd[1]: Started Hearnecraft Minecraft Bedrock Server.
Jan 07 04:00:35 amocserver bash[56708]: Server is not currently running!
Jan 07 04:00:35 amocserver systemd[1]: Hearnecraft.service: Control process exited, code=exited, status=1/FAILURE
Jan 07 04:00:35 amocserver systemd[1]: Hearnecraft.service: Failed with result 'exit-code'.

Removed mc.service. Will let you know if it correctly restarts overnight.

Mark
Mark
1 year ago
Reply to  Mark

No luck. Still had to terminal in and run ./start.sh

Mark
Mark
1 year ago

Server not started this morning. As you suggested – sudo systemctl start Hearnecraft then sudo systemctl status Hearnecraft. Worked.

Hearnecraft.service - Hearnecraft Minecraft Bedrock Server
Loaded: loaded (/etc/systemd/system/Hearnecraft.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-01-12 07:12:10 MST; 23s ago
Process: 407796 ExecStart=/bin/bash /home/amoc/minecraftbe/Hearnecraft/start.sh (code=exited, status=0/SUCCESS)
Tasks: 20 (limit: 19046)
Memory: 432.2M
CGroup: /system.slice/Hearnecraft.service
β”œβ”€407832 SCREEN -L -Logfile logs/Hearnecraft.2022.01.12.07.12.10.log -dmS Hearnecraft /bin/bash -c LD_LIBRARY_PA>
β”œβ”€407833 /bin/bash -c LD_LIBRARY_PATH=/home/amoc/minecraftbe/Hearnecraft /home/amoc/minecraftbe/Hearnecraft/bedr>
β”œβ”€407834 /home/amoc/minecraftbe/Hearnecraft/bedrock_server
└─407835 gawk { print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }

Jan 12 07:12:09 amocserver bash[407806]: worlds/Hearnecraft/db/044753.ldb
Jan 12 07:12:09 amocserver bash[407806]: worlds/Hearnecraft/db/043478.ldb
Jan 12 07:12:09 amocserver bash[407796]: Checking for the latest version of Minecraft Bedrock server ...
Jan 12 07:12:10 amocserver bash[407824]: % Total % Received % Xferd Average Speed Time Time Time Current
Jan 12 07:12:10 amocserver bash[407824]: Dload Upload Total Spent Left Speed
Jan 12 07:12:10 amocserver bash[407824]: [158B blob data]
Jan 12 07:12:10 amocserver bash[407796]: Minecraft Bedrock server is up to date...
Jan 12 07:12:10 amocserver bash[407796]: Starting Minecraft server. To view window type screen -r Hearnecraft
Jan 12 07:12:10 amocserver bash[407796]: To minimize the window and let the server run in the background, press Ctrl+A then C>
Jan 12 07:12:10 amocserver systemd[1]: Started Hearnecraft Minecraft Bedrock Server.

What does your startup routine look like?

Not sure how to answer that. Is there a log or such I can pull? The setup is very vanilla.

Do you have some sort of secondary internet connection / a VPN / anything like that which might explain the server starting too early before networking is ready?

No. Server is connected to router via Ethernet. Wifi is turned off.

The log files you posted are from when you originally started the server. What about when you restart it? Are they just empty?

Not empty. Auth.log
Jan 12 07:19:58 amocserver systemd-logind[732]: System is rebooting.
Jan 12 07:19:58 amocserver nxexec: pam_unix(nx:session): session opened for user amoc by (uid=129)
Jan 12 07:19:58 amocserver sudo: pam_unix(sudo:session): session closed for user root
Jan 12 07:20:19 amocserver systemd-logind[719]: New seat seat0.
Jan 12 07:20:19 amocserver systemd-logind[719]: Watching system buttons on /dev/input/event2 (Power Button)
Jan 12 07:20:19 amocserver systemd-logind[719]: Watching system buttons on /dev/input/event1 (Power Button)
Jan 12 07:20:19 amocserver systemd-logind[719]: Watching system buttons on /dev/input/event0 (Sleep Button)
Jan 12 07:20:25 amocserver sudo: pam_unix(sudo:auth): conversation failed
Jan 12 07:20:25 amocserver sudo: pam_unix(sudo:auth): auth could not identify password for [amoc]
Jan 12 07:20:25 amocserver gdm-autologin]: gkr-pam: no password is available for user
Jan 12 07:20:25 amocserver gdm-autologin]: pam_unix(gdm-autologin:session): session opened for user amoc by (uid=0)
Jan 12 07:20:25 amocserver systemd-logind[719]: New session 1 of user amoc.
Jan 12 07:20:25 amocserver systemd: pam_unix(systemd-user:session): session opened for user amoc by (uid=0)
Jan 12 07:20:25 amocserver gdm-autologin]: gkr-pam: gnome-keyring-daemon started properly
Jan 12 07:20:26 amocserver gnome-keyring-daemon[1159]: The Secret Service was already initialized
Jan 12 07:20:26 amocserver gnome-keyring-daemon[1159]: The PKCS#11 component was already initialized
Jan 12 07:20:27 amocserver polkitd(authority=local): Registered Authentication Agent for unix-session:1 (system bus name :1.52 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Jan 12 07:20:31 amocserver PackageKit: uid 1000 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0)
Jan 12 07:20:31 amocserver PackageKit: uid 1000 obtained auth for org.freedesktop.packagekit.system-sources-refresh
Jan 12 07:20:51 amocserver nxexec: pam_unix(nx:session): session opened for user amoc by (uid=129)
Jan 12 07:20:51 amocserver systemd-logind[719]: New session c1 of user amoc.
Jan 12 07:21:30 amocserver pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Jan 12 07:21:30 amocserver pkexec[2768]: amoc: Executing command [USER=root] [TTY=unknown] [CWD=/home/amoc] [COMMAND=/usr/lib/update-notifier/package-system-locked]
Jan 12 07:21:47 amocserver nxexec: pam_unix(nx:session): session opened for user amoc by (uid=129)
Jan 12 07:21:47 amocserver systemd-logind[719]: New session c2 of user amoc.
Jan 12 07:22:03 amocserver smbd: pam_unix(samba:session): session closed for user nobody
Jan 12 07:22:25 amocserver smbd: pam_unix(samba:session): session closed for user nobody
Jan 12 07:22:42 amocserver smbd: pam_unix(samba:session): session closed for user nobody

from syslog (it’s got a ton of stuff, so just pulling what looks relevant – let me know if better to share the whole thing)

Jan 12 07:19:58 amocserver systemd[1]: Stopping Hearnecraft Minecraft Bedrock Server...
....
Jan 12 07:20:24 amocserver systemd[1]: Finished Network Manager Wait Online.
Jan 12 07:20:24 amocserver systemd[1]: Reached target Network is Online.
Jan 12 07:20:24 amocserver systemd[1]: Starting Hearnecraft Minecraft Bedrock Server...
Jan 12 07:20:24 amocserver systemd[1]: Starting LSB: disk temperature monitoring daemon...
Jan 12 07:20:24 amocserver systemd[1]: Starting Tool to automatically collect and submit kernel crash signatures...
Jan 12 07:20:24 amocserver systemd[1]: Starting Samba NMB Daemon...
Jan 12 07:20:24 amocserver systemd[1]: Starting LSB: LDAP connection daemon...
Jan 12 07:20:24 amocserver systemd[1]: Starting Plex Media Server...
Jan 12 07:20:24 amocserver systemd[1]: Started crash report submission daemon.
Jan 12 07:20:24 amocserver systemd[1]: Started LSB: LDAP connection daemon.
Jan 12 07:20:24 amocserver whoopsie[1065]: [07:20:24] Using lock path: /var/lock/whoopsie/lock
Jan 12 07:20:24 amocserver cron[1073]: (CRON) INFO (pidfile fd = 3)
Jan 12 07:20:24 amocserver systemd[1]: Started Regular background program processing daemon.
Jan 12 07:20:24 amocserver systemd[1]: Starting GNOME Display Manager...
Jan 12 07:20:24 amocserver systemd[1]: Started Plex Media Server.
Jan 12 07:20:24 amocserver cron[1073]: (CRON) INFO (Running @reboot jobs)
Jan 12 07:20:24 amocserver systemd[1]: Started LSB: disk temperature monitoring daemon.
Jan 12 07:20:24 amocserver Plex Media Server[1081]: /bin/sh: 1: exec: /usr/lib/plexmediaserver/Plex Media Server: not found
Jan 12 07:20:24 amocserver systemd[1]: kerneloops.service: Found left-over process 1099 (kerneloops) in control group while starting unit. Ignoring.
Jan 12 07:20:24 amocserver systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Jan 12 07:20:24 amocserver systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=127/n/a
Jan 12 07:20:24 amocserver systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Jan 12 07:20:24 amocserver bash[1090]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Jan 12 07:20:25 amocserver systemd[1]: Started Tool to automatically collect and submit kernel crash signatures.
Jan 12 07:20:25 amocserver bash[1055]: Backing up server (to minecraftbe/Hearnecraft/backups folder)
Jan 12 07:20:25 amocserver systemd[1]: Started GNOME Display Manager.
Jan 12 07:20:25 amocserver bash[1110]: worlds/
Jan 12 07:20:25 amocserver bash[1110]: worlds/Bedrock level/
Jan 12 07:20:25 amocserver bash[1110]: worlds/Bedrock level/level.dat_old
... and then the minecraft server continues to load(this is with a restart this morning!)

What happens if you just reboot your computer? Does it start then?

Yes, which is a bit odd. I think I’ve had to manually start the minecraft server every time I rebooted. I rebooted again and the server started again.

Can you open start.sh and try changing the β€œexit 1” (there’s two instances of this right after the path variable is set) to β€œexit 0”?

Done. We’ll see what happens with this night’s backup and reboot.

Mark
Mark
1 year ago

Definitely helps. I’ll embark on a reinstall this weekend. Thank you again for the patience. I’m also going to dive into some UNIX/Ubuntu tutorials to get better at this.

Mark
Mark
1 year ago

Reinstalled. Smooth operation, although I did have a blank moment when trying to remember what I did to make it headless (xorg). MC was up and running this morning, fully backed up! Thanks again!

Gerry
Gerry
1 year ago

Just used your script to setup a bedrock server for my son, thanks. Looks like the server starts up:
[2021-12-12 19:37:33] NO LOG FILE! – [] setting up server logging…
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Starting Server
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Version 1.18.2.03
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Session ID 3e050eec-1e61-49a7-bc86-f04433ceab32
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Level Name: Bedrock level
[2021-12-12 19:37:33] [2021-12-12 19:37:33:565 INFO] Game mode: 0 Survival
[2021-12-12 19:37:33] [2021-12-12 19:37:33:565 INFO] Difficulty: 1 EASY
[2021-12-12 19:37:33] [2021-12-12 19:37:33:624 INFO] opening worlds/Bedrock level/db
[2021-12-12 19:37:34] [2021-12-12 19:37:34:734 INFO] IPv4 supported, port: 19132
[2021-12-12 19:37:34] [2021-12-12 19:37:34:737 INFO] IPv6 supported, port: 19133
[2021-12-12 19:37:34] [2021-12-12 19:37:34:095 INFO] Server started.
[2021-12-12 19:37:34] [2021-12-12 19:37:34:123 INFO] IPv4 supported, port: 39570
[2021-12-12 19:37:34] [2021-12-12 19:37:34:123 INFO] IPv6 supported, port: 39654

The issue is, when I run netstat, I dont see it listening:

netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 256 192.168.22.22:22 192.168.22.98:63913 ESTABLISHED
tcp 0 0 192.168.22.22:47312 99.84.243.65:443 TIME_WAIT

Logs dont show anything out of the ordinary. Any ideas?

Gerry
Gerry
1 year ago

netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 0.0.0.0:39570 0.0.0.0:*
udp 0 0 0.0.0.0:19132 0.0.0.0:*
udp 0 0 localhost:domain 0.0.0.0:*
udp 0 0 kmminecraft.madd:bootpc 0.0.0.0:*
udp6 0 0 [::]:19133 [::]:*
udp6 0 0 [::]:39654 [::]:*
udp6 0 0 kmminecra:dhcpv6-client [::]:*
raw6 0 0 [::]:ipv6-icmp [::]:* 7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] SEQPACKET LISTENING 18449 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 26226 /run/user/1000/systemd/private
unix 2 [ ACC ] STREAM LISTENING 26231 /run/user/1000/bus
unix 2 [ ACC ] STREAM LISTENING 26232 /run/user/1000/gnupg/S.dirmngr
unix 2 [ ACC ] STREAM LISTENING 26233 /run/user/1000/gnupg/S.gpg-agent.browser
unix 2 [ ACC ] STREAM LISTENING 22706 /var/snap/lxd/common/lxd/unix.socket
unix 2 [ ACC ] STREAM LISTENING 26234 /run/user/1000/gnupg/S.gpg-agent.extra
unix 2 [ ACC ] STREAM LISTENING 15770 @/org/kernel/linux/storage/multipathd
unix 2 [ ACC ] STREAM LISTENING 26235 /run/user/1000/gnupg/S.gpg-agent.ssh
unix 2 [ ACC ] STREAM LISTENING 26236 /run/user/1000/gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 26237 /run/user/1000/pk-debconf-socket
unix 2 [ ACC ] STREAM LISTENING 26238 /run/user/1000/snapd-session-agent.socket
unix 2 [ ACC ] STREAM LISTENING 15757 /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 15759 /run/systemd/userdb/io.systemd.DynamicUser
unix 2 [ ACC ] STREAM LISTENING 15768 /run/lvm/lvmpolld.socket
unix 2 [ ACC ] STREAM LISTENING 18434 /run/systemd/fsck.progress
unix 2 [ ACC ] STREAM LISTENING 18444 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 16842 /run/systemd/journal/io.systemd.journal
unix 2 [ ACC ] STREAM LISTENING 22703 /run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 22708 /run/snapd.socket
unix 2 [ ACC ] STREAM LISTENING 22710 /run/snapd-snap.socket
unix 2 [ ACC ] STREAM LISTENING 22712 /run/uuidd/request
unix 2 [ ACC ] STREAM LISTENING 22943 /run/irqbalance//irqbalance689.sock
unix 2 [ ACC ] STREAM LISTENING 31178 /run/screen/S-gerrym/2058.KMMineCraft
unix 2 [ ACC ] STREAM LISTENING 22705 @ISCSIADM_ABSTRACT_NAMESPACE

Gerry
Gerry
1 year ago
Reply to  Gerry

[2021-12-12 19:37:33] NO LOG FILE! - [] setting up server logging...
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Starting Server
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Version 1.18.2.03
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Session ID 3e050eec-1e61-49a7-bc86-f04433ceab32
[2021-12-12 19:37:33] [2021-12-12 19:37:33:561 INFO] Level Name: Bedrock level
[2021-12-12 19:37:33] [2021-12-12 19:37:33:565 INFO] Game mode: 0 Survival
[2021-12-12 19:37:33] [2021-12-12 19:37:33:565 INFO] Difficulty: 1 EASY
[2021-12-12 19:37:33] [2021-12-12 19:37:33:624 INFO] opening worlds/Bedrock level/db
[2021-12-12 19:37:34] [2021-12-12 19:37:34:734 INFO] IPv4 supported, port: 19132
[2021-12-12 19:37:34] [2021-12-12 19:37:34:737 INFO] IPv6 supported, port: 19133
[2021-12-12 19:37:34] [2021-12-12 19:37:34:095 INFO] Server started.
[2021-12-12 19:37:34] [2021-12-12 19:37:34:123 INFO] IPv4 supported, port: 39570
[2021-12-12 19:37:34] [2021-12-12 19:37:34:123 INFO] IPv6 supported, port: 39654

Gerry
Gerry
1 year ago
Reply to  Gerry

telnet 192.168.22.22 19132
Connecting To 192.168.22.22…Could not open connection to the host, on port 19132: Connect failed

Gerry
Gerry
1 year ago

Got it working, thanks for your help. One last thing in server.properties, I have creative mode enabled and when the server starts, it says creative mode, but when I connect to the server its in survival mode still.

Gerry
Gerry
1 year ago

Thanks for your help James, I disabled ipv6 and tried to restart the service, now I’m getting:
Displaying last 10 lines from log file /home/gerrym/minecraftbe/KMMineCraft/logs/KMMineCraft.2021.12.12.20.06.28.log in /logs folder:
[2021-12-12 20:06:29] Upload Date: 2021-12-12 20:06:29 UTC
[2021-12-12 20:06:29] Session ID: 977438b8-54f6-4b18-813f-4a792542a1b5
[2021-12-12 20:06:29] Commit hash: 74c6ce6eb10dfe6b481aa14578b375b50a5d2028
[2021-12-12 20:06:29] Build id: 7966228
[2021-12-12 20:06:29] CrashReporter Key: b201d04f-e5d0-3630-89a3-45bc4e1c3751
[2021-12-12 20:06:29]
[2021-12-12 20:06:29] Crash
[2021-12-12 20:06:29] [2021-12-12 20:06:29:319 INFO]
Failed to open curl lib from binary, use libcurl.so instead
[2021-12-12 20:06:30] db3ace51-c50d-40b9-961a-0fd72b49adf3

Vince
Vince
1 year ago

Thank you! This is relatively straightforward compared to Java Edition.

Paul Fielding
Paul Fielding
2 years ago

Thank you for this guide! I have a question regarding removing a server. Having created one for testing purposes, I’m ready to start setting up the specific servers I want to use. I’d like to delete the world I created (ie. the service, crontab entry, etc). I’m sure if I dig through things enough I can figure out everything that manually needs to be removed, but is there any more efficient way already worked out, or is there a list of the specific things to remove already documented somewhere? Many thanks!

1 40 41 42 43 44 63