How to Install cPanel on CentOS 7/8, AlmaLinux/Rocky Linux 8/9, Ubuntu 20.04/22.04

How to Install cPanel on CentOS 7/8, AlmaLinux/Rocky Linux 8/9, Ubuntu 20.04/22.04

How to Install cPanel

cPanel is one of the most popular web hosting control panels that allows users to manage their websites and servers efficiently. In this guide, we will walk you through the installation process of cPanel on different supported operating systems.

📌 Prerequisites

  • A fresh installation of CentOS, AlmaLinux, Rocky Linux, or Ubuntu
  • A minimum of 2 GB RAM (4 GB recommended)
  • At least 40 GB of free disk space
  • Root or sudo privileges
  • A valid cPanel license

📌 Step 1: Update Your System

Before installing cPanel, update your system packages.

🔹 For CentOS 7/8

yum update -y

🔹 For AlmaLinux/Rocky Linux 8/9

dnf update -y

🔹 For Ubuntu 20.04/22.04

apt update && apt upgrade -y

📌 Step 2: Set the Hostname

cPanel requires a valid FQDN (Fully Qualified Domain Name) as the hostname.

hostnamectl set-hostname panel.yourdomain.com

Replace panel.yourdomain.com with your actual domain.

📌 Step 3: Disable SELinux (For CentOS, AlmaLinux, Rocky Linux)

Ensure SELinux is disabled before installing cPanel.

setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

📌 Step 4: Install cPanel

Now, install cPanel using the official installation script.

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

📌 Step 5: Access cPanel

Once the installation is complete, you can access cPanel using:

https://your-server-ip:2087

Log in using your root credentials and complete the setup.

✅ Conclusion

By following this guide, you can successfully install cPanel on CentOS, AlmaLinux, Rocky Linux, or Ubuntu. If you encounter any issues, refer to the cPanel documentation or contact your hosting provider.

Enjoy managing your server with cPanel! 🚀