How to Build and Host Your Own Minecraft Server on CentOS Stream 9
- Onlive Server
- 2 days ago
- 5 min read
Minecraft is even more enjoyable when you have your own private world where you control the rules, invite friends, and customize gameplay. A Minecraft server setup CentOS environment gives you that freedom while also helping you learn basic Linux server management. The process may look technical at first, but when broken into small steps, it's much easier than most beginners expect.
This guide explains how to install Java, download the Minecraft server files, configure your server, create a startup script, and open the required firewall ports. By the end, you'll have a working Minecraft server running on CentOS Stream 9 that you can manage with confidence.

Why Choose CentOS Stream 9 for a Minecraft Server?
CentOS Stream 9 is a modern, enterprise-grade Linux operating system that serves as the upstream development platform for Red Hat Enterprise Linux (RHEL). Unlike running a game server on your everyday computer, a dedicated Linux server stays available even when your personal device is turned off.
Some advantages include:
Stable operating system with long-term support
Efficient use of system resources
Better uptime and modern kernel features
Easy remote management through SSH
Suitable for learning modern Linux server administration
Think of your Minecraft server as a small shop. Your home computer is like opening the shop only when you're awake. A virtual server keeps the shop open all day, allowing friends to join whenever they want.
What You'll Need Before Starting
Before beginning your installation, prepare the following:
A CentOS Stream 9 virtual server
Root or sudo access
A stable internet connection
Basic familiarity with the Linux terminal
At least 2 GB RAM for small multiplayer worlds (4 GB+ recommended for recent Minecraft versions)
For better multiplayer performance, many users choose reliable game VPS hosting because it offers dedicated resources for game servers without requiring expensive hardware.
1.Update Your CentOS Server:Prerequisite software updates.
Before installing anything, update your existing system packages using the modern dnf package manager:
Bash
sudo dnf update -y
This ensures your system has the latest security patches and core software updates.
2.Install Java:Required runtime environment.
Recent Minecraft Java Edition versions require Java 17 or Java 21 to run properly.
Install OpenJDK 21 on CentOS Stream 9:
Bash
sudo dnf install java-21-openjdk -y
After installation, verify it:
Bash
java -version
If the version number appears, Java has been installed correctly.
3.Create a Minecraft Directory:
Instead of placing files everywhere, keep everything organized in a dedicated directory:
Bash
mkdir ~/minecraft
cd ~/minecraft
This folder will store your server files, logs, and configuration.
4.Download the Minecraft Server JAR:
Visit the official Minecraft download page and copy the latest server JAR link.
Then download it using wget (if wget is missing, install it using sudo dnf install wget -y):
Bash
wget
Rename the downloaded file if needed:
Bash
mv server.jar minecraft_server.jar
Keeping consistent filenames makes future updates easier.
5.Accept the EULA:
Minecraft requires agreement to its End User License Agreement before the server starts. Run:
Bash
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
The server creates an eula.txt file. Open it using a text editor like nano:
Bash
nano eula.txt
Change:
eula=false
to
eula=true
Save and exit the file.
6.Start the Server Again:
Launch the server:
Bash
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
The first startup may take several minutes while Minecraft generates the game world.
After completion, you'll notice several new files and folders.
7.Create a Startup Script:
Typing the full Java command every time becomes repetitive. Create a startup script:
Bash
nano start.sh
Add the following lines:
Bash
#!/bin/bash
java -Xmx2G -Xms2G -jar minecraft_server.jar nogui
Save the file and make it executable:
Bash
chmod +x start.sh
Now your server starts simply with:
Bash
./start.sh
8.Configure the Firewall:Allowing incoming connections.
Minecraft uses port 25565 by default. Allow it through CentOS Firewall (firewalld):
Bash
sudo firewall-cmd --permanent --add-port=25565/tcp
sudo firewall-cmd --reload
Verify the rule:
Bash
sudo firewall-cmd --list-ports
If port 25565 appears, remote players can connect.
9.Customize Server Settings:
Open the configuration file:
Bash
nano server.properties
Here you can adjust settings such as server name, maximum players, difficulty level, world seed, PvP settings, view distance, and game mode to create anything from a peaceful family world to a competitive survival server.
Understanding the Installation Workflow
Step | Purpose |
Update CentOS | Installs latest security updates using dnf |
Install Java | Required runtime environment for modern Minecraft versions |
Download Server JAR | Installs the game server binaries |
Accept EULA | Enables server startup compliance |
Create Startup Script | Simplifies launching with customized RAM settings |
Configure Firewall | Allows external players to connect via port 25565 |
Edit Server Properties | Customizes gameplay rules and server limits |
Real-World Example 1
Imagine three classmates working together on a school project.
Instead of sending world files back and forth through email every day, they host one Minecraft server. Everyone joins the same world whenever they have free time, and progress is automatically saved on the server.
Real-World Example 2
A parent creates a private Minecraft server for two children.
Only invited players can connect, making it easier to supervise gameplay while avoiding large public servers filled with strangers.
Improving Performance
As more players join, server performance becomes increasingly important.

Consider these tips:
Allocate sufficient RAM (match it to your player count and world scale)
Avoid installing too many heavy plugins or mods
Restart the server occasionally to clear memory cache
Keep Java updated
Remove unused or old world backups from the disk
Monitor CPU and memory usage using native tools like top or htop
Good maintenance keeps gameplay smooth even during busy sessions.
Common Mistakes to Avoid
Many beginners encounter the same issues during setup:

Forgetting to Accept the EULA: The server will refuse to start until eula=true is explicitly set in eula.txt.
Installing the Wrong Java Version: Modern Minecraft requires Java 17 or higher. Always verify Java using java -version.
Firewall Not Configured: Even if the server starts successfully, friends cannot connect if port 25565 remains blocked by firewalld.
Running Everything as Root: Using a dedicated, non-root user account for running Minecraft improves system security.
Allocating Too Much RAM: Giving Minecraft nearly all available RAM leaves little room for OS background processes, which can cause severe lag or server crashes.
Frequently Asked Questions
Q. Can I host Minecraft on a CentOS Stream 9 VPS?
A. Yes. A VPS provides dedicated resources, a stable static IP, and remains online even when your personal computer is switched off.
Q. How much RAM do I need?
A. Small servers running standard vanilla gameplay with a few friends work well with 2 GB to 4 GB of RAM. Heavily modded worlds or large player bases will require 6 GB to 8 GB or more.
Q. Which port does Minecraft use?
A. The default Minecraft Java Edition server listens on TCP port 25565.
Q. Do I need a graphical desktop?
A. No. Most Minecraft servers run perfectly and efficiently directly from the command line using the nogui option.
Q. Can I install plugins later?
A. Yes. If you switch your server jar to software like Paper, Purpur, or Spigot, you can easily install plugins to add new gameplay features and administrative controls.
Q. Is CentOS Stream 9 difficult for beginners?
A. Not at all. Most setup tasks involve running standard commands via SSH, and managing the server day-to-day is very straightforward once set up.
Conclusion
A successful Minecraft server setup CentOS project doesn't require advanced Linux experience. By installing Java, downloading the server files, creating a startup script, configuring the firewall, and adjusting your server settings, you can host a stable multiplayer world for friends or family.
As you become more comfortable managing Linux, you can expand your server with plugins, backups, automated restarts, and performance optimizations. If you'd like to learn more about running multiplayer game servers on reliable virtual infrastructure, exploring game VPS hosting is a helpful next step.



Comments