Install and Configure cPanel on RHEL 9: Complete Server Setup

By Raman Kumar

Share:

Updated on Apr 29, 2026

Install and Configure cPanel on RHEL 9: Complete Server Setup

Prerequisites for cPanel Installation on RHEL 9

Before you install cPanel on RHEL 9, your server needs proper preparation. Start with a fresh RHEL 9 installation with minimal packages. Your server requires at least 2GB RAM. 4GB performs better in production.

Check your system meets these requirements:

  • Red Hat Enterprise Linux 9 with a valid subscription
  • Root access via SSH
  • Static IP address configured
  • Valid hostname set (FQDN recommended)
  • At least 20GB free disk space

Verify your hostname configuration first:

hostname -f
hostnamectl status

Your hostname should resolve properly. If not, set it now:

hostnamectl set-hostname server.yourdomain.com

System Preparation and Initial Configuration

Update your RHEL 9 system completely before starting the cPanel installation. This prevents compatibility issues during setup.

dnf update -y
reboot

After rebooting, disable SELinux temporarily. cPanel's installer handles SELinux configuration automatically. Having it enabled during installation causes problems:

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

Install essential packages that cPanel requires:

dnf install -y wget curl perl

Configure your server's timezone correctly. Many hosting customers run into email delivery issues when the timezone isn't set properly:

timedatectl set-timezone America/New_York

Replace the timezone with your actual location. List available timezones with timedatectl list-timezones.

Download and Run cPanel Installation

cPanel provides an automated installer script that handles the entire setup. Download it directly from cPanel's servers:

cd /home
wget -N http://httpupdate.cPanel.net/latest

The installer script is called "latest". It contains all the logic needed to install cPanel on RHEL 9. Make it executable and run the installation:

chmod +x latest
./latest

The installation takes 45-90 minutes. Time depends on your server's performance and internet connection. The installer downloads and configures Apache, MySQL, PHP, and dozens of other components automatically.

You'll see output showing installation progress. Don't interrupt the process even if it appears stuck. Some steps take several minutes to complete.

Common installation phases include:

  • System compatibility checks
  • Package downloads and compilation
  • Service configuration
  • Initial security setup
  • cPanel interface installation

Complete Initial cPanel Configuration

After installation completes, access the cPanel setup wizard through your web browser. Navigate to:

https://your-server-ip:2087

Use port 2087 for WHM (Web Host Manager) access. The setup wizard walks you through essential configuration steps.

Accept the license agreement first. Then configure these critical settings:

Server Contact Information: Enter your email address for system notifications. This email receives important alerts about server health and security issues.

Nameservers: Set your primary and secondary nameservers. If you're using external DNS, enter those nameserver addresses. For self-hosted DNS, use:

ns1.yourdomain.com
ns2.yourdomain.com

Resolver Configuration: Use reliable DNS resolvers. Try Cloudflare (1.1.1.1, 1.0.0.1) or Google (8.8.8.8, 8.8.4.4).

Configure Essential Security Settings

Security configuration happens immediately after basic setup. Start with firewall rules through WHM's built-in ConfigServer Security & Firewall (CSF).

Navigate to WHM → Plugins → ConfigServer Security & Firewall. Enable the firewall and configure these essential rules:

  • Allow SSH (port 22) from your IP only
  • Allow HTTP (80) and HTTPS (443) globally
  • Allow cPanel (2082, 2083) and WHM (2086, 2087)
  • Allow email ports (25, 110, 143, 587, 993, 995)

Update the root password immediately. Use a strong password with mixed case, numbers, and symbols:

passwd root

Configure automatic updates in WHM → Server Configuration → Update Preferences. Enable automatic cPanel updates. Review system package updates manually to avoid breaking changes.

Set up fail2ban protection through CSF configuration. This automatically blocks IP addresses that show suspicious login patterns.

Set Up Your First Hosting Account

Create your first hosting account to verify everything works correctly. In WHM, go to Account Functions → Create a New Account.

Fill in the account details:

  • Domain: Enter the primary domain name
  • Username: Choose a short, memorable username
  • Password: Generate a secure password
  • Email: Account contact email
  • Package: Select or create a hosting package

After creating the account, test cPanel access at:

https://your-server-ip:2083

Log in with the account credentials you just created. Verify these functions work:

  • File Manager loads correctly
  • Email accounts can be created
  • MySQL databases work
  • PHP version selector functions

Upload a simple test website to confirm web serving works properly.

Configure Mail Services and DNS

