· 7 min read

cPanel WHM Installation Guide: AlmaLinux, Rocky, Ubuntu

To install cPanel & WHM, start with a fresh, supported OS (AlmaLinux, Rocky Linux, or Ubuntu LTS) and a fully qualified hostname that resolves in DNS. Then run cPanel's official installer script as root, log in to WHM on port 2087, and finish the setup wizard. The install itself is one command. Most failures come from skipped prerequisites, so this guide covers those first.

Before You Start: System Requirements

cPanel only installs on a clean system. If Apache, Nginx, Exim, Postfix, BIND, MySQL, or another control panel is already there, the installer will refuse to run or leave you with a broken setup. Reinstall the OS instead of cleaning it up by hand.

Item Practical requirement
Operating system AlmaLinux 8/9, Rocky Linux 8/9, RHEL 8/9, or Ubuntu LTS (22.04 and newer LTS releases as listed by cPanel)
Install state Fresh minimal install, no other panel or web/mail/DNS services
RAM 2 GB is a workable floor for a test box. Use 4 GB or more for production hosting.
Disk 40 GB or more. Leave room for backups, logs, and mail.
Network Static, publicly routable primary IPv4 address
Access Root SSH access
SELinux Disabled on EL-based systems (cPanel does not support enforcing mode)

Supported OS versions change as distributions reach end of life. Check cPanel's current documentation before you pick an image. CentOS 7 and similar older releases are no longer a sensible choice for new builds.

A VDS with root access, a dedicated IPv4 address, and enough RAM is a good fit. On a Nixcon VDS (VMware vSphere based), pick the OS image first and do the steps below on the clean install.

Step 1: Update the OS and Check SELinux

On AlmaLinux or Rocky Linux:

dnf -y update
dnf -y install curl perl screen
sestatus

If SELinux is enabled, disable it and reboot:

sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
reboot

On Ubuntu:

apt update && apt -y upgrade
apt -y install curl perl screen
reboot

Reboot after a kernel update so the installer runs on the kernel you will actually use.

Step 2: Set the Hostname and DNS

cPanel needs a fully qualified domain name (FQDN) as the server hostname, such as server1.example.com. Three rules prevent most problems:

  1. Use a subdomain, not a bare domain you will host on the server.
  2. Create an A record for the hostname pointing at the server's primary IP before you install.
  3. Make sure the hostname is not an alias of another record (no CNAME).

Set it on the server:

hostnamectl set-hostname server1.example.com
hostname -f

Verify DNS from the outside:

dig +short A server1.example.com
# Expected: 192.0.2.10

Also check /etc/hosts. A line like this avoids local resolution delays:

192.0.2.10   server1.example.com   server1

Plan your nameservers now. You will enter ns1.example.com and ns2.example.com in the setup wizard. Create A records for both. If you want glue records at the registrar, set them up before you go live with customer domains.

Also confirm the server can resolve names. A broken /etc/resolv.conf causes slow or failed installs:

dig +short cpanel.net

Step 3: Open the Required Ports

If a network or host firewall sits in front of the server, allow the ports cPanel uses. Use one firewall tool on the host, not several at once.

Port Purpose
22 SSH (restrict to known IPs where you can)
80, 443 HTTP and HTTPS
2083, 2087 cPanel and WHM over SSL
2095, 2096 Webmail (2096 is SSL)
53 (TCP/UDP) DNS
25, 465, 587 SMTP
110, 995, 143, 993 POP3 and IMAP (plain and SSL)
21 FTP, if you offer it

If you run a DDoS-protected network, make sure the protection layer does not block the management ports from your admin IPs.

Step 4: Run the Official Installer

Always use cPanel's own installer. Run it inside screen so a dropped SSH session doesn't interrupt the install:

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

The install typically takes 30 to 60 minutes or more, depending on CPU and network speed. Follow progress in a second session:

tail -f /var/log/cpanel-install.log

If the SSH session drops, reattach with screen -r cpanel. When the installer finishes, it prints a completion message. Reboot once if asked.

Check the installed version:

/usr/local/cpanel/cpanel -V

Step 5: Log In and Complete the WHM Wizard

Open https://192.0.2.10:2087 (or https://server1.example.com:2087) and log in as root. Your browser will warn about a self-signed certificate until AutoSSL or a hostname certificate is issued. That is expected on first login.

The setup wizard asks for:

Keep the defaults for the DNS and FTP services unless you have a reason to change them.

Step 6: Licensing

cPanel licenses are tied to the server's primary IP address. Buy the license from cPanel or an authorized partner, and make sure it is issued for the exact IP you installed on. If the license isn't active, WHM shows a license error. To force a refresh after activation:

/usr/local/cpanel/cpkeyclt

Check the license status for your IP at cPanel's license verification page. If you change the primary IP later, the license must be moved to the new IP.

Step 7: First WHM Settings Worth Changing

Do these before you create customer accounts:

Step 8: Security Hardening

A new cPanel server is scanned within hours of coming online. Apply these basics right away:

  1. Use SSH keys and disable root password login. Set PermitRootLogin prohibit-password in /etc/ssh/sshd_config. Better still, log in as a normal user and use sudo. Test a second session before you close the first.
  2. Enable two-factor authentication for root and resellers in WHM.
  3. Turn on cPHulk (Security Center) to block brute-force attacks on WHM, cPanel, SSH, and mail. Whitelist your own admin IPs first.
  4. Restrict WHM access using Host Access Control or your network firewall so ports 2087 and 22 are reachable only from trusted IPs.
  5. Install ModSecurity with a maintained rule set from the WHM ModSecurity Vendors page. Start in logging mode, then enforce once false positives are tuned.
  6. Run the Security Advisor in WHM and fix everything marked as a high-priority warning.
  7. Keep everything updated. Automatic cPanel updates cover the panel and its services. OS packages need dnf update or apt upgrade on a schedule.
  8. Limit outbound spam. Set a hourly mail-per-domain limit in Tweak Settings so one compromised account can't get your IP blacklisted.

Volumetric attacks can't be fixed at the host level. If you host customer sites, DDoS protection and firewall filtering in front of the server keeps attack traffic off the VDS itself.

Common Mistakes and Fixes

Final Checklist

Do this once and you have a stable base for hosting. Test with a dummy account, then migrate real sites.

Frequently asked questions

Which operating systems does cPanel & WHM support?

cPanel supports AlmaLinux, Rocky Linux, and RHEL (versions 8 and 9), plus Ubuntu LTS releases. Supported versions change over time, so check cPanel's current documentation before you choose an image. Don't use end-of-life distributions like CentOS 7 for new builds.

How long does the cPanel installation take?

Plan for 30 to 60 minutes or more. It depends on CPU, disk speed, and network. Run the installer inside screen or tmux and watch /var/log/cpanel-install.log.

Can I install cPanel on a server that already runs Apache or another panel?

No. cPanel needs a fresh system without existing web, mail, DNS, or database services, and without another control panel. Reinstall a minimal OS image and run the installer there.

Why does WHM show a license error after installation?

cPanel licenses are tied to the server's primary IP address. If the license was issued for a different IP, or isn't active yet, WHM reports an error. Issue it for the correct IP, then run /usr/local/cpanel/cpkeyclt to refresh it.

Deploy a clean VDS for cPanel with root access and a dedicated IPv4.Learn more