Preface#
Starting a Linux server is also very simple, with low memory usage, recommended for use. Below is a demonstration using Ubuntu 18.04.1.
You can play without a legitimate account.
Bedrock Edition protocol is UDP, default port 19132.
Java Edition protocol is TCP, default port 25565.
-
minebbs: https://www.minebbs.com/
-
mod encyclopedia: https://www.mcmod.cn/
-
mc navigation site: https://www.mcnav.net/
-
panel server: https://mcsmanager.com/
Launchers (including various versions)
-
pcl2 launcher: https://afdian.net/p/0164034c016c11ebafcb52540025c377
-
hcml launcher: https://hmcl.huangyuhui.net/
-
official launcher: https://www.minecraft.net/zh-hans/download/alternative
In the Minecraft server, the most important part is the server core, which usually falls into the following categories:
-
Minecraft original core
-
Minecraft pure plugin core
-
Minecraft pure MOD core
-
Minecraft plugin MOD hybrid core
Plugins are additional components that can help server owners manage their servers, and they do not need to be installed on the client.
Compared to plugins, MODs need to be added to both the server and the client to be used. If added only to the server, the client will not be able to enter the server. If added only to the client, the client can enter the server, but the MOD will not take effect (auxiliary types are another matter, such as mini-maps, item display at the top, Xray, etc., here only refers to personal functional types).
Currently, the mainstream server types for Minecraft Java Edition include: (I won't list some that I haven't learned about)
Core Name | Description | Address |
---|---|---|
Original server | Official server, pure server, cannot add plugins, can add Mod after installing forge, less customizable content | https://mcversions.net |
Bukkit, CraftBukkit (bucket server) | A relatively original plugin server, does not support adding Mod, but can add Bukkit plugins. It can use CraftBukkit plugins, but its compatibility with Spigot plugins is poor. It can only add CraftBukkit plugins and some Spigot plugins | https://getbukkit.org/download/craftbukkitt |
Spigot (spigot) | Spigot is optimized for Bukkit, supports adding Bukkit plugins, but does not support adding Mod, with good stability | https://getbukkit.org/download/spigott |
Paper (paper spigot) | Paper is optimized for Spigot, supports CraftBukkit and Spigot plugins, but does not support adding Mod, with TPS optimization. The core before version 1.9.x has built-in anti-cheat features, which were removed after 1.9.x | https://papermc.io/ |
MCPC+ | Can install Mod and Bukkit plugins, optimized but not very useful. Only supports JAVA7, maximum supported version 1.7.10 | https://sourceforge.net/projects/cauldron-unofficial/files/old_releases/version_1/ |
KCauldron (KC version) | KC version, can install Mod and Bukkit plugins, optimized compared to MCPC+, Cauldron, and Thermos, consumes less memory, but only supports up to version 1.7.10 | https://sourceforge.net/projects/kcauldron/ |
Thermos (bottle version) | An optimized version of KCauldron, more stable than the original Cauldron, can add MOD and Bukkit plugins, maximum supported version 1.7.10 | https://cyberdynecc.github.io/Thermos/install |
Contigo (cup version) | The son of Thermos, with many optimizations, server lag optimizations, multi-threaded calculations, lower latency, better world protection (items called by Forge do not go through Bukkit plugins!) | https://github.com/djoveryde/Contigo |
Uranium (uranium version) | An optimized version of KC, multi-threaded calculations, higher efficiency, supports Bukkit plugins and ForgeMOD, maximum supported version 1.7.10 | https://www.uraniummc.cc/ |
Catserver (cat version) | A generation of server developed by Chinese developers, supports ForgeMOD and Bukkit/Spigot plugins, and has optimized multi-threading, version 1.12.2 | https://catmc.org/ |
Mohist (ink version) | Can add both mods and plugins, compatible with some Paper plugins, can run without a large server, and comes with multi-threading, but many plugins and some mods are not supported | https://mohistmc.com/ |
Arclight (conch version) | Can add both mods and plugins, server network environment is not very good, downloading necessary libraries is quite tedious | https://github.com/IzzelAliz/Arclight/releases |
Magma | A 1.12.2 server based on Forge and CraftBukkit, using Forge mods and Bukkit plugins, will later support 1.14 & 1.15 | https://magmafoundation.org/ |
Sponge Forge (sponge version) | Has its own plugin system, can use Mod and Sponge plugins together in versions 1.8 and above | https://www.spongepowered.org/ |
Sponge Vanilla (sponge vanilla version) | Supports Sponge plugins, does not support ForgeMOD, occupies less memory, low configuration requirements | https://www.spongepowered.org/ |
Glowstone (glowstone) | A completely open-source server that supports Bukkit plugins. Version 1.12.2 | https://www.glowstone.net/ |
Java Download (Mirror Sites):#
Users are advised to download from mirror sites (recommended to use Code Repository, which I think is more comprehensive).
-
Code Repository: http://www.codebaoku.com/jdk/jdk-index.html
-
injdk: https://www.injdk.cn/
-
Tsinghua University mirror site: https://mirrors.tuna.tsinghua.edu.cn/Adoptium
-
Huawei mirror site: https://repo.huaweicloud.com/java/jdk/
MC versions and corresponding Java versions:
-
1.7.X —— jdk8
-
1.8.X —— jdk8/11
-
1.12.X —— jdk8/11
-
1.16.X —— jdk16/11
-
1.17.X —— jdk16 and above
-
1.18.X —— jdk17
Ubuntu can directly install jdk using the apt repository.
Now let's demonstrate starting a server using the catserver version:
Catserver is the first server I used to start, and I think it is quite good. Although Catserver has a dark history, it does not affect my usage at all. It is well known that the two most prosperous versions for mods are 1.7.10 and 1.12.2, and since the new version has richer content, I directly chose Catserver (note: each version and core has its own significance, do not belittle other servers to promote your choice).
Simple Tutorial:#
Command to install JDK8, command to download Catserver, command to start.
Detailed Tutorial:#
- Prepare the server:
You need to prepare the server (Linux systems like Ubuntu, Debian, CentOS are fine). I recommend using a server because it runs 24 hours a day and is stable. The official recommended server is Ubuntu, and I am using version Ubuntu 18.04.1.
- Open the port:
Choose the protocol based on the server's protocol (for example, Java Edition uses TCP protocol). The default port for Java Edition is 25565. Some Ubuntu installations may have the firewall enabled, which can be turned off or you can choose to allow the port (how to do this will be explained later).
The default login account is Ubuntu.
- Check the current firewall status; inactive means off, active means on. 【
centos: firewall-cmd --state
】
sudo ufw status
- Turn off the firewall (if it is not on, you do not need to execute this), 【
centos: systemctl stop firewalld
】
sudo ufw disable
- Check which JDK versions are available in the apt repository, 【
centos: yum search java|grep jdk
】
apt-cache search java|grep jdk
- Install the Java environment, you will need to input y to confirm again, 【
centos: yum install java-1.8.0-openjdk
】
sudo apt-get install openjdk-8-jdk
Please refer to the postscript section for recommendations on Java environment versions; here OpenJDK8 is not recommended.
- Check if JDK is installed successfully.
java -version
- Create an empty directory (cat is the directory name, can be anything).
mkdir /home/ubuntu/cat
- Enter the directory.
cd /home/ubuntu/cat
- Download the server package, open the Catserver official website to get the download link, 【
centos: yum -y install wget
】
wget https://luohuayu.coding.net/p/CatServerRes/d/CatServerRes/git/raw/master/serverjar/CatServer-a8b73e9-universal.jar
- Run it once to download the necessary files.
java -jar CatServer-a8b73e9-universal.jar
- Ignore this step for the Catserver version The official server package will generate an
eula.txt
file upon first run.
Enter vim eula.txt
, then press the i key to enter edit mode, change eula=false
to true
.
Then press the esc
key.
Enter :wq
and press enter (don't forget the colon).
-
Enter
stop
and press enter to stop running. -
Disable the legitimate verification by changing
online-mode=true
in theserver.properties
file tofalse
.
I have learned a bit of basic Linux, so I prefer to modify it directly using commands (faster and more efficient). Of course, you can choose to install a panel for visual file management, which is suitable for beginners.
- First, I will introduce how to modify it directly using commands, you can use the
tab
key for auto-completion.
vim /home/ubuntu/cat/server.properties
- Press the i key or ins key to enter edit mode, move the cursor to
online-mode=true
and changetrue
tofalse
.
Then press the esc
key.
Enter :wq
and press enter (don't forget the colon).
- Next, create a screen (cat is the window name, can be anything) 【
centos: yum install screen
】
screen -S cat
- Start the server; if the following information is displayed, it proves that the server has started successfully.
java -jar CatServer-a8b73e9-universal.jar
Then you can execute server owner commands, such as op {player id}
to give a player admin privileges (the player needs to be online).
- Next, connect to the world to test it, enter the public IP, the port is the default 25565 (you can omit the port unless you changed it to another port).
- Press Ctrl+A+D to detach the window, then check if the screen is normal.
screen -ls
Ok, no problem. At this point, the SSH connection software can be closed.
Configuration:#
The server.properties configuration file, official documentation: https://minecraft.fandom.com/wiki/Server.properties
generator-settings= # Used to customize the generation of flat worlds
op-permission-level=4 # Set OP's permission level #1 – OP can ignore spawn protection #2 – OP can use commands like /clear, /gamemode, /tp, etc., can edit command blocks #3 – OP can use commands like /ban, /deop, /kick, and /op #4 – OP can use the /stop command
allow-nether=true # Whether to enable the Nether world (if disabled, the Nether world will not be generated)
level-name=world # Main world name
enable-query=false # Whether to enable GameSpy4 protocol server listener to obtain server information, recommended not to modify
allow-flight=false # Allow players to fly in survival mode with the prerequisite of having a flying mod installed.
prevent-proxy-connections=false # If enabled, players will be kicked out if the ISP/AS of the server differs from that of Mojang's verification server.
server-port=25565 # Server port number
max-world-size=29999984 # Set the maximum radius value for the world boundary, in blocks. Successful execution of commands can set the world boundary larger, # but it will not exceed the maximum block limit set here. If the max-world-size set exceeds the default size, it will have no effect.
level-type=DEFAULT # Determine the type of map generated #DEFAULT – standard world #FLAT – flat world #LARGEBIOMES – preset world, but all biomes are larger (only available after snapshot 12w19a or official version 1.3) #AMPLIFIED – preset world, but world generation height is increased (only available after snapshot 13w36a or official version 1.7.2) #CUSTOMIZED – since snapshot 14w21b, servers also support custom terrain. The method is to paste the code in generator-settings
enable-rcon=false # Whether to allow remote access to the server console.
force-gamemode=false # Force players to change to the default game mode when joining the server
level-seed= # World seed
server-ip= # Bind the server to a specific IP. It is recommended to leave it blank, or fill in the domain name you want the server to bind to.
network-compression-threshold=256 # By default, allows n-1 bytes of packets to be sent normally. If the packet is n bytes or larger, it will be compressed. # Therefore, a lower value will cause more packets to be compressed, but if the compressed packet bytes are too small, it will be counterproductive. #-1 – permanently disable packet compression #0 – compress all packets #(recommended between 64-1500)
max-build-height=256 # Maximum height players can build in the game
spawn-npcs=true # Decide whether to generate villagers
white-list=false # Server whitelist, OP does not need to join the whitelist
spawn-animals=true # Whether animals can spawn
snooper-enabled=true # Once enabled, it will allow the server to periodically send statistical data to http://snoop.minecraft.net.
hardcore=false # Hardcore mode (if enabled, players will be banned from the server after dying)
resource-pack-sha1= # SHA-1 value of the resource pack, must be in lowercase hexadecimal
online-mode=false # Whether to enable legitimate verification
resource-pack= # You can enter a URI pointing to a resource pack. Players can choose whether to use this resource pack
pvp=true # Whether players can fight
difficulty=1 # Set the difficulty of the game (peaceful (0)= peaceful, easy (1)= easy, normal (2)= normal, hard (3)= hard)
enable-command-block=false # Whether to enable command blocks
player-idle-timeout=0 # When entering AFK mode, kick out of the server after the specified time, set to 0 to not kick out
gamemode=0 # Set the player's game mode (survival (0)= survival, creative (1)= creative, adventure (2)= adventure, spectator (3)= spectator)
max-players=20 # Maximum number of players
max-tick-time=60000 # Set the maximum milliseconds spent per tick
spawn-monsters=true # Whether to spawn monsters
view-distance=10 # Set the number of chunks sent from the server to the client (range 3-15) # Reducing this value can effectively alleviate lag
generate-structures=true # Define whether to generate structures (like villages) when generating the world
motd=A Minecraft Server # Server information displayed in the multiplayer server list on the player client, shown below the name. Chinese needs to be encoded.
Catserver folder structure
Catserver folder structure
├─config // Some settings for mods
├─libraries // Some support libraries
├─logs // Folder for storing server logs
├─mods // Folder for storing mods
├─plugins // Folder for storing plugins
└─bStats // Folder for storing plugin configuration
└─world // World folder
├─data // World data folder
│ ├─advancements
│ └─functions
├─DIM-1 // World within the world #funny
│ ├─data
│ │ └─functions
│ ├─playerdata
│ └─region
├─DIM1
│ ├─data
│ │ └─functions
│ ├─playerdata
│ └─region
├─playerdata // Player data folder
└─region
├─banned-ips.json // Stores the UUID and game name of banned IP players and other related information.
├─banned-players.json // Stores the UUID and game name of banned ID players and other related information
├─bukkit.yml // A file that all servers derived from Bukkit have. It saves the most basic settings options provided by Bukkit.
├─catserver.yml // This is a configuration file that only Paper has, and you generally won't see it in Bukkit or Spigot.
├─CatServer-a8b73e9-universal.jar // Server core
├─commands.yml // It provides a quick and easy way to force the server to use the commands provided by Mojang (instead of the built-in commands in Bukkit) without conflicts.
├─eula.txt // When starting the server for the first time, we need to agree to the EULA agreement.
├─help.yml // Some help information for plugins will appear here, generally does not need to be modified.
├─ops.json // OPs' game nicknames, UUID, etc. will appear here.
├─permissions.yml // The default permission definition YAML file, automatically generated at startup. Its main function is to combine permission nodes into a file so that permission plugins (and plugins using permissions) can use it throughout the system.
├─server.properties // Basic settings of the server are in here, such as setting the port, setting the game difficulty, setting the game mode (survival, creative, etc.).
├─spigot.yml // This is a configuration file that only Spigot has, and you generally won't see it in Bukkit. Since Paper is derived from Spigot, it will also appear in the Paper server.
├─usercache.json // Cache file storing some user information.
├─version_history // Some version information of Minecraft and server cores.
├─whitelist.json // Whitelist list. (If you enable the whitelist in server.properties, you can add and manage who is allowed or not allowed to enter the server in this file.)
More settings about screen#
If you want to resume executing Minecraft commands in the background, just enter
screen -r cat
If you want to shut down the server, you can execute the following command to kill the screen named mc outside of the screen.
screen -S cat -X quit
More settings about Ubuntu firewall#
- To enable the firewall, you need to input y to confirm.
sudo ufw enable
- Allow the firewall to open the port.
sudo ufw allow/deny 19132
// Allow/deny access to port 19132, you can follow 19132 with /tcp or /udp to indicate TCP or UDP packets.
- After allowing, you need to restart the firewall to take effect.
sudo ufw reload
Install 1Panel#
Official website: https://1panel.cn/
Ubuntu installation command:
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sudo bash quick_start.sh
Postscript#
Due to updates in Minecraft, many friends will choose the latest version to start a server, so I recommend installing OpenJDK17.
sudo apt-get install openjdk-17-jdk
If the server configuration is less than 2 cores and 2GB, it is not recommended to start a server, as it may lead to memory overflow and server startup failure.
This article was synchronized and updated by Mix Space to xLog. The original link is https://fmcf.cc/posts/technology/Minecraft-Java-Server-Ubuntu