This guide installs cPanel & WHM on a new server: WHM is the administrator's control panel, and cPanel is the panel each hosting account gets. The whole installation is one command, but the server has to be prepared first.
Quick answer
On a freshly installed AlmaLinux 8, 9 or 10, CloudLinux, or Ubuntu 24.04 server, logged in as root:
-
Set a fully qualified hostname, for example
hostnamectl set-hostname server1.example.com. -
Turn off the OS firewall (
firewalldon AlmaLinux,ufwon Ubuntu). -
Run the installer:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest -
When it finishes, open
https://YOUR-SERVER-IP:2087and log in as root.
What you need
-
A supported operating system, freshly installed. cPanel must go on a clean system with nothing else set up on it. cPanel
System Supported versions AlmaLinux 8, 9, 10 (10 needs cPanel 132 or later) CloudLinux supported; see cPanel's requirements page Ubuntu 24.04 LTS only Rocky Linux no longer supported CentOS 7 no longer supported -
Hardware: a 64-bit x86 CPU (ARM is not supported), at least 2 GB RAM (4 GB recommended, 3 GB or more if you want ClamAV) and at least 20 GB disk (40 GB recommended). cPanel
-
A static, public IPv4 address. IPv6-only servers and DHCP addresses are not supported. cPanel
-
A license for the server's IP address, from the cPanel Store or your provider. New installations can start a free 15-day trial. cPanel
-
Root access over SSH.
There is no uninstaller: to remove cPanel later, you must reinstall the operating system. cPanel
Step 1: Set the hostname
The hostname must be a fully qualified domain name (such as server1.example.com) that: cPanel
- is not the same as any website domain you will host,
- is at most 60 characters long,
- resolves in DNS to the server's IP address.
Set it with:
hostnamectl set-hostname server1.example.com
Then create an A record for server1.example.com pointing to the server's IP address at your DNS provider. If the hostname does not resolve, cPanel gives the server an automatic hostname instead, which you can change later; see How to Change the Hostname. cPanel
Step 2: Turn off the OS firewall
cPanel recommends turning off the system firewall before installing, and setting up a firewall such as CSF afterwards. Save the current rules first, in case you need them: cPanel cPanel
On AlmaLinux or CloudLinux:
iptables-save > ~/firewall.rules
systemctl stop firewalld.service
systemctl disable firewalld.service
On Ubuntu:
iptables-save > ~/firewall.rules
systemctl stop ufw.service
systemctl disable ufw.service
If your provider has a firewall in its control panel, make sure ports 2087 (WHM) and 2083 (cPanel) are open there, as well as 22 (SSH), 80 and 443 (websites).
Step 3: Check SELinux (AlmaLinux)
If you installed AlmaLinux from your own image rather than one provided by cPanel, SELinux must be disabled. cPanel Check it with:
getenforce
If it says Enforcing or Permissive, set SELINUX=disabled in /etc/selinux/config with vi, then reboot before installing.
Step 4: Run the installer
Start a screen or tmux session first, so the installation keeps running if your SSH connection drops. Then run:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
This downloads the newest cPanel & WHM and installs it, with all the services it needs (web server, mail, DNS, databases). cPanel It usually takes 30 minutes or more.
Do not install other software (for example a web server or database) before or during the installation: cPanel installs its own, and other copies cause conflicts. cPanel
If the server's IP address has an active CloudLinux license, the installer converts AlmaLinux to CloudLinux automatically. To keep AlmaLinux, add --skip-cloudlinux to the end of the sh latest command. cPanel
Step 5: Log in to WHM
At the end, the installer prints a one-time login link. Open it, or go to:
https://YOUR-SERVER-IP:2087
Your browser warns about the certificate at first; that is expected, since the server does not have a trusted certificate yet. Log in as root with the root password.
WHM then walks you through the first setup: accepting the license agreement, a contact email address, nameservers, and the license. Afterwards:
- Set up a firewall such as CSF; see How to Install CSF Firewall.
- Create your first account in WHM › Account Functions › Create a New Account.
Troubleshooting
The installer stops with a memory or OS error. The server does not meet the requirements above. The installer checks RAM before it starts. cPanel
The installer says the license is invalid. Check that the license is for this server's public IP address. Servers behind NAT need a 1:1 NAT with NAT loopback. cPanel
You cannot reach port 2087. A firewall is still blocking it: either the OS firewall (Step 2) or your provider's firewall.
The installation was interrupted. Check /var/log/cpanel-install.log for the last error. Because cPanel must go on a fresh system, the safest fix for a broken installation is to reinstall the operating system and start again.