
Minecraft was first launched back in 2009 and lets players build, explore, craft, and survive in a 3D-generated block world. It was among the most successful video game developed as of early 2022.
The server administrator can set the rules and participate in this interactive adventure game with friends by running their own Minecraft server.
Setting up server
Log in as a root user.
Update the server. Use the following command.
# yum update -y

Create a new folder named minecraft in the home directory and change the directory to minecraft with the below commands.
# mkdir /home/minecraft
# cd /home/minecraft/

Downloading Java
Copy the download link for the latest version of java from the below page.
https://www.oracle.com/java/technologies/javase/jdk18-archive-downloads.html

Download the supported package using wget command. In this case, we are using CentOS 8 and downloading the rpm package. The command is as follows.
# wget https://download.oracle.com/java/18/archive/jdk-18.0.2.1_linux-aarch64_bin.rpm

Install downloaded jdk-18_linux-x64_bin.rpm using the rpm command.
# rpm -ivh jdk-18.0.2.1_linux-aarch64_bin.rpm

Run the below command to verify the version.
# java --version

Installing Minecraft server
Copy the latest Minecraft Server download link from the following website.
https://www.minecraft.net/en-us/download/server

Run the below command to download the Minecraft Server. Make sure to download using the latest download link.
# wget https://piston-data.mojang.com/v1/objects/f69c284232d7c7580bd89a5a4931c3581eae1378/server.jar

Install the Minecraft server using the following command.
# java -Xmx1024M -Xms1024M -jar minecraft_server.1.19.2.jar nogui

Once the installation is completed, edit the eula.txt file.
# vim eula.txt

Change the eula=false to eula=true.

Run the below commands to open ports in the firewall and reload to effect the changes.
# firewall-cmd --permanent –zone=public --add-port=25565/tcp
# firewall-cmd --permanent --zone=public --add-port=25565/udp
# firewall-cmd --reload

Once firewall ports are configured, run the below command to start Minecraft server.
# java -Xmx1024M -Xms1024M -jar minecraft_server.1.19.2.jar nogui

The Minecraft server is ready and running. Now the user may log in to the Minecraft game and connect using the server IP. This is the better way to start with.
Related Tutorials