Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
Linux

Install cPanel and WHM on a VPS (and fix license errors)

Install cPanel & WHM on AlmaLinux or Ubuntu 24.04: license and OS checks, hostname and SELinux prep, the installer, first WHM login and license fixes.

CloudSat teamNovember 18, 20267 min read
Abstract illustration of a server block feeding a grid of glowing hosting account tiles, with a key-shaped license token at the center
On this pageCheck three things before you install

cPanel & WHM is two tools in one install. WHM (WebHost Manager) is the server side: root uses it to create hosting accounts, define packages and run services. cPanel is the account side, where each site owner manages files, mailboxes, databases and DNS records. It is commercial software. The installer is public, but the panel only runs with a valid license from cPanel, bought directly or through an authorized reseller. This guide covers the checks to make before you install, the install itself, the first session in WHM, and the fixes for license file errors, the most common reason a working panel suddenly locks you out.

Check three things before you install

The license

Each server needs its own license, and a license cannot be moved to a different server. Pricing tiers follow the number of hosted accounts. A fresh installation runs on a 15-day trial license, and activating any license requires a cPanel Store account with a verified email address. Buy before the trial ends, or the panel stops at a license error.

The operating system

cPanel installs only on a fresh, supported OS with nothing else configured on it: no web server, database or mail service set up by hand, and no other control panel. The supported list changes with each release, so check cPanel's supported-OS page on the day you install. In November 2026 it reads:

Operating system Status for new installs
AlmaLinux 8, 9 and 10 Supported (AlmaLinux 10 needs cPanel 132 or later)
CloudLinux 8 and 9 Supported, with a separate CloudLinux license
Ubuntu 24.04 LTS Supported
Ubuntu 22.04 LTS Retired from cPanel 136
Rocky Linux 8 and 9 Dropped in cPanel 134; installs and upgrades are blocked
CentOS 7 or 8, Debian Not supported

For the longest runway, pick AlmaLinux 9 or 10. cPanel lists end-of-life dates of May 2032 and May 2035 for them, against April 2029 for Ubuntu 24.04.

The server size

cPanel's minimum is 2 GB of RAM and 20 GB of disk; it recommends 4 GB and 40 GB. Running ClamAV raises the floor to 3 GB of RAM, and installs and upgrades need 5 GB free under /usr/local/cpanel. Give small servers swap: cPanel suggests twice the RAM up to 2 GB, the same as the RAM between 2 and 4 GB, and 4 GB above that.

The network matters as much as the size. cPanel needs at least one public IPv4 address with a static configuration: IPv6-only servers are not supported, and neither are DHCP-assigned addresses. If ip addr shows dynamic next to your address, switch the interface to a static setup with the same address, prefix and gateway before you start. On CloudSat, the 4 GB Cloud VPS at $11.58/mo matches the recommended size, and the cPanel one-click app deploys the panel without the manual steps below, though the license still comes from cPanel.

Prepare the server

Every command below runs as root, which is how cPanel expects to be installed.

Set a real hostname

The hostname must be a fully qualified domain name you control, no longer than 60 characters, resolving to the server, and different from every domain you will host. A subdomain such as server1.example.com works well. Create its A record at your DNS host, then set the name on the server:

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

From another machine, dig +short server1.example.com should return the server's IP. If the server will send mail, give its IPv4 a matching reverse DNS (PTR) record as well; on CloudSat you set it from the console (reverse DNS).

Turn off SELinux on AlmaLinux and CloudLinux

cPanel does not work with SELinux enforcing, and permissive mode buries the logs in warnings. Check the state, disable it and reboot:

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

After the reboot, sestatus should report disabled. On Ubuntu there is nothing to do here: cPanel works with AppArmor, and you should not install SELinux.

Park the OS firewall

The installer opens the ports it needs, but cPanel recommends stopping the operating system firewall first and setting one up again once the panel runs. On AlmaLinux and CloudLinux:

systemctl disable --now firewalld

On Ubuntu, save the current rules with iptables-save > ~/firewall.rules, then run systemctl disable --now ufw. If your provider offers a network-level firewall, keep SSH and the panel ports open there so the server is not fully exposed in the meantime.

