1、 Overview:
-
Preparation in advance: a cloud server or a personal device equipped with CentOS operating system, such as a virtual machine (this article assumes that you have known and purchased the cloud server and have a certain understanding of Linux operating commands)
-
Building methods: there are two ways. Let me explain how to build using the official BDS first. Then explain how to build using liteloader BDS (this method supports all Linux environments).
I personally recommend using liteloaderbds to build it, because it has higher scalability, provides highly customized APIs, can freely install and write plug-ins, supports hot update plug-ins, and better community environment. For details, please refer toLiteLoaderBDS。
If you want to directly refer to the construction method of liteloader BDS, please refer to step 5 directly.
ps: Recently, it seems that more and more people take the server. I thought this article could be kept as a note for reference when I want to open the service in the future. But after I wrote this article, I found a series of abnormal conditions on my server, such as memory leakage, server fake death, etc. In order to prevent future friends from stepping on this pit, I would like to make a statement: at present, the construction method of this article may have a serious memory leakage problem in CentOS server, that is, the memory only increases and does not decrease until it is full and the service collapses. It is impossible to judge whether the problem is caused by liteloader loader or BDS official server. I recommend that you directly install the windows server operating system in the ECs to build the server, which will make your server run more stably. During operation, please avoid clicking CMD terminal window with the mouse. This operation will probably make your server enter the pseudo dead state. If you encounter any problems during the construction process, please leave a message in the comment area. I will answer it as soon as I see it.
2、 Download the official Server package:
- get intoDownload from official website, after entering, there is a pop-up window to tell you to go to the Netease national service version. We click the very secret button to turn it off.
image.png
Scroll down and select Ubuntu server, check the agreement, right-click the download button, and copy the download address:
image.png - Next, use the remote connection tool to connect to the ECS and execute the command
dnf install wget -y
Download WGet tool and wait for the installation to complete. (DNF is a package management tool that comes with centos8. It is more convenient and better than yum. It will automatically download and install the dependencies. If your server is centos7, you can install DNF manually:yum install dnf -y
, and then execute the above command. If you don’t want to use DNF, you can also directly use Yum to install it). - create folder
mkdir mcbe
, enter the foldercd mcbe
- Next, execute in this folder:
wget https://minecraft.azureedge.net/bin-linux/bedrock-server-1.18.12.01.zip
, this is the address you just copied on the official website. Note the version number:1.18.12.01
The corresponding version number is the version number of your game client. Check the version number of your client. You can modify the corresponding version number in this address to be consistent with the version number of your client, which will download the server package of the corresponding version.
Unzip the package after the download is completed:unzip bedrock-server-1.18.12.01.zip
, if there is no unzip tool, executednf install unzip -y
Just install it.
3、 To create a Ubuntu container running environment using docker:
Because the official package only supports running in Ubuntu environment, running in CentOS will lack public dependency library. Of course, this problem can also be solved through special methods, but it is too troublesome. Therefore, we simply use docker container to create running environment, which not only solves the problem of running environment, but also facilitates management, and can also create multiple servers under multiple containers.
- To install docker:
dnf install docker-ce -y
- Start docker service:
systemctl start docker
- Set the docker service to start automatically after startup:
systemctl enable docker
- Pull the Ubuntu image:
docker pull ubuntu
- View image:
[[email protected] ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 54c9d81cbb44 4 weeks ago 72.8MB
- Create containers using Ubuntu images:
docker run -dit -p 6666:6666/udp -v /mcbe:/mcbe --restart=always ubuntu:latest /bin/bash
Copy the command directly and execute it.
docker run
Refers to creating a container.-d
It means that the daemon mode will not enter the container by default,-it
Open the standard input pseudo terminal. These three parameters are indispensable.-p 6666:6666
It means mapping the server port in the container (6666 in the back) to the 6666 port of the host (6666 in the front). Note: the two port numbers should be consistent. If they are inconsistent, a bug will be triggered even if the mapping port of the host is opened (the server list in the game shows a red dot of delay, but in fact, the bug that can enter the server does not know whether it is a bug, but I have dealt with this problem for a long time), Minecraft bedrock server uses UDP protocol, so plus/udp
。-v /mcbe:/mcbe
Means to map (Mount) the mcbe folder (created in the second step) in the host to the mcbe folder in the container, which is convenient for us to manage and configure the server directly in the host. If you need to create multiple servers, repeat the above method to create multiple containers, and then copy multiple copies of the mcbe folder without duplicate names. Multiple containers map to different folders, i.e. (mcbe1, mcbe2), etc. for details, please explore or checkRelated documents。
- View container:
[[email protected] ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5a9e86570a47 ubuntu:latest "/bin/bash" 23 seconds ago Up 21 seconds 0.0.0.0:6666->19132/udp, :::6666->19132/udp jovial_taussig
Copy the printed container ID, mine is5a9e86570a47
- Enter container:
docker exec -it 5a9e86570a47 /bin/bash
image.png
4、 Modify the configuration and start the server:
- Update package management tool
apt update
- Install VIM editor
apt install vim -y
- Install TMUX session manager
apt install tmux -y
- Enter the mcbe folder
cd mcbe
- Edit server profile
vim server.properties
: Pressi
Enter edit mode,image.png
-
If you want to play hard mode, you will:
difficulty=easy
Change todifficulty=hard
-
Change hang up kick out to
player-idle-timeout=0
(no matter how long you hang up and don’t kick out, the unit is minute) -
The maximum thread is modified to:
max-threads=0
(0 is to keep the maximum number of threads as possible) -
Modify server port:
server-port=6666
(the port number here should be consistent with the port number set when the container is opened. The default is 19132) -
Open whitelist:
allow-list=true
-
Press
Esc
And enter:wq
Save exit
For other configurations, please check the in the mcbe folderbedrock_server_how_to.html
English documents, or Baidu other.
- implement
tmux
Command to create a new session - Execute under this session
LD_LIBRARY_PATH=. ./bedrock_server
Command to start the server. If you see this print message, it indicates that the startup is successful:image.png - Press
<ctrl+b>
Then pressd
Exit the session and keep the background running. If you want to enter the session to view next time, execute it directlytmux attach
。 - Exit container:
exit
(the container remains running in the background after exiting). Enter or use the command next time:docker exec -it 5a9e86570a47 /bin/bash
Some other commands about TMUX:
- Create a new session and name it
tmux new -s <session-name>
- To view a list of sessions:
tmux ls
- Kill session process:
tmux kill-session -t <session-name>
- Switch session:
tmux switch -t <session-name>
- Rename session:
tmux rename-session -t <old-session-name> <new-session-name>
5、 Build using liteloaderbds:
Construction premise: docker has been installed
If not, follow these steps:
- To install docker:
dnf install docker-ce -y
- Start docker service:
systemctl start docker
- Set the docker service to start automatically after startup:
systemctl enable docker
- Official description of liteloaderbds:
LiteLoaderBDS
It is an unofficial minecraft server plug-in loader, which is the official server of bedrock versionBedrock Dedicated Server
(hereinafter referred to as BDS) provides plug-in development support and plug-in loading services, which makes up for some shortcomings of the official behavior package development interface for a long time.
- Pull the liteloader image and execute:
docker pull shrbox/liteloaderbds
。
The image takes up 2.6g and it takes a little effort to download. If you download slowly like me, you need to replace the docker image source. If you download fast enough, ignore the following steps:- Execute command
vim /etc/docker/daemon.json
Edit daemon JSON file, which does not exist by default, but we can still execute this command because VIM will automatically create this file for us. - Press
i
Enter edit mode and write the following configuration information:{ "registry-mirrors": ["https://registry.docker-cn.com"] }
https://registry.docker-cn.com
It is the official image source of China.
Next pressEsc
Exit edit mode, then press and enter:wq
Then press enter to exit saving. - Restart docker service
systemctl restart docker
, then executedocker pull shrbox/liteloaderbds
Command, you will find that the download speed is rising.
- Execute command
- After pulling down the mirror, create the container:
docker create --name liteloader -p 6666:6666/udp -v liteloaderbds:/home/bds/bds -i -t shrbox/liteloaderbds
[[email protected] _data]# docker create --name liteloader -p 6666:6666/udp -v liteloaderbds:/home/bds/bds -i -t shrbox/liteloaderbds
a02453350504ec839c1c4c5775abc4cf07778ecb4c4e243493394425cc79c72d
Note: don’t mistake a letter of this command.
-v
Parameters are followed byliteloaderbds:/home/bds/bds
, indicating the creation of a named mount volumeliteloaderbds
, map to container/home/bds/bds
Path, which is the location of the server package. After mounting, it is convenient for us to directly operate the server configuration file on the host.
-
After the creation, we make a soft connection to the mounted volume. Go to the main directory, or other directory where you store things.
cd ~
, then execute the command:ln -s /var/lib/docker/volumes/liteloaderbds/_data/ ./liteloader
In this way, you can directly operate the server files under the home directory in the future. Let’s print the list and check it:image.pngFound that the soft connection was created successfully,
cd _data
Enter to check:image.pngIn the list is the server file created by the container.
-
Edit the server configuration file in the current directory
vim server.properties
: Pressi
Enter edit mode:image.png- If you want to play hard mode, you will:
difficulty=easy
Change todifficulty=hard
- Change hang up kick out to
player-idle-timeout=0
(no matter how long you hang up and don’t kick out, the unit is minute) - The maximum thread is modified to:
max-threads=0
(keep maximum threads as possible) - Modify server port:
server-port=6666
(the port number here should be consistent with the port number set when the container is opened. The default is 19132) - Press
Esc
And enter:wq
Save exit
- If you want to play hard mode, you will:
-
Start the container after modification:
docker container start liteloader
-
Other commands:
- Force server stop (not recommended):
docker container stop liteloader
- Enter the console (server terminal):
docker attach liteloader
- Exit console: Press
Ctrl + P + Q
。 If pressedCtrl + C
, the server process will terminate.
- Force server stop (not recommended):
-
Use of plug-ins: Download plug-ins in the community and put them directly into the server directory
plugins
Folder, and then executedocker container restart liteloader
Restart the container. Here I recommend a community that provides plug-insminebbs, you can find and download it yourself. -
Some terminal commands of liteloader:
-
ll list
List all plug-ins currently loaded -
ll load ./plugins/xxxx.js
Hot load the plug-in located in the specified path. The path is relative to the BDS root directory. -
ll unload xxxx.lua
The hot uninstall is named XXXX in the plug-in list Plugins for Lua -
ll reload xxxx.dll
Reload the plugin named XXXX in the list of plugins DLL plug-in -
ll reload
Reload all plug-ins in the plug-in list -
ll version
Output the currently installed ll version -
ll upgrade
Manually check liteloaderbds for automatic updates
-
6、 Final work:
Enter your own ECS background = > firewall configuration page and open port 6666 (I’m Tencent cloud and Alibaba cloud should be called ‘Security Group’)

Note: the protocol is UDP
Next, enter the game, server = > add a server, fill in the server name casually, server address: enter the public IP of ECs, port: 6666. If you can successfully enter the game after saving, it means that the server is successfully built.
7、 Terminal instruction:
Setup administrator:
OP "player ID"
Turn on death without falling:
gamerule keepInventory true
Display coordinates:
gamerule showcoordinates true
Add to the white list:
Allowlist add player name
Remove from whitelist:
Allowlist remove player name
Reload the white list after each deletion or addition:
allowlist reload
8、 Summary:
Building minecraft bedrock server on CentOS is a little troublesome. If windows is built, it’s OK to directly download the package and execute the executable file. For other relevant information, building methods, plug-in download and server configuration tutorial, please go to the community to find:minebbs。
If you have any technical problems or want to play with my server, you can add my wechat: bishu0913.
Please indicate the source of reprint.