How to install cPanel & WHM on AlmaLinux
This guide installs cPanel & WHM on a fresh AlmaLinux server with the official installer. Plan for about an hour, most of it waiting for the installer.
Before you start
- A fresh, minimal AlmaLinux install (64-bit x86). cPanel will not install over an existing web server, control panel or mail server.
- At least 2 GB RAM (4 GB recommended) and 20 GB disk (40 GB or more recommended).
- A public IPv4 address and root SSH access.
- An active cPanel license for that IP: Cloud for a VPS, Metal for a dedicated server.
- A hostname that is a fully qualified domain name, such as
server.example.com, which is not used by any website.
Check which AlmaLinux releases your cPanel version supports in cPanel's system requirements before you install. Newer AlmaLinux releases need newer cPanel versions.
1. Set the hostname
hostnamectl set-hostname server.example.com
Create an A record for that hostname pointing to the server IP at your DNS provider. cPanel uses it for its own SSL certificate and for mail.
2. Update the system
dnf -y update
reboot
Reboot if the kernel was updated, then log back in as root.
3. Open a session that survives disconnects
The installer runs for a long time. If your SSH connection drops, it stops. Run it inside tmux:
dnf -y install tmux
tmux new -s cpanel
If you get disconnected, log back in and run tmux attach -t cpanel.
4. Run the cPanel installer
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
This is cPanel's official command. It downloads the installer and sets up WHM, cPanel, Apache (EasyApache 4), PHP, Exim, Dovecot, the DNS server and MySQL or MariaDB. When it finishes, it prints a link to WHM.
5. Log in to WHM
Open https://YOUR-SERVER-IP:2087 in a browser and log in as root with the root password. Your browser will warn about the certificate on first visit; that is expected until AutoSSL issues one for the hostname.
The setup wizard asks you to accept the license agreement, enter a contact email and set nameservers. You can change all of these later in WHM.
6. Check the license
Enter your server IP at verify.cpanel.net. If WHM shows a license error right after you ordered, refresh the license from the command line:
/usr/local/cpanel/cpkeyclt
7. Open the right ports
If your provider has a firewall in front of the server, allow at least 80 and 443 (websites), 2083 (cPanel), 2087 (WHM), 2096 (webmail), 25, 465, 587, 993 and 995 (mail), 53 TCP and UDP (DNS, if you run it) and your SSH port.
What to install next
- CloudLinux OS to stop one account from slowing the server down (see how to convert AlmaLinux to CloudLinux).
- Imunify360 for firewall and malware scanning.
- LiteSpeed for faster PHP sites (see how to switch cPanel to LiteSpeed).
- JetBackup for incremental backups your customers can restore themselves.