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 website: 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; they do not need to be installed on the client.
Compared to plugins, MODs need to be added to both the server and client to work. 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 function (excluding auxiliary types like mini-maps, item display at the top, Xray vision, etc., which refer only to personal functional types).
Currently, the mainstream Java Edition server cores are: (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 primitive plugin server, does not support adding Mod, but can add Bukkit plugins; it can use CraftBukkit plugins, but it has poor compatibility with Spigot plugins; 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, 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, removed after 1.9.x | https://papermc.io/ |
MCPC+ | Can install Mod and Bukkit plugins, optimized but not very useful. Only supports JAVA7, highest 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, Thermos, consumes less memory, but only supports up to version 1.7.10 | https://sourceforge.net/projects/kcauldron/ |
Thermos (thermos version) | An optimized version of KCauldron, more stable than the original Cauldron, can add MOD and Bukkit plugins, highest supported version 1.7.10 | https://cyberdynecc.github.io/Thermos/install |
Contigo (cup version) | The son of Thermos, with most 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, highest supported version 1.7.10 | https://www.uraniummc.cc/ |
Catserver (cat version) | A generation 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; many plugins are not supported, 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 cumbersome | https://github.com/IzzelAliz/Arclight/releases |
Magma | A 1.12.2 server based on Forge and CraftBukkit, using Forge's 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 find quite 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:
The cat version is the first version I used to start a server, and I think it is quite good. Although the cat version has a dark history, it does not affect my usage at all. It is well known that the two most prosperous mod versions are 1.7.10 and 1.12.2; the new version has richer content, so I chose catserver directly (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 all fine) yourself (I recommend using a server because it runs 24 hours a day and is stable). Use the officially recommended Ubuntu to start the server; I am using 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 systems may have the firewall enabled; you can either turn it off or 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 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, and 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 on the 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 modifying 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 means 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, you can close the SSH connection software.
Configuration:#
The server.properties configuration file, official documentation: https://minecraft.fandom.com/wiki/Server.properties
generator-settings= # Used to customize the generation of superflat worlds
op-permission-level=4 # Set OP's permission level #1 – OP can ignore spawn point protection #2 – OP can use commands like /clear, /gamemode, /tp, etc., can edit command blocks #3 – OP can use /ban, /deop, /kick, and /op commands #4 – OP can use /stop command
allow-nether=true # Whether to enable the Nether world (if closed, 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, it is recommended not to modify
allow-flight=false # Allow players to fly in survival mode with the prerequisite of installing flying mods.
prevent-proxy-connections=false # If the ISP/AS of the server sending the request is different from Mojang's verification server, the player will be kicked out.
server-port=25565 # Server port number
max-world-size=29999984 # Set the maximum radius value of the world boundary, in blocks. The world boundary can be set larger through successfully executed commands, # but it will not exceed the maximum block limit set here. If the set max-world-size exceeds the default size, it will have no effect.
level-type=DEFAULT # Determine the type of map generated #DEFAULT – standard world #FLAT – superflat world #LARGEBIOMES – preset world, but all ecosystems are larger (only available in snapshot 12w19a or official version 1.3 and later) #AMPLIFIED – preset world, but the world generation height is increased (only available in snapshot 13w36a or official version 1.7.2 and later) #CUSTOMIZED – since snapshot 14w21b, the server also supports 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 # The 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 game's difficulty (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 from the server within the specified time; set to 0 to not kick from the server
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 on each 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 supporting libraries
├─logs // Folder storing server logs
├─mods // Folder storing mods
├─plugins // Folder storing plugins
└─bStats // Folder storing some 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 names of banned IP players and other related information.
├─banned-players.json // Stores the UUID and game names 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; 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 commands provided by Mojang (instead of 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 no need for modification.
├─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 one file so that permission plugins (and plugins using permissions) can use it throughout the system.
├─server.properties // Basic settings of the server are inside, such as setting the port, setting the game difficulty, setting the game mode (survival, creative, etc.), etc.
├─spigot.yml // This is a configuration file that only Spigot has; you generally won't see it in Bukkit. Since Paper is derived from Spigot, it will also appear in Paper servers.
├─usercache.json // Cache file storing some user information.
├─version_history // Some version information of Minecraft and server cores.
├─whitelist.json // Whitelist list. (If you have enabled 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 the server's background execution of Minecraft commands, 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; after 19132, you can add /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 to xLog by Mix Space. The original link is https://fmcf.cc/posts/technology/Minecraft-Java-Server-Ubuntu