Today we are going to install a Minecraft Bedrock server on Ubuntu. This version replaces the old “PE” or “Pocket Edition” version of Minecraft.
The main advantage of this new version is the compatibility. Players from every gaming consoles (except Nintendo Switch) can log into a Bedrock server and play in the same world.
We will separate the creation of our server into two stages:
- Preparing the server
- Installation of Minecraft Bedrock.
To proceed with the installation, you must have an Ubuntu 20.04 server with SSH access (command line) on hand. For those without a server, you can take a look at our excellent virtual servers.
Before you begin, it’s important to make sure that all updates are all installed on your server. Here are the commands to perform to update on your Minecraft server.
sudo apt-get update sudo apt-get upgrade
Note: When you enter the “sudo” command for the first time in the session, the server will ask you to enter the administrator password.
I suggest to restart the server after performing the updates. Restarting the server will ensure that all updates have been applied.
Let’s Add Some Security
Once the server is up to date, you must apply a minimum of security. This section is optional, but highly recommended.
SSH Access to the Server
By default, the SSH service of a server is listening on port 22. Therefore, many of the hackers will try to exploit this port. Fortunately, it is very simple to change the default port on a Linux server.
Start by opening the SSH service configuration file (located at: /etc/ssh/sshd_config)
sudo nano /etc/ssh/sshd_config
The file looks like this:
You need to replace the port number on the line below the cursor, shown in the picture above. For this tutorial, I will change port 22 for the port 22222.
Once the port is changed, press “CTRL-X” to close an save.
Adding a Firewall
Now you must prepare the firewall to prevent everyone having access to your server. We will place four rules in the server.
The first rule will block all incoming connections in the server:
sudo ufw default deny incoming
Then, allow all outgoing connections from the server.
sudo ufw default allow outgoing
Now we must allow SSH to connect to the server so that we can always have access to the server. Important, I put port 22222 here because it’s the one I opened in my server, if you selected another port, please change 22222 for your port.
sudo ufw allow 22222/tcp
Finally, we will open the necessary port for the Minecraft Bedrock server.
sudo ufw allow 19132/udp
Now that we’re done with our firewall configuration, we need to restart the SSH service and the firewall. The order is important to avoid getting banned outside the server.
We close the firewall.
sudo ufw disable
Then restart the SSH service (You may have to reconnect).
sudo service sshd restart
And we open the firewall
sudo ufw enable
Preparing the Server for Minecraft
Good, now that security has been improved on your server, you can start the installation of the necessary modules for the Minecraft PE server. We will install “PocketMine MP” as Minecraft PE server, it is easy to use and is still maintained regularly.
First, install the necessary modules for the Minecraft PE server to function properly. I will not go into the description of each module. The curious can find descriptions easily on the web. I will simply give you’re the command to enter.
sudo apt-get install zip screen -y
Now we must create a user under which we will run the Minecraft PE server. Creating a user improves the security of the server. I will create a user named “minecraft” with a folder in “/home/minicraft/”.
sudo useradd -d /home/minecraft -m minecraft
And then we will assign a password to the user (the system will ask you to enter the password twice.
sudo passwd minecraft
Installing the Minecraft Server
For the rest of the tutorial, we’ll be using the “minecraft” user we just created. You must therefore re-enter your server. This time you’ll enter with port 22222 and the “minecraft” user you just created.
Now you need to download the Minecraft Bedrock server. To find the download link, head to the Bedrock server downloads page and copy the link address from the “Ubuntu” section.
With the copied link and the Linux “wget” command, we will download the file to our server.
Now that the file has been downloaded to the server, we will decompress it.
Note: The file name may vary depending of the current Minecraft release.
Our server is now ready to be started!
Bringing the Minecraft Bedrock server online
Before you can start the server, you must make the main server file executable with the following command.
chmod +x bedrock_server
Then, we can start the server with the following command:
During the first start, the server will create a default world. The only problem remaining is when we close the SSH window, the Minecraft server will stop working.
To remedy this problem, we will be launching the Minecraft server with the “screen” application. Here’s the command to proceed:
Once the server is functional, to go back without closing your Minecraft PE server, press the “CTRL-A” keys followed by the “D” key. You will be back in the command line, but your Minecraft PE server will continue to work.
To return to the screen where the Minecraft PE server display the information, simply perform the following command.
Customizing the Minecraft Bedrock server
Before starting our Minecraft server, you can modify some of the game settings. To do this, you must modify the “server.properties” file. Open the file with nano.
You can now customize your server. Here are the most practical options:
- Level-name: Allows you to change the display name of the server in the game
- Level-seed: Insert a custom Minecraft “seed” to choose your world.
- Gamemode: Allows you to choose whether the server is in creative or survival mode.
- Difficulty: Change the difficulty level of the game.
There you go, all you have to do is invite friends and share your world. For those who prefer the PE edition, here is my guide to installing a Minecraft PE server.