In this guide, we’ll walk through the steps to install WHM cPanel on Rocky Linux 9, a robust and secure distribution perfect for server environments.

Prerequisites

Before we begin, ensure you have the following:

  1. A fresh installation of Rocky Linux 9.
  2. Root access to your server.
  3. A valid cPanel license (you can get a trial license from the cPanel website).

Step 1: Update Your System

First, make sure your server is up to date. Open your terminal and run:

sudo dnf update -y

Step 2: Set the Hostname

cPanel requires a fully qualified domain name (FQDN). Set your hostname using the following command:

sudo hostnamectl set-hostname your.hostname.com

Replace your.hostname.com with your actual domain name.

Step 3: Disable NetworkManager

WHM cPanel installation requires that NetworkManager be disabled. Execute the following commands:

sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager

Step 4: Install Required Packages

Install Perl and other necessary packages:

sudo dnf install perl curl -y

Step 5: Download and Install WHM cPanel

Download the latest cPanel installation script using curl:

curl -o latest -L https://securedownloads.cpanel.net/latest

Run the installation script:

sudo sh latest

The installation process can take anywhere from 30 minutes to an hour, depending on your server’s resources.

Step 6: Configure the Firewall

Ensure your firewall allows access to WHM and cPanel ports. Run the following commands:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=2087/tcp
sudo firewall-cmd --permanent --add-port=2083/tcp
sudo firewall-cmd --reload

Step 7: Access WHM

Once the installation is complete, you can access WHM via your web browser. Navigate to:

https://your.hostname.com:2087

Log in using the root username and the password for your server.

Step 8: Complete the WHM Setup Wizard

After logging in, you’ll be greeted by the WHM setup wizard. Follow the on-screen instructions to configure your WHM cPanel environment. This includes setting up your email, DNS, and other essential configurations.

Conclusion

Congratulations! You have successfully installed WHM cPanel on Rocky Linux 9. With WHM and cPanel, managing your web hosting environment becomes more efficient and user-friendly. Now you can start creating cPanel accounts, setting up domains, and managing your server with ease.

Feel free to explore the extensive features and capabilities that WHM and cPanel offer. If you encounter any issues or need further customization, the cPanel documentation and support forums are excellent resources to help you along the way.

Happy Hosting!