cPanel

Install cPanel & WHM on Rocky Linux or CloudLinux

Install cPanel & WHM on a fresh Rocky Linux or CloudLinux 8/9 server: requirements, hostname and network prep, the installer, licence activation, hardening and fixes.

AdvancedVPS / dedicated servers3 min read

cPanel & WHM supports several RHEL-compatible systems. Besides AlmaLinux, two popular choices are Rocky Linux, a community rebuild, and CloudLinux OS, which adds account isolation and is the standard for shared and reseller hosting. The steps are almost identical; this guide notes the differences. For AlmaLinux see install cPanel on AlmaLinux; for Ubuntu see install cPanel on Ubuntu.

Before you start

  • OS: a fresh, minimal Rocky Linux 8/9 or CloudLinux 8/9, 64-bit. Check cPanel's current list of supported versions before you order. No web server, database or other panel installed.
  • Resources: at least 2 GB RAM (4 GB recommended), 2 CPU cores and 40 GB disk (more for hosting accounts).
  • Hostname: an FQDN such as server.example.com that is not used as a website, with an A record to the server IP.
  • Licence: a cPanel licence bound to the server IP (or the 15-day trial); for CloudLinux, also a CloudLinux licence.
  • A static IPv4 address and root SSH access.

Prepare the server

  1. Set the hostname:
    hostnamectl set-hostname server.example.com
  2. Update everything and reboot:
    dnf -y update && reboot
  3. Disable NetworkManager-managed DHCP if your provider uses a static IP, and confirm the IP is configured statically.
  4. Rocky only: cPanel requires SELinux disabled. Set SELINUX=disabled in /etc/selinux/config and reboot. CloudLinux ships with it disabled.
  5. Make sure perl and curl are present: dnf -y install perl curl.

Run the installer

Start the installer inside a screen session so a dropped SSH connection does not stop it:

dnf -y install screen && screen -S cpanel
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

The installation takes 30 to 60 minutes. On CloudLinux, the installer detects the OS and enables CloudLinux integration automatically.

First login and setup wizard

  1. Open https://SERVER-IP:2087 and log in as root.
  2. Accept the licence agreement and enter the contact email.
  3. Confirm the hostname, resolvers and main network device.
  4. Configure nameservers and choose the DNS server.
  5. Set the default service settings (FTP server, mail, cPHulk).

Every screen is explained in the WHM initial setup wizard.

Licence activation

cPanel checks the licence for the server IP automatically. If you buy the licence after installing, refresh it:

/usr/local/cpanel/cpkeyclt

For CloudLinux, register the OS licence with rhnreg_ks --activationkey=YOUR-KEY if the provider has not done it.

Post-install hardening

Verify

  • WHM loads over HTTPS with a valid hostname certificate (issued by AutoSSL).
  • WHM → Server Status → Service Status shows all services up.
  • Create a test account and open its site and webmail.

Troubleshooting

  • Installer refuses to run: the server is not clean or the OS version is unsupported; reinstall a minimal OS.
  • Hostname warning: the hostname is not an FQDN or does not resolve; fix the A record.
  • Licence invalid: the licence IP differs from the server's main outgoing IP; check with curl -s https://myip.cpanel.net/v1.0/.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.