cPanel is one of the world’s most popular control panels for Linux servers. Although it is not the cheapest option available out there, its user-friendly UI along with the huge variety of plugins and tools that come with cPanel/WHM, make it the best control panel software IT admins and webmasters prefer in 2023.
Although cPanel and WHM are two different portals, there is only one installation process that will deploy them both. Let’s see the main features of cPanel and WHM before proceeding to the rest of this tutorial.
cPanel Features
- Domains / Addon Domains / Subdomains Management
- E-mail accounts administration
- Log files and Statistics
- Database management
- File Manager
- SSL Certificates and other security settings
- … and more
WHM Features
- Server configuration and monitoring
- Services fine tuning (mail, ftp, apache/nginx, php, etc)
- Backup settings and Migration tool
- 3rd-party plugins installation and management
- Manage cPanel Own branding
- Resellers management
- … and more
Easy Guide to Install cPanel/WHM on Ubuntu 22.04 Server (4 Steps)
Let’s take a look on how you can install cPanel/WHM on Linux Ubuntu 22.04 (LTS) server in six (6) easy steps.
Step 1 – Disable firewalld and Update system
If you have an active firewall, disable and stop it prior installing cPanel. Upon completion of the installation you can re-enable it.
root@ubuntu22.04:~$ iptables-save > ~/firewall.rules
root@ubuntu22.04:~$ systemctl stop firewalld.service
root@ubuntu22.04:~$ systemctl disable firewalld.service
Then, update the server’s packages using the command below:
root@ubuntu22.04:~$ apt update && apt upgrade
Step 2 – Set Hostname (FQDN)
cPanel requires that the server is associated with a fully qualified domain name (fqdn) for the installation to begin and complete without errors.
Let’s say your desired hostname is cpanel.netshop-isp.com.cy and this sub-domain points to your server’s IP address, then we are going to set it on the server as follows:
root@ubuntu22.04:~$ vi /etc/hostname
When the hostname file opens delete any entries and enter your hostname cpanel.netshop-isp.com.cy. Then save and close the file.
Now, open /etc/hosts file and add the following entry (replace the IP with the real IP of your server):
192.168.1.1 cpanel.netshop-isp.com.cy cpanel
Once done, save and close the file.
Step 3 – Install cPanel/WHM
Once all the above steps are completed, you are now ready to download the official script and run it for the installation to begin.
root@ubuntu22.04:~$ cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
If no errors come up, the installation should be finished in a couple of minutes.
Step 4 – Access WHM/cPanel GUI
You can now access your WHM GUI by typing the hostname or IP address on your browser, in any of the following ways:
https://[server-ip]:2087
https://[server-ip]/whm
https://fqdn-hostname/whm
https://fqdn-hostname:2087
Extra Step (if needed) – Activate License
cPanel licenses are IP-based, meaning that upon order of a cPanel license you need to enter the server’s IP so that it can automatically activate it once you install it on a server.
If you have a valid license purchased and you still see the message to “Purchase a License” or “Continue with Trial”, execute the following command on your server. The command will refresh the license activation over the internet.
root@ubuntu22.04:~$ /usr/local/cpanel/cpkeyclt