How to install cPanel on Ubuntu and AlmaLinux

Installing and configuring cPanel on Ubuntu and AlmaLinux

Introduction

cPanel is one of the most widely used and industry-leading web hosting control panels available today. With over 70,000 server installations powering over 11 million domains, cPanel provides an intuitive graphical interface and robust toolset to easily manage every aspect of a hosting environment.

First launched in 1996, cPanel has been under continual enhancement ever since by CEO Nick Koston and web hosting provider cPanel Inc. The platform aims to provide system administrators, web hosts and other IT professionals with simplified server, site and account management capabilities through an easy-to-use click-based dashboard.

Some of the key features and benefits provided by cPanel include:

  • Automated deployment of web apps like WordPress
  • One-click installation of over 100 other web apps via Softaculous
  • Complete control over files, databases, emails and DNS
  • Domain and subdomain management
  • User and resource usage tracking -Security tools like mod_security firewall
  • Server monitoring and analytics
  • Powerful automation and scripting

With integrated support for features like PHP, Perl, Apache, Exim, DNS and more – plus the ability to quickly add functionality through cPanel plugins – it’s a very full-featured hosting platform.

Now let’s jump in to the steps for getting cPanel fully installed and configured on your own Linux server!

System Requirements and Prerequisites

1. System Requirements for Ubuntu:

  • Firewall Configuration: Before installing cPanel & WHM, it’s recommended to disable the OS firewall. Ubuntu distributions allow you to deactivate the firewall during installation using the following commands:
$ iptables-save > ~/firewall.rules
$ systemctl stop ufw.service
$ systemctl disable ufw.service

After installation, you can configure a firewall using third-party clients like APF or CSF.

2. System Requirements for AlmaLinux OS:

  • Disable SELinux: For compatibility with cPanel & WHM, SELinux must be disabled. You can do this either via the graphical interface or by editing the /etc/selinux/config file:
SELINUX=disabled
SELINUXTYPE=targeted

Ensure that there’s no # preceding the SELINUX=disabled option.

Installing cPanel & WHM

Step 1: Update and Prepare

For Ubuntu:

$ sudo apt update && sudo apt upgrade -y

For AlmaLinux:

$ sudo dnf update -y

Step 2: Set Hostname

For both Ubuntu and AlmaLinux, set your server’s hostname to a Fully Qualified Domain Name (FQDN):

$ sudo hostnamectl set-hostname server.yourdomain.com

Step 3: Install cPanel Dependencies

For Both:

$ sudo apt install -y curl  # For Ubuntu# OR
$ sudo dnf install -y curl  # For AlmaLinux

Step 4: Fetch and Run the Installation Script

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

This command fetches the latest cPanel & WHM installation script and initiates the installation process. The installation may take some time, so be patient.

Customizing Your Installation

Overview:

Before initiating the installation, you can customize various aspects of cPanel & WHM.

Installation Methods:

  • Fast Installation: This method uses tarballs to download specific cPanel & WHM files and utilizes system RPMs or .deb packages, depending on the distribution.

Installation Options:

You can customize the installation using various options:

  • --confirm: Require confirmation before running the installation script.
  • --force: Force installation on an unrecommended configuration.
  • --keep: Retain the target directory post-installation.
  • --nochown: Skip permission assignments for extracted files.
  • --noexec: Avoid running the installation script.
  • --nox11: Prevent spawning an X terminal input terminal.
  • --skip-cloudlinux: Bypass automatic CloudLinux conversion.
  • --skip-wptoolkit: Avoid WP Toolkit installation.
  • --skip-imunifyav: Skip ImunifyAV installation.
  • --target NewDirectory: Extract installation files to a specific directory.
  • --tar arg1 [arg2 ...]: Access the contents of an archive using the tar command.

Important:

If you have a CloudLinux license and don’t want automatic conversion, use the --skip-cloudlinux option.

Conclusion

Installing cPanel & WHM on Ubuntu and AlmaLinux involves a structured approach, addressing specific system requirements and customization options. By carefully following this guide, you’ll successfully set up a cPanel & WHM environment tailored to your preferences. Remember always to prioritize security, keep your systems updated, and periodically review configurations for optimal performance.

LEAVE A COMMENT