How to Install cPanel and WHM
This guide walks you through installing cPanel and WHM on a freshly installed server. WHM is the server's administration interface; cPanel is the panel of each hosting account you create in WHM.
Before you start
- Fresh install: cPanel is installed only on a freshly installed operating system. If you have already installed services such as a web, mail or database server, you will run into compatibility issues.
- No uninstaller: cPanel cannot be removed. If you change your mind later, you need to reinstall the server's operating system.
- License: every cPanel server needs its own license. A cPanel license bought from Verinomi is bound to your server's main IPv4 address, and cPanel picks it up by itself once installed.
Supported operating systems
cPanel officially supports AlmaLinux, Rocky Linux, CloudLinux and Ubuntu 24.04 LTS. You can select a cPanel license when ordering VDS servers running AlmaLinux 8, 9 and 10 or Ubuntu 24.04. On Ubuntu, cPanel installs only on version 24.04.
Hardware requirements
| Minimum | Recommended | |
|---|---|---|
| Memory (RAM) | 2 GB | 4 GB |
| Disk | 20 GB | 40 GB |
Installation and updates also need at least 5 GB of free space in the /usr/local/cpanel directory. The server must have at least one IPv4 address; cPanel cannot run on an IPv6-only server. The IP address must be static; an address assigned by DHCP cannot be used.
1. Set the hostname
The hostname must be a full domain name (for example server.exampledomain.com). cPanel's rules are:
- It must be a fully qualified domain name (FQDN) under a registered domain,
- It must not match any of the domains you will host on the server,
- It must be at most 60 characters long,
- It must resolve to a valid IPv4 or IPv6 address; add an A record for the hostname pointing to your server's IP address in your domain's DNS.
hostnamectl set-hostname server.exampledomain.com
We recommend also setting the hostname as the reverse record (rDNS / PTR) of your IP address; it matters for email delivery. You can edit the reverse record in your client area.
2. Disable SELinux (AlmaLinux)
cPanel does not run with SELinux enabled, and SELinux must remain disabled afterwards. Check its status with:
getenforce
If the result is not Disabled, change the line in /etc/selinux/config as follows and reboot the server:
SELINUX=disabled
reboot
This step is not needed on Ubuntu; do not install SELinux on Ubuntu. AppArmor on Ubuntu is compatible with cPanel and does not need to be disabled.
3. Disable the firewall for the installation
cPanel recommends disabling the operating system firewall before you start the installation. On AlmaLinux, first save the existing rules, then stop firewalld:
iptables-save > ~/firewall.rules
systemctl stop firewalld.service
systemctl disable firewalld.service
On Ubuntu, if ufw is enabled you can turn it off with ufw disable. We recommend protecting your server with a firewall again after the installation; remember to keep cPanel's ports (below) open.
On AlmaLinux 8 the installer disables NetworkManager by itself and enables network.service instead. On AlmaLinux 9 and later, NetworkManager is left as it is.
4. Install cPanel
Connect to the server over SSH as root and run:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
The command downloads the latest version of cPanel and runs the installation script. The installation takes a while; do not close your SSH session and do not install other software on the server in the meantime. When it finishes, you will see a message saying the installation is complete.
5. First login to WHM
Open your server's IP address with port 2087 in your browser:
https://203.0.113.10:2087
Log in with the username root and your server's root password. Since there is no valid SSL certificate yet, your browser may show a security warning on the first login; if you are sure you are connecting to your own server's address, you can continue.
If you would rather log in without typing a password in the browser, this command run over SSH creates a one-time login link:
/usr/local/cpanel/scripts/whmlogin
On the first login WHM asks you for the following:
- Agreements: you need to accept cPanel's end user license agreement and its other terms.
- License: if your license was bought from Verinomi, it is bound to your server's IP address and you do not need to activate a trial license. If the screen says no license was found, you can open a support ticket from your client area.
- Contact email and nameservers: enter an email address for server notifications and two nameservers (for example
ns1.exampledomain.com,ns2.exampledomain.com). Without nameservers you cannot create accounts.
Ports used
| Port | Used for |
|---|---|
| 2087 | WHM (SSL) |
| 2083 | cPanel (SSL), the panel of hosting accounts |
These ports are also used for license checks. When writing firewall rules, always keep a way to log back in to the server.
Troubleshooting
- The installation stops with a hostname error: check that the hostname is a full domain name and resolves to your server's IP address in DNS.
- License error in WHM: the license must be bound to your server's main IPv4 address. If your main address has changed or the license is bound to another address, you can open a support ticket and we will move the license to the right address.
- WHM does not open: if the server has a firewall, check that port 2087 is open.
Let us install it for you
If you buy your cPanel license from Verinomi, our team installs it for you. Just open a support ticket from your client area after ordering the license.
The information in this guide is taken from the vendor's official documentation: cPanel Installation Guide.