cPanel/WHM is the most widely used web hosting control panel in the world. In this guide we walk you step by step through installing cPanel from start to finish on a VDS or dedicated server with a clean AlmaLinux installation, the first settings you should make in WHM after installation, and the most common mistakes.
What are cPanel and WHM?
WHM (WebHost Manager) is the server's administration panel; hosting packages, accounts, DNS and server services are managed here. cPanel is the user panel for each hosting account; email, databases, the file manager, SSL and similar tasks are handled in cPanel. Both come together in a single installation.
Requirements
- Operating system: A clean (minimal) installation of AlmaLinux 8/9, Rocky Linux or CloudLinux. Services such as Apache or MySQL must not be pre-installed.
- Hardware: At least 2 CPU cores, 4 GB RAM and 40 GB of disk space are recommended. An NVMe disk speeds up the installation considerably.
- A static IP address and root access.
- A fully qualified domain name (FQDN) for the server, for example
server.alanadiniz.com.
On MerkezHost VDS servers you can choose AlmaLinux as the operating system and jump straight into this guide. Taking a fresh snapshot of the server before installation saves time if something goes wrong.
Step 1: Connect to the server via SSH
Connect to your server as root using PowerShell or PuTTY on Windows, or Terminal on macOS/Linux:
ssh root@SUNUCU_IP_ADRESIStep 2: Update the system
Before starting the installation, update all packages and reboot the server if necessary:
dnf -y update
rebootStep 3: Set the hostname (server name)
cPanel requires the server name to be an FQDN. Replace server.alanadiniz.com with a name based on your own domain:
hostnamectl set-hostname server.alanadiniz.com
hostnameDon't forget to create an A record in your domain's DNS management pointing the server subdomain to your server's IP address.
Step 4: Run the cPanel installation script
It is recommended to run the installation inside screen so that it isn't interrupted if your SSH session drops:
dnf -y install screen perl curl
screen -S cpanel
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latestThe installation is fully automatic and usually takes 30-60 minutes. If your connection drops, reconnect and return to the session with the screen -r cpanel command.
The installation script should only be run on a clean operating system. On systems where a web server or another panel has already been installed, the installation will fail or end up with problems.
Step 5: First login to WHM
When the installation is complete, log in to WHM from your browser:
https://SUNUCU_IP_ADRESI:2087The username is root and the password is your server's root password. It is normal to see an SSL warning on first login; the server does not have a valid certificate yet.
Initial setup wizard
- Accept the license agreement.
- Enter the server contact email address (alerts will be sent to this address).
- Enter the nameserver details, for example
ns1.alanadiniz.comandns2.alanadiniz.com. - After completing the setup, review the settings under Home » Server Configuration » Basic WebHost Manager Setup.
Step 6: Licensing
After installation, cPanel runs as a 15-day trial. Before the trial ends you need to have a cPanel license assigned to your server's IP address. Once the license is active, you can refresh it with the following command:
/usr/local/cpanel/cpkeycltRecommended post-installation settings
- AutoSSL: Enable the Let's Encrypt provider under WHM » SSL/TLS » Manage AutoSSL; all accounts then get free SSL automatically.
- PHP versions: Install the PHP versions and extensions you need with EasyApache 4.
- Backups: Configure daily backups to a remote destination (FTP/S3) under WHM » Backup Configuration.
- Security: Enable cPHulk brute-force protection and disable password login for SSH. For details, see our SSH security guide.
Common errors
“Hostname is not a FQDN” error
Make sure the hostname is a full domain name containing at least two dots (server.alanadiniz.com). Then restart the installation.
The installation was interrupted
Cleaning up a half-finished installation is difficult. The safest approach is to reinstall the operating system and start the installation from scratch.
Conclusion
With these steps your cPanel/WHM server is ready to use. You can now create hosting packages and open customer accounts in WHM. If you'd rather have a ready-made cPanel infrastructure than manage your own server, take a look at our cPanel hosting plans, or our reseller hosting plans to sell under your own brand.
Frequently Asked Questions
How long does a cPanel installation take?
Depending on the server's hardware and network speed, the installation usually takes 30-60 minutes. On a VDS server with NVMe disks, it takes less time.
Is cPanel free?
No. cPanel is licensed software; a 15-day trial period is provided after installation. When it ends, you need to purchase a license priced according to the number of accounts.
Which operating systems does cPanel run on?
Current cPanel versions support AlmaLinux, Rocky Linux, CloudLinux and Ubuntu LTS releases. The installation must always be done on a clean (minimal) operating system.
