The process may look technical at first, but it's much easier when broken into simple steps. This guide explains everything from installing Java to configuring firewall ports and starting your Minecraft server.
Why Choose CentOS Stream 9 for a Minecraft Server?
CentOS Stream 9 is a stable Linux distribution that works well for hosting game servers. It receives continuous updates while maintaining compatibility with enterprise-grade software.
Some advantages include:
Stable and reliable performance
Efficient resource usage
Strong security features
Easy package management with DNF
Excellent compatibility with Java applications
What You'll Need Before You Begin
Before starting your Minecraft server setup CentOS, make sure you have:
A CentOS Stream 9 VPS or dedicated server
SSH access to your server
A non-root user with sudo privileges
At least 2 GB RAM (4 GB or more is recommended for multiple players)
Internet connectivity
Basic familiarity with terminal commands
Step 1: Update Your CentOS Stream 9 System
sudo dnf update -y
Keeping your system updated helps improve stability and reduces compatibility issues before installing new software.
Step 2: Install Java
Minecraft Java Edition requires Java to run.
Install OpenJDK:
sudo dnf install java-21-openjdk -y
Verify the installation:
java -version
If Java is installed correctly, you'll see version information displayed in the terminal.
Step 3: Create a Dedicated Minecraft User
Running the server under its own user account improves security.
Create a new user:
sudo useradd -r -m minecraft
Switch to the account:
sudo su - minecraft
Create a server directory:
mkdir minecraft-server
cd minecraft-server
Step 4: Download the Minecraft Server JAR
Visit the official Minecraft download page and copy the latest server JAR link.
Download it using:
wget https://example-url/server.jar
Rename it for convenience:
mv server.jar minecraft_server.jar
Replace the example URL with the latest download link from Minecraft's official website.
Step 5: Accept the Minecraft EULA
Generate the required files:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
Open the generated file:
nano eula.txt
Change:
eula=false
to:
eula=true
Save and exit.
Step 6: Create a Startup Script
Create the file:
nano start.sh
Add:
#!/bin/bash
java -Xms2G -Xmx2G -jar minecraft_server.jar nogui
Save the file.
Make it executable:
chmod +x start.sh
Now you can simply run:
./start.sh
Step 7: Configure the Firewall
Minecraft uses TCP port 25565 by default.
Allow the port:
sudo firewall-cmd --permanent --add-port=25565/tcp
Reload the firewall:
sudo firewall-cmd --reload
Verify:
sudo firewall-cmd --list-ports
Players can now connect through your server's public IP address.
Step 8: Customize Server Settings Minecraft generates a file called: server.properties Some useful settings include:
Edit using:
nano server.properties
Save the file after making changes.
Step 9: Start Your Server
Launch the server:
./start.sh
The first startup may take several minutes while Minecraft generates the world.
Once complete, you'll see: Done!
Players can then connect using your server's IP address.
Real-World Example 1
A small group of college friends wanted a private survival world where they could build together every weekend. Instead of joining crowded public servers, they hosted their own Minecraft server on a CentOS VPS, allowing them to control player permissions, backups, and world settings.Real-World Example 2
A teacher created a Minecraft Education-style building challenge for students. Hosting the server on CentOS allowed everyone to join the same world remotely without depending on third-party public servers.Managing Your Minecraft Server
Once your server is running, a few routine tasks help keep it healthy:
Restart after updates
Create regular world backups
Monitor available RAM
Remove unused plugins
Keep Java updated
Simple maintenance prevents many common issues.
For readers interested in older CentOS versions, this guide on Minecraft server setup on CentOS explains a similar installation process with CentOS 9Common Mistakes to Avoid
Many beginners encounter the same issues during installation.
Running as Root
Avoid hosting the Minecraft server as the root user. A separate account provides better security.Forgetting the EULA
The server will not start until eula=true is set.
Firewall Not Configured
Opening port 25565 is essential. Otherwise, players cannot connect even if the server is running.Allocating Too Much RAM
Giving Minecraft all available memory can slow down the operating system. Leave enough RAM for CentOS.Skipping Updates
Outdated Java or system packages may cause compatibility issues with newer Minecraft versions.Frequently Asked Questions
1. Is CentOS Stream 9 good for hosting Minecraft?Yes. It offers stability, regular updates, and good performance for Java-based applications like Minecraft.
2. How much RAM should I allocate?
For a small group of friends, 2 GB is usually sufficient. Larger servers with many players or mods often benefit from 4 GB or more.
3. Can I install mods later?
Yes. Many administrators switch to server software such as Paper or Forge depending on the type of modifications they want to use.
4. Do I need a dedicated server?
Not necessarily. A VPS is suitable for many personal Minecraft servers. Larger communities may eventually require dedicated hardware.
5. Why can't my friends join my server?
Check that the firewall allows port 25565, confirm the server is running, and verify that you're sharing the correct public IP address.
6. How do I keep my world safe?
Create regular backups of the world folder before updates or configuration changes. This makes recovery much easier if something goes wrong.
Conclusion
Learning Minecraft server setup CentOS gives you complete control over your Minecraft experience. By installing Java, downloading the server files, creating a startup script, and configuring firewall access, you can build a reliable private server that friends or family can join whenever they want.If you'd like to explore server options and learn more about choosing the right environment for hosting multiplayer games, take a look at game VPS hosting for additional resources and guidance.