The only drawback of cPanel is that it’s neither open-source nor free. The same is true for Plesk. However, both are widely known and extensively used.
If you’re looking for a powerful solution to manage your web server or even resell web hosting services, check out if CloudPanel CE [Link] meets your requirements.
Back to cPanel: This tutorial focuses on installing cPanel and configuring essential server settings. It does not cover how to use cPanel itself.
Originally designed to run on CentOS, cPanel later provided an upgrade path to AlmaLinux for existing installations. It now supports Ubuntu 22.04 LTS, finally!
SYSTEM REQUIREMENTS
Deploy a fresh default installation of Ubuntu 22.04 LTS (do not enable AppArmour). And switch to root.
sudo su -
UFW (firewall) has to be disabled. This is a bummer having to downgrade security.
iptables-save > ~/firewall.rules systemctl stop ufw.service systemctl disable ufw.service
Set an FQDN as its hostname.
hostnamectl set-hostname cpanelserver.mydomain.com
Add “cpanelserver.mydomain.com“ and “cpanelserver“ to /etc/hosts. Example with a fake public IP:
127.0.0.1 localhost cpanelserver 200.200.200.200 cpanelserver.mydomain.com
Upgrade all packages of the system to the latest.
apt update && apt upgrade -y
FULL CPANEL INSTALLATION
Download and execute the installation script.
cd /home && 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
On the browser, log in with the system root account and its password to complete the installation.
Alternatively, a URL will be generated at the end of the installation. Use that instead, and create an administrator account (other than root).
INSTALLING CPANEL DNS ONLY AND WP SQUARED
The “DNS ONLY” license of cPanel is a free limited-feature cPanel & WHM server type.
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest-dnsonly && sh latest
Now create a DNS cluster to synchronize the configuration from the Master to the DNS Only Slave.
The DNS Squared is a build tailored specifically for WordPress.
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest-wp2 && sh latest
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.
BONUS
I strongly recommend trying out CloudPanel because of its lightweight and simplicity. The performance if extremely superior to cPanel and Presk at no cost.
sudo apt update && sudo apt -y upgrade && sudo apt -y install curl wget curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \ echo "a3ba69a8102345127b4ae0e28cfe89daca675cbc63cd39225133cdd2fa02ad36 install.sh" | \ sha256sum -c && sudo bash install.sh
Navigate to: https://200.200.200.200:8443 (use the real public or private IP).
Some terminal commands can be used for automation or password recovery [Link].