cPanel has only one problem: it is not open source, neither free.

But if you want to use it to manage your web server and even resell the web hosting service to your customer it is a great solution.

This is a tutorial for installing and making some essential configuration on the server, not a tutorial about how to use cPanel.

Note that cPanel only supports RedHat, CentOS, and CloudLinux OS.


INSTALLING CPANEL & WHM

Deploy CentOS 8 on a server or virtual machine, then mane it with an FQDN.

hostnamectl set-hostname cpanelserver.mydomain.com

Remember to add cpanelserver.mydomain.com and cpanelserver to /etc/hosts.

Install Perl, Curl, and download+execute the installation script:

yum install curl perl
curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest

That is pretty much it!

Now go to your browser and access the following address using your root credentials from the Linux console.

https://1.2.3.4:2087

To be able to enable the 2FA on your server, issue the following command on the terminal:

touch /var/cpanel/enable_twofactor_ui && /usr/local/cpanel/whostmgr/docroot/themes/x/rebuildtmpl

Eventually, the default route will be lost, in case it happens issue the following command pointing to your gateway to restore the internet connectivity:

ip route add default via 192.168.0.1 dev eth0 metric 100

INSTALLING CPANEL DNS ONLY

The “DNS ONLY” license of cPanel is a free limited-feature cPanel & WHM server type.

curl -o latest-dnsonly -L https://securedownloads.cpanel.net/latest-dnsonly
sh latest-dnsonly

Now create a DNS cluster to synchronize the configuration from the Master to the DNS Only Slave.


CLUSTERING AND DNS CLUSTERING

ON THE SLAVE

Manage API Tokens > Generate Token.

Select: Everything

ON THE MASTER

Configuration Cluster > Create. Insert the IP of the Slave and the generated token.

DNS Cluster > Enable DNS Clustering.

Manage API Tokens > Generate Token.

Select: Everything

ON THE SLAVE

Configuration Cluster > Create. Insert the IP of the Master and the generated token.

DNS Cluster > Enable DNS Clustering.

ON THE MASTER

Manage API Tokens > Generate Token.

Select: Everything

ON THE SLAVE

DNS Cluster > Add a new server to the cluster > Configure. Insert the IP of the Master and the generated token.

Manage API Tokens > Generate Token.

Select: Everything

ON THE MASTER

DNS Cluster > Add a new server to the cluster > Configure. Insert the IP of the Slave and the generated token.