How to Install cPanel on AlmaLinux 8


cPanel is a widely used web hosting control panel that simplifies website and server management. Installing it on AlmaLinux 8, an emerging CentOS alternative, can seem daunting, but with the right steps, it's straightforward. This article will guide you through the process, ensuring you have a smooth installation experience.

Prerequisites

  • A fresh installation of AlmaLinux 8.
  • Root access or a user with sudo privileges.
  • Minimum 2GB RAM (4GB or more recommended).
  • At least 20GB of free disk space.

Step 1: System Update and Upgrade

First, ensure your system is up-to-date with the latest packages and security patches. This step is crucial for system stability and security.

sudo yum update && sudo yum upgrade -y

Step 2: Install Apache HTTP Server

Apache is a popular web server software. cPanel requires it to function properly.

sudo yum install httpd
sudo systemctl restart httpd

Step 3: Update DNF Package Manager

DNF is the next-generation package manager for AlmaLinux. Update it to ensure you have the latest version.

sudo dnf update -y

Step 4: Install and Configure Firewalld

Firewalld is a firewall management tool. It's essential for managing network access and protecting your server.

sudo dnf install firewalld -y
sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo systemctl status firewalld

Next, add necessary ports to the firewall rules. cPanel and associated services require these ports to operate.

sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --permanent --add-port=2087/tcp
sudo firewall-cmd --permanent --add-port=2083/tcp
sudo firewall-cmd --permanent --add-port=3306/tcp
sudo systemctl restart firewalld

Step 5: Set SELinux Context for Apache

Ensure Apache has the correct SELinux permissions to modify web content.

sudo chcon -Rt httpd_sys_rw_content_t /var/www

Step 6: Install PHP and Extensions

cPanel supports various PHP applications. Installing PHP and necessary extensions ensures compatibility.

sudo yum install php
sudo dnf install php php-opcache php-gd php-curl php-mysqlnd php-xml php-mbstring php-pecl-apcu
sudo systemctl enable --now php-fpm
sudo service httpd restart

Step 7: Install Perl

Perl is required for running the cPanel installation script.

sudo yum install perl

Step 8: Download and Install cPanel

Finally, download and run the cPanel installation script.

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

sudo sh latest

Once the installation completes, you can access the cPanel & WHM interface through your web browser using your server's IP address followed by the port 2087 (for WHM) or 2083 (for cPanel). The installation process may take some time, so be patient.

  • install cpanel on almalinux, alma linux cpanel, install cpanel almalinux 8, cpanel install almalinux, install cpanel almalinux, almalinux 8 cpanel, cpanel almalinux
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to Install Softaculous on AlmaLinux 8

Softaculous, a widely used auto-installer script library, can be seamlessly integrated with...

How to Fix GPG check FAILED Error on AlmaLinux 8

If you're encountering the 'GPG check FAILED' error on AlmaLinux 8, this can hinder package...