Email configuration requires attention to prevent delivery issues. In WHM, navigate to Server Configuration → Exim Configuration Manager.

Configure these mail settings:

SMTP Authentication: Always enable this to prevent your server becoming an open relay.

Reverse DNS: Ensure your server's IP has proper reverse DNS pointing to your hostname. Contact your hosting provider if this isn't configured.

SPF Records: Enable automatic SPF record creation in WHM → Service Configuration → Service Manager.

For DNS management, decide between self-hosted or external DNS. Self-hosted DNS works well for smaller setups. Hostperl VPS customers often prefer external DNS services for better redundancy.

If using self-hosted DNS, configure zone templates in WHM → DNS Functions → DNS Zone Manager.

Optimize Performance Settings

Performance tuning ensures your cPanel server handles customer websites efficiently. Start with Apache configuration in WHM → Service Configuration → Apache Configuration.

Key Apache settings to adjust:

  • MaxRequestWorkers: Set to 150-300 for typical VPS setups
  • ServerLimit: Match this to MaxRequestWorkers divided by ThreadsPerChild
  • KeepAlive: Enable with timeout of 5 seconds

Configure PHP settings through WHM → Software → MultiPHP Manager. Enable multiple PHP versions so customers can choose what their applications need.

MySQL optimization happens in WHM → SQL Services → MySQL/MariaDB Upgrade. Consider upgrading to MariaDB 10.5 or newer for better performance.

Set reasonable resource limits in WHM → Packages → Add a Package. Typical shared hosting limits:

  • Disk Space: 1-10GB per account
  • Bandwidth: 10-100GB monthly
  • Email Accounts: 25-100 per domain
  • Databases: 5-25 per account

Implement Backup and Monitoring

Backup configuration prevents data loss disasters. Configure automatic backups in WHM → Backup → Backup Configuration.

Set up daily incremental backups with weekly full backups. Store backups on external storage when possible. Never rely solely on local backup storage.

Configure backup retention policies:

  • Daily backups: Keep 7 days
  • Weekly backups: Keep 4 weeks
  • Monthly backups: Keep 3-6 months

Enable monitoring through WHM → Server Status → Service Status. This shows real-time status of critical services like Apache, MySQL, and email systems.

Set up email notifications for service failures in WHM → Server Contacts → Edit System Mail Preferences. Consider integrating external monitoring tools. They can alert you to issues before customers notice problems.

Troubleshooting Common Installation Issues

Installation problems usually stem from system preparation issues. Here are solutions to common problems:

Installation fails with permission errors: Ensure you're running as root. SELinux must be disabled during installation.

MySQL won't start after installation: Check available disk space. MySQL requires several GB for initial setup.

df -h
systemctl status mariadb
journalctl -u mariadb -f

Apache fails to start: Usually indicates hostname resolution problems. Verify your hostname resolves correctly:

nslookup $(hostname -f)

cPanel interface won't load: Check firewall settings. Ensure ports 2082, 2083, 2086, and 2087 are accessible.

SSL certificate errors: cPanel generates self-signed certificates initially. Replace these with proper SSL certificates once DNS propagates.

If you encounter persistent issues, check cPanel's installation logs:

tail -f /var/cpanel/logs/install_log

The installation log contains detailed information about any failures during the setup process.

Need professional cPanel hosting without the setup complexity? Hostperl VPS hosting includes optional cPanel licensing and can handle the complete installation and configuration process for your hosting environment.

Frequently Asked Questions

How long does cPanel installation take on RHEL 9?

Installation typically takes 45-90 minutes. Time depends on server specifications and internet connection speed. The process downloads and compiles many components. Faster servers complete installation quicker.

Can I install cPanel on RHEL 9 with existing websites?

cPanel installation should only happen on fresh server installations. Installing cPanel on a server with existing configurations can cause conflicts and data loss. Always start with a clean RHEL 9 installation.

What's the difference between cPanel ports 2082 and 2083?

Port 2082 provides HTTP access to cPanel. Port 2083 provides HTTPS (encrypted) access. Always use port 2083 for security. This is especially important when managing customer accounts or sensitive data.

Do I need a cPanel license before installation?

No, you can install cPanel and use a 15-day free trial. Purchase a license from cPanel or through hosting providers like Hostperl before the trial expires. This maintains service continuity.

Why does the installer download so many packages?

cPanel includes a complete web hosting stack. This includes Apache, PHP, MySQL/MariaDB, email servers, DNS services, and management interfaces. The installer ensures all components work together for hosting operations.