Setup guides

How to install cPanel and WHM from scratch

Every step of installing cPanel and WHM on a clean AlmaLinux server: prerequisites, the install command, license activation and what to do afterwards.

9 min read
Orange hosting control panel and installation steps above a server

cPanel is the most widely used control panel in shared hosting. The server-side management interface is called WHM (Web Host Manager), while the interface your end users see is cPanel. A single installation delivers both.

This guide assumes you have root access to an empty server. The installation takes a long time but has few steps — most of the work is getting the prerequisites right.

Before you install: what must be true

A cPanel installation cannot be undone. Removing it means rebuilding the server. Verify every item below before you start.

  • Operating system: cPanel is supported only on RHEL-based distributions — AlmaLinux OS 8/9, Rocky Linux 8/9, CloudLinux and RHEL. It cannot be installed on Ubuntu or Debian.
  • A clean system: Apache, MySQL/MariaDB, PHP or any other control panel must not be installed already. The installer brings its own and will conflict with what is there.
  • Memory and disk: It runs on 1 GB of RAM, but a real workload needs 2 GB or more. 20 GB of disk is the floor; account data and backups sit on top of that.
  • A static IP address: An address that changes over DHCP breaks both license validation and SSL certificates.
  • A license: cPanel is a commercial product. The license is tied to the server's IP address, and trial licenses are issued the same way.

1. Set the hostname to a fully qualified domain name

cPanel requires the server to carry an FQDN hostname. That name must not be the same as any site you plan to host; otherwise the site's DNS records collide with the server's own.

bashhostnamectl set-hostname server.yourdomain.com
hostname -f

The second command should return server.yourdomain.com. Then create an A record pointing that name at the server's IP address.

2. Update the system and reboot

bashdnf update -y
reboot

If a kernel update landed, the reboot is mandatory. Starting the installer on a stale kernel causes failures further down the process.

3. Run the installer

Connect as root and run these commands in order:

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

Installation takes 30 to 90 minutes. If your connection drops, the install is left half-finished — run it inside screen or tmux to avoid that:

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

Detach with Ctrl+A then D, and return with screen -r cpanel.

4. First login to WHM and licensing

When the installer finishes, the panel is reachable at:

texthttps://SERVER-IP:2087

The username is root and the password is the server's root password. Your browser will warn about the certificate — that is expected, the panel has not issued its own yet.

The setup wizard runs on first login. It validates the license and asks for a contact email, nameservers (ns1.yourdomain.com, ns2.yourdomain.com) and basic network settings.

5. What you must do after installation

Once the installer finishes the server works, but it is not secure. Do not skip these:

  • Firewall: Open the ports cPanel needs — 2082/2083 (cPanel), 2086/2087 (WHM), 2095/2096 (Webmail), plus 80, 443, 21, 25, 110, 143, 465, 587, 993, 995 and 53 for DNS. Close everything else.
  • Install CSF or a comparable firewall layer, and enable cPHulk brute-force protection from WHM.
  • Disable SSH root login. Create a separate privileged user and move to key-based authentication.
  • Configure automated backups. Define a remote destination under WHM > Backup Configuration; a backup on the same disk is not a backup.
  • Turn on AutoSSL. It issues free certificates for hosted domains and renews them before they expire.

Common failures

"This system is not supported" — You are on an unsupported distribution or version. Rebuild with AlmaLinux 8 or 9.

The installer stops at the hostname step — hostname -f is not returning a fully qualified name. Go back to step 1.

License error — The server's public IP does not match the address on the license. If the IP changed, the license has to be moved with it.

In closing

cPanel makes a real difference once you are managing multiple customer accounts on one server. In exchange it carries a license cost and consumes more resources than Plesk. If you run a single site, a panel-free setup or a lighter alternative may serve you better.

Because details change between releases, check cPanel's official installation documentation alongside these commands.