Installing WHM cPanel on CloudLinux 9 is a crucial step for hosting providers and web developers who need a robust, secure, and easy-to-manage hosting environment. WHM (WebHost Manager) and cPanel together offer powerful tools for managing servers and websites, while CloudLinux enhances server stability, security, and performance by isolating each tenant in a Lightweight Virtual Environment (LVE). Here’s a comprehensive guide to help you through the installation process.

Prerequisites

Before starting the installation, ensure you have:

  1. A fresh installation of CloudLinux 9.
  2. Root access to your server.
  3. A valid cPanel/WHM license.

Step-by-Step Installation Guide

Step 1: Prepare Your Server

  1. Update Your System: Ensure your server is up-to-date with the latest packages and security patches.
    yum update -y
  2. Set the Hostname: Set a fully qualified domain name (FQDN) as the hostname.
    hostnamectl set-hostname server.yourdomain.com

Step 2: Install CloudLinux

If you haven’t already installed CloudLinux, you need to convert your existing CentOS or RHEL system to CloudLinux.

  1. Get Your Activation Key: Obtain your CloudLinux license activation key from the CloudLinux website.
  2. Install the CloudLinux Conversion Script:
    wget https://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy
  3. Run the Conversion Script:
    sh cldeploy -k YOUR_ACTIVATION_KEY
  4. Reboot Your Server:
    reboot

Step 3: Install cPanel/WHM

  1. Install cPanel: Download and run the cPanel installation script.
    cd /home
    curl -o latest -L https://securedownloads.cpanel.net/latest
    sh latest
  2. Wait for the Installation to Complete: The installation process can take anywhere from 30 minutes to a couple of hours, depending on your server’s speed and internet connection.

Step 4: Initial WHM Setup

  1. Access WHM: Once the installation is complete, you can access WHM using your server’s IP address and port 2087. For example:
    https://yourserverip:2087
  2. Login: Log in with the root user and password.
  3. Follow the Initial Setup Wizard: The wizard will guide you through configuring basic settings like your contact email, hostname, and nameservers.

Step 5: Secure Your Server

  1. Configure Firewall: Set up a firewall to protect your server. ConfigServer Security & Firewall (CSF) is a popular choice.
    yum install csf -y
    csf -e
  2. Install Security Plugins: Enhance your server’s security by installing plugins like Imunify360, which integrates well with CloudLinux and WHM/cPanel.

Step 6: Optimize CloudLinux Features

  1. Enable LVE Manager: The LVE Manager allows you to control resource usage for each user.
    yum install lvemanager -y
    systemctl restart lvestats
  2. Configure CageFS: CageFS is a virtualized file system that encapsulates each user, preventing them from seeing each other and viewing sensitive information.
    yum install cagefs -y
    cagefsctl --init
    cagefsctl --enable all

Conclusion

Installing WHM cPanel on CloudLinux 9 sets up a powerful, secure, and efficient hosting environment. By following the steps outlined above, you can ensure a smooth installation process and take advantage of the features offered by both WHM/cPanel and CloudLinux. This combination will provide your clients with a stable and secure hosting experience, helping you to manage your server resources effectively.

Remember to regularly update your system and software, implement security best practices, and monitor your server’s performance to maintain an optimal hosting environment.

Happy hosting!