Introduction:
Minecraft, the beloved sandbox game, has a vast community of players who enjoy exploring and creating in its blocky world. If you’re passionate about Minecraft and want to host your own server on a CentOS 8 server, this article will guide you through the process. By the end, you’ll have your very own Minecraft server up and running, ready for friends and fellow gamers to join.
Step 1: Prerequisites
Before diving into hosting a Minecraft server, ensure you have the following:
- A CentOS 8 server (either physical or virtual) with root access.
- A stable internet connection with port forwarding enabled if you want others to join.
- Java installed on your CentOS server. You can install it using the following command:
sudo dnf install java
Step 2: Create a Directory for Your Server
Choose a directory to store your Minecraft server files. It’s a good practice to create a dedicated directory for this purpose. For example:
mkdir ~/minecraft_server
cd ~/minecraft_server
Step 3: Download the Minecraft Server Files
Visit the official Minecraft website (https://www.minecraft.net/en-us/download/server) to download the latest server version (JAR file). You can use wget
to download it directly on your server:
wget https://launcher.mojang.com/v1/objects/your_version_here/server.jar
Replace “your_version_here” with the actual version number.
Step 4: Accept the Minecraft EULA
Minecraft requires you to accept their End User License Agreement (EULA) before you can run the server. Open the eula.txt
file with a text editor and change eula=false
to eula=true
to accept the agreement:
nano eula.txt
Step 5: Configure the Minecraft Server
Create a new script file to start your Minecraft server. Use a text editor to create a file named start.sh
:
nano start.sh
Add the following content, adjusting the RAM allocation as needed:
#!/bin/bash
java -Xmx2G -Xms1G -jar server.jar nogui
Save the file and make it executable:
chmod +x start.sh
Step 6: Start the Minecraft Server
You can now start your Minecraft server:
./start.sh
The server will generate necessary files and configurations. You can stop the server at any time by typing stop
in the server console.
Step 7: Connect to Your Server
To connect to your Minecraft server, launch the Minecraft game on your computer, click “Multiplayer,” and then “Add Server.” Enter your server’s IP address or domain name. If you’ve set up port forwarding on your router, others can join using your public IP address.
Conclusion
Congratulations! You’ve successfully hosted a Minecraft server on your CentOS 8 server. You can now enjoy the game with friends and customize your server to create your unique Minecraft world. Remember to keep your server updated and secure to ensure a smooth and enjoyable gaming experience for all players.