Hostname | IP Address | RAM (GB) | Cores | Storage (GB) | OS |
---|---|---|---|---|---|
cpanel.dev.naijalabs.net | 192.168.1.238 | 8 | 4 | 650 | Ubuntu 22.04 LTS (Jammy Jellyfish) |
Learn how to install and configure cPanel on Ubuntu 22.04 with this step-by-step guide. Includes CLI commands, firewall setup, and security enhancements for optimal performance.
cPanel is a powerful web hosting control panel that streamlines server management with an intuitive graphical interface. Although it is not natively supported on Ubuntu, you can install and configure it with a few modifications. This guide provides a comprehensive step-by-step approach to setting up cPanel on Ubuntu 22.04, ensuring optimal performance, security, and usability.
Prerequisites for Installing cPanel on Ubuntu 22.04 |
Before proceeding with the installation, ensure that you have the following:
Requirement | Description |
---|---|
OS | Ubuntu 22.04 (64-bit) |
RAM | Minimum 2GB (4GB recommended) |
CPU | 2 Core Minimum |
Storage | At least 40GB of free space |
Root Access | Required for installation |
Static IP Address | Essential for cPanel functionality |
For this demonstration, we’ve configured our Ubuntu 22.04 LTS server as follows:
Hostname | IP Address | RAM (GB) | Cores | Storage (GB) | OS |
---|---|---|---|---|---|
cpanel.dev.naijalabs.net | 192.168.1.238 | 8 | 4 | 650 | Ubuntu 22.04 LTS (Jammy Jellyfish) |
Step 1: Prepare Your Ubuntu 22.04 System |
To get started, you’ll need to update your server’s packages and make sure that all dependencies are installed.
Update System Packages |
Run the following command to update your system’s package list (then, reboot your machine):
sudo apt update && sudo apt upgrade -y
Photo by admingeek from Infotechys
Step 2: Set the Server Hostname |
For cPanel to function correctly, set a fully qualified domain name (FQDN) for your server. Run:
sudo hostnamectl set-hostname cpanel.dev.naijalabs.net
Replace cpanel.dev.naijalabs.net
with your desired hostname.
Step 3: Disable Network Manager |
By default, Ubuntu 22.04 LTS does not include NetworkManager. However, if it is installed on your system, you must disable it, as cPanel is not compatible with it:
sudo systemctl stop NetworkManager && sudo systemctl disable NetworkManager
Unit /etc/systemd/system/NetworkManager.service is masked, ignoring.
Step 4: Install Perl and Curl |
cPanel installation requires Perl and Curl. Install them using:
sudo apt install perl curl -y
Step 5: Download and Run the cPanel Installation Script |
Navigate to the home directory and execute the installation script:
cd /home
sudo curl -o latest -L https://securedownloads.cpanel.net/latest
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 72421 0 72421 0 0 211k 0 --:--:-- --:--:-- --:--:-- 212k
sudo sh latest
This process does take some time to finish. Once completed, cPanel will be installed.
Photo by admingeek from Infotechys
Step 6: Configure Firewall |
Ensure the required cPanel ports are open:
sudo ufw allow 2083/tcp
sudo ufw allow 2087/tcp
sudo ufw allow 2089/tcp
sudo ufw allow 2096/tcp
sudo ufw enable
Step 7: Access cPanel |
Once installed, you can access cPanel via [https://your-server-ip:2087]: Log in using your root credentials.
Photo by admingeek from Infotechys
Step 8: Configure cPanel |
Here are the essential post-installation tasks you’ll need to complete to ensure a fully functional setup:
Configuration Step | Description |
Licensing | Ensure your cPanel license is active. |
Networking | Confirm the hostname and IP configuration. |
Services | Enable Apache, PHP, MySQL, and email services as required. |
Security | Set up CSF firewall and configure backups. |
Step 9: Secure cPanel Installation |
Enhance your security posture by completing the following: Set complex passwords for the root user account.
sudo passwd root
Enable the firewall:
sudo ufw enable
Ensure the cPanel service starts automatically upon reboot:
sudo systemctl enable --now cpanel
● cpanel.service - cPanel services
Loaded: loaded (/etc/systemd/system/cpanel.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2025-02-26 21:59:58 UTC; 22min ago
Main PID: 38922 (cpsrvd (SSL) - )
Status: "Ready"
Tasks: 1 (limit: 9392)
Memory: 22.3M
CPU: 1.712s
CGroup: /system.slice/cpanel.service
└─38922 "cpsrvd (SSL) - waiting for connections "
...omitted for brevity...
Installing and configuring cPanel on Ubuntu 22.04 requires a few workarounds but is entirely possible with the right approach. By following the steps outlined above, you can successfully set up a fully functional web hosting environment. Always keep your system updated and implement security best practices to maintain a robust server setup.
We hope you found this guide helpful! Your feedback is highly valuable to us. Feel free to share this post along with, your thoughts, questions, or suggestions in the comments section below.
In this comprehensive guide, we’ll walk you through the step-by-step process of installing Podman on Ubuntu 22.04, empowering you to leverage its capabilities for your
In this guide, we’ll walk you through how to install AnyDesk on Ubuntu 22.04, ensuring a smooth and hassle-free setup process for seamless remote desktop
In this guide, we’ll walk you through the seamless process of migrating from Ubuntu 20.04 to 22.04, ensuring a smooth transition without losing any data