How To Install Minecraft Server on Rocky Linux 10
Setting up a Minecraft server on Rocky Linux 10 provides an excellent foundation for hosting multiplayer gaming sessions with enhanced stability and security. Rocky Linux 10, as an enterprise-grade operating system, offers robust performance characteristics that make it ideal for game server hosting. With over 140 million active Minecraft players worldwide, the demand for reliable server infrastructure continues to grow exponentially.
This comprehensive guide walks you through the complete process of installing and configuring a Minecraft server on Rocky Linux 10. You’ll learn essential system administration tasks, security hardening techniques, and performance optimization strategies. Whether you’re hosting a small server for friends or managing a larger gaming community, Rocky Linux 10’s stability and security features provide the perfect platform for your Minecraft server deployment.
The enterprise-grade nature of Rocky Linux 10 ensures minimal downtime, excellent resource management, and comprehensive security features. By following this detailed tutorial, you’ll establish a professional-grade Minecraft server environment that can handle multiple concurrent players while maintaining optimal performance.
Prerequisites and System Requirements
Before beginning the Minecraft server installation process, ensure your Rocky Linux 10 system meets the necessary hardware and software requirements for optimal performance.
Hardware Requirements
Your server hardware directly impacts gameplay quality and the number of concurrent players your Minecraft server can support effectively. Minimum RAM requirements start at 2GB for small servers hosting 5-10 players, while 4-8GB provides better performance for larger communities. CPU performance significantly affects world generation, redstone mechanics, and overall server responsiveness. Modern multi-core processors handle Minecraft’s threading requirements more efficiently.
Storage considerations include allocating sufficient space for world data, player information, and server backups. A typical Minecraft world requires 50-100MB initially but grows substantially with player activity. Plan for at least 10-20GB of available storage space to accommodate world expansion, plugin data, and system requirements.
Software Prerequisites
Confirm your Rocky Linux 10 installation is current and properly configured before proceeding. Root access or sudo privileges are essential for installing packages, modifying system configurations, and managing services. Basic familiarity with Linux command-line operations streamlines the installation process significantly.
Verify your system’s package manager functionality and network connectivity. The DNF package manager handles software installation and updates efficiently on Rocky Linux 10 systems.
Network Requirements
Port 25565 serves as the default Minecraft server port and must remain accessible for client connections. Firewall configurations require careful attention to balance security with accessibility. Static IP addresses simplify server management and provide consistent connection endpoints for players.
Consider bandwidth requirements based on your expected player count. Each connected player typically consumes 50-100KB/s of bandwidth during active gameplay.
Step 1: System Update and Preparation
Maintaining current system packages ensures optimal security, stability, and compatibility with Minecraft server software. Rocky Linux 10’s package management system provides reliable update mechanisms for system maintenance.
Execute system updates using the DNF package manager to refresh all installed packages to their latest versions. This process addresses security vulnerabilities, bug fixes, and compatibility improvements that benefit server performance.
sudo dnf update -y
sudo dnf upgrade -y
The update process downloads and installs package updates automatically. Monitor the output for any error messages or dependency conflicts that require attention. Large update operations may take several minutes depending on your network connection and the number of packages requiring updates.
System reboot verification ensures all kernel updates and system changes take effect properly. Schedule reboots during maintenance windows to minimize disruption to any existing services.
sudo reboot
After rebooting, verify system functionality and package versions to confirm successful updates. Establishing regular update schedules maintains system security and performance over time.
Step 2: Installing Java Development Kit
Minecraft server software requires Java Runtime Environment functionality to execute properly. Java version compatibility directly affects server performance, feature availability, and plugin support capabilities.
Why Java is Required
Minecraft server architecture relies heavily on Java Virtual Machine capabilities for cross-platform compatibility and memory management. Current Minecraft server versions require Java 17 or higher for optimal performance and security. Java provides the runtime environment necessary for executing Minecraft’s server-side logic, world processing, and network communication protocols.
Installation Process
Rocky Linux 10’s package repositories include current OpenJDK versions that provide excellent compatibility with Minecraft server requirements. Install OpenJDK using the system package manager for optimal integration and automatic security updates.
sudo dnf install java-17-openjdk java-17-openjdk-devel -y
Verify the Java installation completed successfully by checking the installed version and functionality:
java -version
javac -version
The output should display Java version information confirming successful installation. Alternative Java installation methods include downloading Oracle JDK directly, though OpenJDK provides equivalent functionality for Minecraft server operations.
Java Configuration
Configure Java environment variables to ensure proper system recognition and path resolution. Set the JAVA_HOME environment variable to point to your Java installation directory:
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
echo 'export JAVA_HOME=/usr/lib/jvm/java-17-openjdk' >> ~/.bashrc
Reload your shell configuration to apply the changes immediately. Proper Java configuration prevents runtime errors and ensures consistent behavior across different user sessions.
Step 3: Creating a Dedicated Minecraft User
Security best practices recommend running services under dedicated user accounts with limited privileges rather than using root or administrative accounts. This approach minimizes potential security risks and provides better process isolation.
Create a dedicated user account specifically for Minecraft server operations:
sudo useradd -m -s /bin/bash minecraft
sudo passwd minecraft
Set a strong password for the minecraft user account to maintain security standards. The user creation process automatically generates a home directory where server files will be stored.
Configure appropriate directory permissions to ensure the minecraft user can access necessary files while maintaining system security:
sudo mkdir -p /opt/minecraft
sudo chown minecraft:minecraft /opt/minecraft
sudo chmod 755 /opt/minecraft
User privilege management involves granting only the minimum permissions necessary for server operation. Avoid granting sudo access unless specifically required for server management tasks.
Step 4: Downloading Minecraft Server Files
Obtaining official Minecraft server software ensures compatibility, security, and access to the latest features and bug fixes. Always download server files from official Mojang sources to avoid modified or potentially malicious versions.
Official Download Sources
Navigate to Mojang’s official server download page to identify the current server version. The official website provides direct download links for the latest stable server releases.
Switch to the minecraft user account and navigate to the server directory:
sudo su - minecraft
cd /opt/minecraft
Download the latest server JAR file using wget
for direct command-line downloads:
wget https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar
Replace the version hash with the current release identifier from the official download page. This ensures you obtain the most recent stable server version.
File Organization
Organize server files systematically to simplify management and maintenance tasks. Create dedicated directories for different types of server data:
mkdir -p logs backups plugins worlds
Proper file naming conventions help identify different server versions and configurations easily. Rename the downloaded server file to include version information:
mv server.jar minecraft-server-1.20.1.jar
Set appropriate file permissions to ensure the minecraft user can execute the server software while maintaining security:
chmod +x minecraft-server-1.20.1.jar
Version Management
Maintain multiple server versions to facilitate testing and rollback capabilities. Store different versions in separate directories or use clear naming conventions to distinguish between releases.
Backup considerations become crucial when updating server versions. Always create complete backups before upgrading to prevent data loss from compatibility issues or unexpected problems.
Step 5: Initial Server Configuration
Initial server configuration establishes fundamental settings that affect gameplay mechanics, performance characteristics, and player experience. Proper configuration prevents common issues and optimizes server behavior for your specific requirements.
EULA Agreement
Minecraft’s End User License Agreement must be accepted before the server will start successfully. This legal requirement ensures compliance with Mojang’s terms of service and licensing conditions.
Run the server initially to generate default configuration files:
java -Xmx1024M -Xms1024M -jar minecraft-server-1.20.1.jar nogui
This initial run creates necessary files including eula.txt, server.properties, and world data directories. The server will stop automatically after generating files due to the unaccepted EULA.
Edit the EULA file to accept the license terms:
nano eula.txt
Change eula=false
to eula=true
to indicate your acceptance of the license agreement. Save the file and exit the editor.
Server Properties Configuration
The server.properties file controls numerous aspects of server behavior, world generation, and gameplay mechanics. Key configuration options significantly impact player experience and server performance.
Edit the server properties file to customize your server settings:
nano server.properties
Important settings to configure include:
server-port=25565
– Network port for client connectionsmax-players=20
– Maximum concurrent player limitdifficulty=normal
– Game difficulty settinggamemode=survival
– Default game mode for new playersspawn-protection=16
– Protected area around world spawnonline-mode=true
– Player authentication requirement
Network and performance settings affect server responsiveness and resource usage. Adjust view-distance and simulation-distance based on your server’s hardware capabilities.
Memory Allocation Settings
Java memory parameters directly affect server performance and stability. The Xms parameter sets initial memory allocation, while Xmx establishes the maximum memory limit.
Calculate appropriate memory allocation based on your server’s available RAM and expected player count. A general guideline allocates 1-2GB for small servers and 4-8GB for larger communities:
java -Xmx4G -Xms2G -jar minecraft-server-1.20.1.jar nogui
Performance optimization involves balancing memory allocation with other system requirements. Avoid allocating all available RAM to leave resources for the operating system and other processes.
Step 6: Firewall Configuration
Rocky Linux 10’s firewall system provides robust security controls while allowing necessary network access for Minecraft server operations. Proper firewall configuration balances security requirements with functional accessibility.
Understanding Rocky Linux 10 Firewall
Firewalld serves as the default firewall management system on Rocky Linux 10, offering zone-based security policies and dynamic rule management. The service provides both command-line and graphical management interfaces for configuring network access controls.
Check the current firewall status and active zones:
sudo firewall-cmd --state
sudo firewall-cmd --get-active-zones
Opening Required Ports
Configure firewall rules to allow Minecraft server traffic through the default port 25565. This enables players to connect to your server while maintaining security for other network services.
Add permanent firewall rules for Minecraft server access:
sudo firewall-cmd --permanent --add-port=25565/tcp
sudo firewall-cmd --permanent --add-service=minecraft-server
sudo firewall-cmd --reload
Verify the firewall rules are active and properly configured:
sudo firewall-cmd --list-all
The output should show port 25565 in the allowed ports list, confirming successful configuration.
Security Best Practices
Implement additional security measures to protect your server from unauthorized access and potential attacks. Consider restricting access to specific IP ranges if you’re hosting a private server for known users.
Regular firewall rule auditing ensures your security policies remain current and effective. Review and update rules periodically to address changing security requirements and access patterns.
Step 7: Running the Minecraft Server
Launching your Minecraft server for the first time involves executing the server software with appropriate parameters and monitoring the startup process for potential issues.
First Server Launch
Execute the server with optimized memory settings and proper command-line parameters:
cd /opt/minecraft
java -Xmx4G -Xms2G -jar minecraft-server-1.20.1.jar nogui
Monitor the startup output carefully for error messages, warnings, or configuration issues. The initial startup process generates world data, loads game mechanics, and initializes network services.
Successful startup displays server information including version details, world loading progress, and network binding confirmation. The server is ready when you see “Done! For help, type ‘help'” in the console output.
Server Management Commands
Basic server console commands provide essential administrative functionality for managing players, world settings, and server operations. Essential commands include:
/stop
– Graceful server shutdown/save-all
– Force world data save/list
– Display connected players/op <username>
– Grant operator privileges/kick <username>
– Remove player from server/ban <username>
– Permanently ban player access
Player management capabilities allow real-time moderation and administrative control over server activities. Operator privileges enable trusted users to assist with server management tasks.
Testing Server Functionality
Connect from a Minecraft client to verify server accessibility and basic functionality. Use your server’s IP address and the configured port (default 25565) to establish connections.
Basic functionality verification includes testing player movement, block placement, chat functionality, and world interaction. These tests confirm proper server configuration and network connectivity.
Address any connection issues by reviewing firewall settings, network configuration, and server startup messages for diagnostic information.
Step 8: Creating Startup Scripts and Service Management
Automating server startup and management through scripts and systemd services ensures reliable operation and simplifies administrative tasks.
Creating Startup Scripts
Develop shell scripts that handle server startup with appropriate parameters and error handling capabilities:
nano /opt/minecraft/start-server.sh
Create a comprehensive startup script:
#!/bin/bash
cd /opt/minecraft
java -Xmx4G -Xms2G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -jar minecraft-server-1.20.1.jar nogui
Make the script executable and secure:
chmod +x /opt/minecraft/start-server.sh
chown minecraft:minecraft /opt/minecraft/start-server.sh
Script error handling and logging capabilities improve troubleshooting and maintenance procedures. Include log rotation and error capture mechanisms in production scripts.
Systemd Service Configuration
Create a systemd service file for automatic startup and service management:
sudo nano /etc/systemd/system/minecraft.service
Configure the service file with appropriate settings:
[Unit]
Description=Minecraft Server
After=network.target
[Service]
Type=simple
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/opt/minecraft/start-server.sh
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable automatic startup and service management capabilities:
sudo systemctl daemon-reload
sudo systemctl enable minecraft
sudo systemctl start minecraft
Monitor service status and manage the server using systemd commands:
sudo systemctl status minecraft
sudo systemctl stop minecraft
sudo systemctl restart minecraft
Service troubleshooting involves reviewing journal logs and service configuration for diagnostic information when issues occur.
Step 9: Performance Optimization and Monitoring
Optimizing Minecraft server performance ensures smooth gameplay experiences and efficient resource utilization across different server loads and player counts.
Memory and CPU Optimization
JVM tuning parameters significantly impact server performance characteristics. The G1 garbage collector provides excellent performance for Minecraft server applications with proper configuration.
Advanced JVM parameters optimize memory management and reduce performance impact from garbage collection cycles. These settings particularly benefit servers with larger player counts and complex world modifications.
CPU affinity settings can improve performance on multi-core systems by dedicating specific cores to server processing. This approach reduces context switching and improves cache efficiency.
Monitor CPU and memory usage patterns to identify optimization opportunities:
top -p $(pgrep java)
htop -p $(pgrep java)
Server Monitoring
System monitoring tools provide insights into resource usage patterns, performance bottlenecks, and potential issues before they affect gameplay quality.
Implement log analysis and rotation to manage disk usage while maintaining diagnostic capabilities:
sudo nano /etc/logrotate.d/minecraft
Configure log rotation settings:
/opt/minecraft/logs/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 644 minecraft minecraft
}
Resource usage tracking helps identify trends and plan capacity upgrades based on actual usage patterns rather than theoretical requirements.
World and Plugin Management
World backup strategies protect against data loss from hardware failures, corruption, or administrative errors. Implement automated backup procedures that run during low-activity periods.
Plugin installation considerations affect server performance and stability significantly. Research plugin compatibility and resource requirements before installation to avoid conflicts or performance degradation.
Performance impact assessment for modifications helps maintain optimal server responsiveness while adding desired functionality and features.
Security Hardening and Best Practices
Implementing comprehensive security measures protects your Minecraft server from various threats while maintaining accessibility for legitimate users.
System Security
Regular system updates address security vulnerabilities and maintain compatibility with current software versions. Establish automated update schedules for critical security patches.
User access control and authentication prevent unauthorized system access. Implement SSH key authentication and disable password-based authentication for improved security:
sudo nano /etc/ssh/sshd_config
Configure secure SSH settings:
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
AllowUsers minecraft
SSH security configuration includes changing default ports, implementing fail2ban protection, and monitoring access logs for suspicious activity patterns.
Server-Specific Security
Whitelist configuration restricts server access to approved players only, providing excellent protection against griefing and unauthorized access:
/whitelist on
/whitelist add playername
Operator permission management controls administrative access within the game environment. Grant operator privileges carefully and review permissions regularly.
Chat moderation and anti-griefing measures maintain positive community environments through automated filtering and manual oversight capabilities.
Backup and Recovery
Automated backup solutions protect world data and server configurations from loss due to hardware failures or administrative errors:
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
tar -czf /backup/minecraft_backup_$DATE.tar.gz /opt/minecraft/world/
find /backup -name "minecraft_backup_*.tar.gz" -mtime +7 -delete
Disaster recovery planning includes testing backup restoration procedures and maintaining off-site backup copies for critical server environments.
Troubleshooting Common Issues
Addressing common Minecraft server problems requires systematic diagnostic approaches and understanding of typical failure patterns.
Connection Problems
Network connectivity troubleshooting begins with verifying basic network services and firewall configurations. Use telnet or netcat to test port accessibility:
telnet server-ip 25565
nc -zv server-ip 25565
Port accessibility verification confirms whether network traffic reaches the server properly. DNS resolution issues can prevent connections even when direct IP access works correctly.
Client-server version compatibility problems occur when client and server versions don’t match exactly. Maintain current server versions and communicate version requirements to players clearly.
Performance Issues
Memory-related problems manifest as lag, freezing, or unexpected shutdowns. Monitor Java heap usage and garbage collection patterns to identify memory issues:
jstat -gc $(pgrep java) 5s
Server lag diagnosis involves identifying resource bottlenecks through system monitoring and log analysis. Common causes include insufficient RAM allocation, disk I/O limitations, or network bandwidth constraints.
Resource bottleneck identification requires comprehensive monitoring of CPU, memory, disk, and network usage patterns during peak load periods.
Server Startup Problems
Java-related startup errors typically involve classpath issues, memory allocation problems, or version incompatibilities. Review startup logs carefully for specific error messages and stack traces.
Configuration file syntax errors prevent successful server initialization. Validate JSON and property file formats using appropriate tools before attempting server startup.
Permission and file access issues require checking file ownership, directory permissions, and SELinux contexts on security-enabled systems.
Advanced Configuration Options
Advanced server customization enables unique gameplay experiences and optimized performance for specific use cases and player preferences.
Server Customization
Advanced server.properties settings control detailed aspects of gameplay mechanics, world generation algorithms, and network behavior characteristics.
Important advanced settings include:
view-distance
– Chunk loading radius for playerssimulation-distance
– Active chunk processing rangeentity-broadcast-range-percentage
– Entity visibility optimizationnetwork-compression-threshold
– Packet compression settings
World generation parameters affect terrain features, structure spawning, and biome distribution patterns. Custom world presets enable unique server environments tailored to specific gameplay styles.
Game rule modifications alter fundamental gameplay mechanics through commands like:
/gamerule keepInventory true
/gamerule mobGriefing false
/gamerule doDaylightCycle false
Multi-World Setup
Configuring multiple worlds on a single server enables diverse gameplay experiences without requiring separate server instances. This approach conserves resources while providing varied environments.
World switching and management require plugin support or manual configuration depending on your implementation approach. Popular multi-world plugins provide comprehensive world management capabilities.
Resource allocation for multiple worlds requires careful planning to prevent performance degradation from excessive memory usage or processing overhead.
Maintenance and Updates
Establishing regular maintenance procedures ensures continued server reliability, security, and performance optimization over extended operational periods.
Regular Maintenance Tasks
Log file cleanup and rotation prevents disk space exhaustion while maintaining diagnostic capabilities for troubleshooting purposes. Implement automated cleanup procedures to manage log growth effectively.
Performance monitoring routines identify developing issues before they affect gameplay quality. Regular resource usage analysis helps plan capacity upgrades and optimization strategies.
Player data management includes monitoring player activity patterns, managing inactive accounts, and maintaining world data integrity through regular validation procedures.
Server Updates
Updating Minecraft server software safely requires careful planning and comprehensive backup procedures. Test updates in staging environments before applying them to production servers.
Backup procedures before updates should include complete world data, configuration files, and plugin installations to enable rapid rollback if issues occur.
Rollback strategies provide recovery options when updates introduce compatibility problems or unexpected behavior changes that affect server stability or gameplay quality.
Congratulations! You have successfully installed Minecraft. Thanks for using this tutorial for installing the Minecraft server on your Rocky Linux 10 system. For additional help or useful information, we recommend you check the official Minecraft website.