Run the installer

The install takes long enough that a dropped SSH session is a real risk, and a killed installer leaves a half-built system. Run it inside tmux so it survives a disconnect (more options in keeping Linux processes running after logout):

dnf -y install tmux        # AlmaLinux, CloudLinux
apt -y install tmux        # Ubuntu
tmux new -s cpanel
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

The last line is cPanel's documented install command: it downloads the current release into /home and runs it. If your connection drops, log back in and reattach with tmux attach -t cpanel. The installer writes a full log to /var/log/cpanel-install.log; when an install fails, the end of that file usually names the reason.

First login to WHM

When the installer finishes, open WHM on port 2087, by IP or by hostname:

https://203.0.113.10:2087

Sign in as root. Expect a certificate warning on the first visit: the hostname gets a trusted certificate once AutoSSL runs. The setup wizard asks you to accept the license agreement, enter a contact address and pick nameservers. Then visit these screens before creating any account:

  1. Server Configuration > Basic WebHost Manager Setup: check the contact email and the main shared IP.
  2. Security Center > cPHulk Brute Force Protection: enable it so repeated failed logins get blocked.
  3. Security Center > Two-Factor Authentication: turn it on, then enroll root.
  4. Packages > Add a Package: set disk, bandwidth and mailbox limits.
  5. Account Functions > Create a New Account: create the first hosting account. Its owner signs in to cPanel on port 2083.

Bring a firewall back afterward and open only what you use:

Port Service
2087 WHM over HTTPS
2083 cPanel over HTTPS
2096 Webmail over HTTPS
80, 443 Websites
25, 465, 587 SMTP
993, 995 IMAP and POP3 over TLS
53 (TCP and UDP) DNS, if the server hosts zones

The plain-HTTP panel ports (2082, 2086 and 2095) can stay closed.

Fix license file errors

"Cannot Read License File", "License File Expired" and "Invalid License File" usually come down to one of five causes: no valid license for the IP the server presents, an expired license or trial, the server failing to reach cPanel's license servers, an invalid hostname, or a wrong clock. Check them in this order.

  1. Find the IP cPanel sees. This is the address your server uses for outbound traffic, and it is what the license is matched against. The second command uses port 2089 in case port 80 is filtered:
curl -w '\n' -s http://myip.cpanel.net/v1.0/
curl -w '\n' -s http://myip.cpanel.net:2089/v1.0/
  1. Look that IP up at https://verify.cpanel.net/app/verify. Read the cPanel line itself: another product can show as active while the cPanel license has expired. No license for the IP, which is common after a migration or an IP change, means a ticket to whoever sold you the license.
  2. Refresh the license with /usr/local/cpanel/cpkeyclt. No output means it worked. If it hangs for more than a few seconds, the server has a connectivity problem.
  3. Test the path to cPanel. host auth.cpanel.net must resolve, and outbound traffic to myip.cpanel.net on ports 80 and 2089 must pass every firewall in between.
  4. Check the hostname and the clock. hostname -f should print a valid FQDN, and timedatectl should show the correct time with NTP active (timedatectl set-ntp true turns it on).

Run cpkeyclt again after each fix, then reload WHM.

FAQ

Can I install cPanel on a server that already hosts websites?

No. cPanel needs a freshly installed OS. Build a new server, install cPanel there, then move existing cPanel accounts with WHM's Transfer Tool.

Does cPanel support Debian or Rocky Linux?

Debian is not on the supported list. Rocky Linux support ended with cPanel 134, which blocks new installs and upgrades on it, so existing Rocky servers need a plan to move to AlmaLinux.

What happens when the 15-day trial ends?

WHM and cPanel stop at a license error until a paid license is active for the server's IP. Once you have bought one, run /usr/local/cpanel/cpkeyclt so the server fetches it.

Is cPanel overkill for a single website?

Often, yes. For one site you manage yourself, a free panel such as Webmin or no panel at all costs less. cPanel pays off when you host many accounts for other people, which is exactly what its license tiers are priced around.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.