---
title: 'Installation of cPanel/WHM on Ubuntu 22.04 | Zomro'
description: 'In this article, we will take a detailed look at how to install cPanel and WHM on a server running Ubuntu 22.04 (LTS).'
image: 'https://dx86q6oq7ry0e.cloudfront.net/uploads/blog/a48%40server-panel.net/2025/05/01/chatgpt-image-1-2025-17_12_06_q50.jpg'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [FAQ](https://zomro.com/blog/faq/)
  * Installation of cPanel/WHM on Ubuntu 22.04 



# Installation of cPanel/WHM on Ubuntu 22.04

30-04-2025

![](https://dx86q6oq7ry0e.cloudfront.net/uploads/blog/a48%40server-panel.net/2025/05/01/chatgpt-image-1-2025-17_12_06_q50.jpg)

Among the wide variety of server control panels for Linux, cPanel holds a special place. Despite its relatively high cost compared to free alternatives, cPanel remains the number one choice for many system administrators and web project owners due to its user-friendly interface, extensive set of built-in tools, and flexible settings.

In this article, we will take a detailed look at how to install cPanel and WHM on a server running Ubuntu 22.04 (LTS), as well as explain the purpose of the main actions necessary for the successful launch and configuration of the server.

## 

## Main Features of cPanel and WHM

**cPanel** is a user interface designed for managing websites and services:

  * Management of domains, addon domains, and subdomains.

  * Creation and administration of email accounts.

  * Monitoring statistics and analyzing log files.

  * Working with databases.

  * File management through the built-in file manager.

  * Setting up SSL certificates and managing security.




**WHM (Web Host Manager)** is an administrative panel for managing the server and user accounts:

  * Configuration and monitoring of server services (Apache/Nginx, MySQL, PHP).

  * Creating backups and migrating data.

  * Installing and configuring third-party plugins.

  * Managing panel branding and reseller access.




## 

## Installing cPanel/WHM on Ubuntu 22.04

### 

### **Preparing the Server and Disabling the Built-in Firewall**

Before starting the installation, it is necessary to disable the built-in firewall, as it may block the ports required for cPanel to function.

First, save the current rules:
    
    
    iptables-save > ~/firewall.rules
    

Then disable the service if it is running:
    
    
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    

After the installation is complete, you can re-enable and configure the **firewall** considering the open ports for cPanel.

Update the Ubuntu packages:
    
    
    apt update
    apt upgrade
    

### 

![](https://dx86q6oq7ry0e.cloudfront.net/uploads/blog/a48%40server-panel.net/2025/05/01/00_q50.jpg)

### **Setting the Fully Qualified Domain Name (FQDN)**

cPanel requires a fully qualified domain name (**FQDN**). This domain name must point to the IP address of your server in advance.

Set the desired hostname with the command:
    
    
    hostnamectl set-hostname cpanel.yourdomain.com
    

Then edit the **`/etc/hosts`** file and add a line, replacing the IP with your actual one:
    
    
    192.168.0.50 cpanel.yourdomain.com cpanel
    

### 

### **Starting the cPanel Installation**

To start the installation, you need to download the official script and execute it:
    
    
    cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
    

![](https://dx86q6oq7ry0e.cloudfront.net/uploads/blog/a48%40server-panel.net/2025/05/01/01_q50.jpg)

The installation process usually takes from 20 to 60 minutes, depending on the server's power.

### 

## **Possible Difficulties During Installation**

During the installation of cPanel, typical errors may occur:

**Error starting background process EA4 Install (error 127)**

Restart the installation with the command:
    
    
    /usr/local/cpanel/scripts/cpanel_initial_install script

![](https://dx86q6oq7ry0e.cloudfront.net/uploads/blog/a48%40server-panel.net/2025/05/01/02_q50.jpg)

**Error accessing the MariaDB repository (403 Forbidden, IPv6)**

Uncomment the line in the **/etc/gai.conf:**
    
    
    precedence ::ffff:0:0/96  100

![](https://dx86q6oq7ry0e.cloudfront.net/uploads/blog/a48%40server-panel.net/2025/05/01/03_q50.jpg)

**Then restart the EasyApache 4 installation:**
    
    
    /scripts/ea4_fresh_install

**Request to build localization JS files after installation**
    
    
    /usr/local/cpanel/bin/_build_translated_js_files $locale en

### **Accessing the WHM/cPanel Panel**

After a successful installation, you will be able to access WHM through a browser at any of the following addresses:

  * **`https://[IP]:2087`**

  * **`https://[IP]/whm`**

  * **`https://fqdn-hostname/whm`**

  * **`https://fqdn-hostname:2087`**




### 

![](https://dx86q6oq7ry0e.cloudfront.net/uploads/blog/a48%40server-panel.net/2025/05/01/04_q50.jpg)

### **Additional Step — Activating the cPanel License**

The cPanel license is tied to the server's IP address. If after installation you see a message about needing to purchase a license or use a trial version, execute the command:
    
    
    /usr/local/cpanel/cpkeyclt
    

## 

## Recommendations for Optimizing and Improving Server Performance

  * Regularly check for updates to the control panel and install them in a timely manner.

  * Use a reliable backup and regularly check its functionality through WHM.

  * Set up a monitoring system for server resources and services, using the built-in capabilities of WHM or third-party solutions like Munin.

  * Optimize the performance of Apache/Nginx and MySQL through the built-in WHM utilities, selecting suitable profiles for your tasks.

  * Use the automatic SSL certificate renewal feature (AutoSSL) to enhance security and convenience.

  * Restrict access to WHM and cPanel only from trusted IP addresses.

  * Consider installing additional security modules, such as Imunify360, for extra protection of your server against malicious attacks.




By following this guide, even novice users will be able to install and properly configure the cPanel/WHM control panel, as well as ensure stable and secure operation of their websites and services.

Similar articles:

[Adding resource records to a domain in DNS hosting](https://zomro.com/blog/faq/296-dobavlenie-zapisej-v-dns-hosting) [htop - Linux interactive system monitor](https://zomro.com/blog/faq/314-htop-interaktivnyj-sistemnyj-monitor-linux) [How to install Minecraft: Java Edition server on Ubuntu 20.04](https://zomro.com/blog/faq/225-ustanovka-servera-igry-minecraft-java-edition-na-ubuntu-2004) [How to connect to a server via FTP, SFTP, and SCP](https://zomro.com/blog/faq/144-kak-podkljuchitsja-k-serveru-po-ftp-sftp-i-scp) [What is FTP and how to use it to upload files to a server?](https://zomro.com/blog/faq/543-what-is-ftp-and-how-do-i-use-it-to-upload-files-to-a-server)

[ Premium Cloud VPS from €7.95/mon ](/vps)
