Linux+MCSM9+Docker build Minecraft mohist1.18.2 version server, MC server opening tutorial

Debian system uses the MCSManager9 panel and Docker container to build a tutorial for Minecraft Java Edition private server. This tutorial uses the mohist1.18.2 server. You can also refer to other servers.

mohist supports MOD and plugins.

Video tutorial: https://www.bilibili.com/video/BV1DF411N7Dv/

Linux+MCSM9+Docker Build Minecraft Java Edition Server, MC Service Opening Tutorial

  • Other versions of minecraft server building tutorial: https://blog.zeruns.tech/tag/mc/
  • Various Minecraft server introductions and downloads: https://blog.zeruns.tech/archives/626.html
  • Cost-effective and cheap VPS/cloud server recommendation: https://blog.zeruns.tech/archives/383.html

QQ group 2: 746189110

MC open server communication QQ channel: https://url.zeruns.tech/mc_qq

Introduction to MCSM9

Distributed, stable and reliable, out of the box, highly scalable, supports control panels for Minecraft and a few other games.

The MCSManager panel (abbreviation: MCSM panel) is a fully Chinese, lightweight, out-of-the-box, multi-instance and Docker-supported Minecraft server management panel.

This software has a certain popularity in Minecraft and other game communities. It can help you centrally manage multiple physical servers , dynamically create game servers on any host, and provide a safe and reliable multi-user permission system. Easily help you manage multiple servers.

Prepare

First of all, you must have a server (the existing ones can be ignored), here are some recommendations:

Other cost-effective server recommendations: https://blog.zeruns.tech/archives/383.html

Performance evaluation and comparison of lightweight application servers from major cloud service providers, Alibaba Cloud, Tencent Cloud, Huawei Cloud, and Ucloud: https://blog.zeruns.tech/archives/675.html

If you are a new user with a discount, it is recommended to buy it for as long as you can, because the follow-up fee for the server at the discounted price is very expensive, and the discount for new users can only be purchased once, so try to buy as long as possible to save money.

Version 1.18 requires high memory usage and performance, minimum 4G memory! ! ! Don’t buy ones lower than 4G. Someone bought a 2G server before and opened 1.18 and reported an error memory overflow. Then they came to ask me why I couldn’t open it. I was really speechless...

A server with 2 cores, 4G memory and 5 megabytes of bandwidth can have about 1 to 5 people online at the same time, and a server with 4 cores, 8G and 10 megabytes can have about 5 to 20 people online at the same time.

Do not buy 1 M bandwidth! ! ! 1M bandwidth can be played by at most one or two people, it is recommended to start from 5M! ! !

After purchasing the server, choose to install the Debian10 or 11 system, and then use ssh to log in to the server. The ssh client software recommends putty or mobaxterm.

The default account is generally: the root password is set by yourself when purchasing, and some users may not set a password when purchasing, you can reset the password on the console after purchase.

connect to the server

Download, install and open the ssh client software. The ssh client software recommends putty or mobaxterm.

Enter the server IP address in the SSH client and click Open.

If the warning shown below pops up, click Yes

Then enter the account number and press Enter, the account is usually root by default , then enter the password and press Enter to confirm, it will not be displayed when entering the password.

Reminder: In the SSH terminal, press and hold the left mouse button to select the text, then release the mouse, and then click in the blank space, so that the selected text will be copied; in the SSH terminal, right-click to paste.

open port

The panel requires 23333 and 24444 ports.

The game server default port is 25565.

If you use Alibaba Cloud , Tencent Cloud or other cloud service providers, please enter the console to the firewall security group policy and allow the above ports .

Or allow all ports, both inbound and outbound

Turn off the system's own firewall:

# 关闭防火墙,依次执行
systemctl stop firewalld
systemctl disable firewalld
service iptables stop

installation panel

Quick installation with one line of command

wget -qO- https://gitee.com/mcsmanager/script/raw/master/setup.sh | bash
  • The script is only available for AMD64 architecture Ubuntu/Centos/Debian/Archlinux)
  • After the execution is complete, use systemctl start mcsm-{daemon,web}to start the panel service.
  • Use systemctl enable mcsm-{daemon,web}.serviceto enable autostart
  • The panel code and operating environment are automatically installed in /opt/mcsmanager/the directory .

Configuration file directory:data/SystemConfig/config.json

