How to Install cPanel on VPS or Dedicated Server (Ubuntu, CentOS, and AlmaLinux)

cPanel is a widely-used web hosting control panel that simplifies server management. Here's a step-by-step guide to installing cPanel on Ubuntu 22.04 LTS, CentOS, and AlmaLinux.


Prerequisites

  1. A fresh server installation (minimal setup).
  2. A public static IP address.
  3. Root access.
  4. Minimum hardware: 2 GB RAM, 20 GB disk space (higher recommended).

For Ubuntu 22.04 LTS (Jammy Jellyfish)

Step 1: Update the System

Make sure your system is up to date:

bash
apt update && apt upgrade -y

Step 2: Set the Hostname

Set an FQDN for the server:

bash
hostnamectl set-hostname server.yourdomain.com

Step 3: Install Perl

cPanel requires Perl to run the installer:

bash
apt install perl -y

Step 4: Install cPanel

Download the cPanel installation script and run it:

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

The installation will take some time depending on your server's specifications.

Step 5: Access WHM

Once installed, access WHM (Web Host Manager) at:

arduino
https://your-server-ip:2087

Log in with your root credentials and follow the setup wizard.


For CentOS and AlmaLinux

Step 1: Update the System

Run:

bash
yum update -y

Step 2: Set the Hostname

Set a fully qualified domain name:

bash
hostnamectl set-hostname server.yourdomain.com

Step 3: Disable SELinux

Edit the SELinux configuration file:

bash
nano /etc/selinux/config

Set SELINUX=disabled and save. Then reboot:

bash
reboot

Step 4: Install cPanel

Run the installation script:

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

Step 5: Access WHM

Log in via:

arduino
https://your-server-ip:2087

Post-Installation Steps

  1. Activate License: WHM will prompt for license activation.
  2. Set Nameservers: Configure DNS.
  3. Security Hardening: Set up firewalls and other protections.

Key Differences

  • CentOS: Stable but no longer actively developed (CentOS 7 is supported until 2024).
  • AlmaLinux: Actively supported and recommended for new installations.
  • Ubuntu 22.04: A newly supported OS by cPanel, suitable for those familiar with Ubuntu environments.

Conclusion

cPanel installation is now possible on Ubuntu 22.04, making it a versatile choice alongside CentOS and AlmaLinux. Follow the steps above to get started with cPanel on your VPS or dedicated server.

Related Articles

STAY TUNED
Image