User data file directory:data/User/*.json

Remote daemon configuration file directory:data/RemoteServiceConfig/*.json

After the installation is complete, visit http://your server's ip:23333/ to enter the panel.

  • Default account: root
  • Default password: 123456

Linux manual installation

  • If one-click installation does not work, you can try this step to install manually.
# 切换到安装目录,没有此目录请执行 mkdir /opt/
cd /opt/
# 下载运行环境(已有 Node 14+ 可忽略)
wget https://npm.taobao.org/mirrors/node/v14.17.6/node-v14.17.6-linux-x64.tar.gz
# 解压文件
tar -zxvf node-v14.17.6-linux-x64.tar.gz
# 链接程序到环境变量中
ln -s /opt/node-v14.17.6-linux-x64/bin/node /usr/bin/node
ln -s /opt/node-v14.17.6-linux-x64/bin/npm /usr/bin/npm

# 准备安装目录
mkdir /opt/mcsmanager/
cd /opt/mcsmanager/

# 下载面板端(Web)程序
git clone https://github.com/MCSManager/MCSManager-Web-Production.git
# 重命名文件夹并进入
mv MCSManager-Web-Production web
cd web
# 安装依赖库
npm install --registry=https://registry.npm.taobao.org

# 返回上级目录
cd ..
# 下载守护进程(Daemon)程序
git clone https://github.com/MCSManager/MCSManager-Daemon-Production.git
# 重命名文件夹并进入
mv MCSManager-Daemon-Production daemon
cd daemon
# 安装依赖库
npm install --registry=https://registry.npm.taobao.org

# 安装nano编辑器
apt install nano

Then configure the Systemd service

Run the command nano /etc/systemd/system/mcsm-web.serviceto edit the service of the web panel, enter the following content, then press Ctrl + O and press Enter to save, and then press Ctrl + X to exit.

# /etc/systemd/system/mcsm-web.service
[Unit]
Description=MCSM 9 Web

[Service]
WorkingDirectory=/opt/mcsmanager/web
ExecStart=/usr/bin/node app.js

[Install]
WantedBy=multiuser.target

Run the command nano /etc/systemd/system/mcsm-daemon.serviceto edit the service of the web panel, enter the following content, then press Ctrl + O and press Enter to save, and then press Ctrl + X to exit.

# /etc/systemd/system/mcsm-daemon.service
[Unit]
Description=MCSM 9 Daemon

[Service]
WorkingDirectory=/opt/mcsmanager/daemon
ExecStart=/usr/bin/node app.js

[Install]
WantedBy=multiuser.target

Then start the service and set the boot to start automatically

# 重新载入变更
systemctl daemon-reload

# 设置开机自启
systemctl enable mcsm-{
    
    daemon,web}.service

# 启动服务
systemctl start mcsm-{
    
    daemon,web}.service

# 停止服务,正常情况不要运行此命令
systemctl stop mcsm-{
    
    web,daemon}.service

# 显示运行状况和日志
systemctl status mcsm-web.service
systemctl status mcsm-daemon.service -l

# 默认情况下,面板端会自动扫描 daemon 文件夹并且自动连接到守护进程。

If you do not see the daemon process after logging in to the panel, you can run the following command to get the key, and then manually add it to the panel as shown in the figure below.

cat /opt/mcsmanager/daemon/data/Config/global.json

127.0.0.1 in the picture below should be changed to your server public network IP or localhost

Install Docker

Install with apt package manager:

# 安装docker
apt install docker.io

# 设置docker开机自启和启动docker
systemctl enable docker && systemctl start docker

# 检查是否安装成功,若安装成功会显示 Docker version x.x.x
docker -v

If the installation is not successful, try the following installation script:

# 安装docker
curl -sSL https://get.daocloud.io/docker | sh

# 设置docker开机自启和启动docker
systemctl enable docker && systemctl start docker

# 检查是否安装成功,若安装成功会显示 Docker version x.x.x
docker -v

If it still doesn't work, try the manual installation tutorial linked below

Docker manual installation tutorial: https://url.zeruns.tech/docker

Docker to domestic source

# 创建或修改 /etc/docker/daemon.json 文件
apt install nano && nano /etc/docker/daemon.json

# 然后输入下面内容:(输入完后按Ctrl+O,然后回车保存,接着按Ctrl+X退出编辑器)
{
    
    
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

# 重启docker服务
systemctl restart docker.service

Install the JDK image

Enter the panel, find the environment image management and click to enter

Click New Image, and then click Create OpenJDK 17 Environment Image (JDK8 is selected for versions 1.12.2 and below; JDK16 is selected for 1.17; JDK17 is selected for 1.18 and above; JDK11 is required for 1.16.5, because there is no option for JDK11, you need to change it yourself, select That JDK17 and then change the 17 inside to 11)


Click OK and wait for the build to complete


run server

First of all, we need to download a server core (.jar format). Here I take mohist1.18.2 as an example.

mohist official website: https://url.zeruns.tech/Lesn7

Mohist1.18.2 Baidu network disk download address: https://url.zeruns.tech/QKjqk Extraction code: ek8a

Click Application Instance→New Instance→Java Edition Minecraft Server→Upload a single server software



Enter a name you want to set, start the command input java -server -jar { {ProgramName}} --install, and then click the upload server software below to select the jar file downloaded above.

This startup command is an installation command. Higher versions of forge, mohist, and fabric servers need to be installed first; official servers do not need to be installed first, but can be run directly, just remove the following command --install.

After the upload is complete, click Go to edit the specific parameters of the instance

Then select the virtualization container for the process startup method, select mcsm-openjdk:17 for the environment image, fill in 25565:25565/tcp for the open port, and click Save in the lower right corner after filling it out.

Then go to the instance console and click to start the instance , and wait for the installation to complete. The domestic server may fail to download.

If the download and installation fails, download the compressed package linked below. I have already run and installed this compressed package. Upload the compressed package to the server and decompress it. Change the startup command to , and then start the instance bash run.sh.

mohist1.18.2 Download the compressed package of the library file: https://url.zeruns.tech/31Tgt Extraction code: c45w

If the download and installation is successful, click File Management and a file will appear here run.sh, as shown in the figure below

Then go to the instance settings and change the start command to bash run.shsave , and answer the instance console to start the instance again .

If this line of information appears, you need to modify the eula.txt file to agree to the eula agreement.

Click on a specific configuration .

Then click Browse under [General] eula.txt , change the No of eula to Yes , then click to save the configuration, then click to return to the configuration file list and return to the console.

Click again to start the instance . If Done appears, it means the server is started successfully.

Click Specific Configuration → [General] server.properties, and then you can modify the server settings. For non-genuine users, remember to set Online Genuine Verification to No, and click Save after the settings are completed. If you want to modify the port, you have to go to the instance settings to modify the open port after modifying the configuration file here.

After modification, restart the instance.


enter the game

Click Add Server in the game and enter the public IP of your server. If you change the port, you need to add the port number.

recommended reading

Guess you like

Origin blog.csdn.net/u012513463/article/details/125813293