Installing cPanel on Ubuntu 22.04 and DeployHQ

Open Source, PHP, Tips & Tricks, and Tutorials

Installing cPanel on Ubuntu 22.04 and DeployHQ

If you've searched for install cPanel on Ubuntu, you're not alone — it's one of the most common server management queries out there. But there's a critical detail that most guides gloss over: cPanel does not officially support Ubuntu. It never has. cPanel only runs on RHEL-based distributions like AlmaLinux, Rocky Linux, and CloudLinux.

That doesn't mean you're stuck. This guide covers two practical paths forward: installing cPanel on a supported operating system (AlmaLinux), and — if you're committed to Ubuntu — setting up a free, modern control panel that gives you similar functionality without switching distros.

Before You Begin: Understanding cPanel's OS Requirements

cPanel's installer will refuse to run on Ubuntu, Debian, or any non-RHEL distribution. This isn't a workaround situation — it's a hard requirement baked into the installer script. As of 2026, cPanel officially supports:

  • AlmaLinux 8 and 9 (recommended)
  • Rocky Linux 8 and 9
  • CloudLinux 8 and 9

CentOS 7 reached end-of-life in June 2024, and CentOS Stream is not supported. If you're provisioning a new server specifically for cPanel, AlmaLinux 9 is the recommended choice — it's free, community-driven, and has the strongest cPanel compatibility track record.

So why do so many people search for cPanel Ubuntu? Because Ubuntu dominates the VPS market. It's the default OS on most cloud providers, and many developers have only ever worked with Debian-based systems. The search intent is really: I want a web hosting control panel on my Ubuntu server. This guide addresses both interpretations.

Path A: Installing cPanel on AlmaLinux

If you specifically need cPanel — perhaps you're running a web hosting business, or you need WHM for client account management — you'll need to provision a server with AlmaLinux. Most cloud providers (DigitalOcean, Vultr, Linode, Hetzner) offer AlmaLinux as an OS option during server creation.

Server Requirements

cPanel has specific minimum requirements that you should meet before starting:

Resource Minimum Recommended
RAM 2 GB 4 GB or more
Disk Space 20 GB 40 GB or more
OS AlmaLinux 8 or 9 AlmaLinux 9
Architecture x86_64 x86_64
Network Static IP Static IP with rDNS configured
Perl Installed Installed

Your server must be a fresh installation — cPanel's installer expects a clean OS with no pre-existing web servers, mail servers, or control panels. If you're repurposing an existing server, start with a fresh OS reinstall.

Step 1: Prepare the Server

Connect to your server via SSH and update the system packages:

ssh root@your-server-ip
dnf update -y

Set a fully qualified domain name (FQDN) for your server. cPanel uses this hostname for its own services, so it should be a subdomain you control — not your main website domain:

hostnamectl set-hostname server.yourdomain.com

Verify the hostname is set correctly:

hostname -f
# Expected output: server.yourdomain.com

Make sure Perl is installed, as the cPanel installer requires it:

dnf install -y perl curl

Step 2: Configure the Firewall

cPanel installs its own firewall management tool (CSF/LFD — ConfigServer Security & Firewall), which replaces the default firewalld. During installation, you may need to temporarily allow the installer to run without interference. However, do not disable the firewall entirely and walk away — the goal is to transition from firewalld to cPanel's CSF.

Before installing, ensure at minimum that ports 22 (SSH), 2086/2087 (WHM), and 2082/2083 (cPanel) are accessible. After cPanel installs CSF, it will manage all firewall rules going forward, including protection against brute-force attacks via LFD (Login Failure Daemon).

If you're on AlmaLinux with firewalld active, the cPanel installer will handle the transition. You don't need to manually disable it — the installer will prompt you or manage it automatically.

Step 3: Run the cPanel Installer

Download and run the official cPanel installation script:

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

This process takes 30 to 60 minutes depending on your server's performance. The installer downloads and compiles a significant number of packages. You'll see continuous output as it progresses through stages — don't interrupt it.

When the installation completes, you'll see a summary with the WHM access URL:

2026-02-20 14:32:15  847 (       INFO): Thank you for installing cPanel & WHM!
2026-02-20 14:32:15  847 (       INFO): Visit https://your-server-ip:2087 to configure your server.

Step 4: Initial WHM Configuration

Open your browser and navigate to:

https://your-server-ip:2087

You'll see a certificate warning — this is expected since cPanel generates a self-signed certificate during installation. Proceed past the warning and log in with your root credentials.

The WHM Setup Wizard walks you through:

  1. Agreement acceptance — cPanel's license terms
  2. Contact information — for system alerts and notifications
  3. Networking — DNS resolver configuration (Cloudflare's 1.1.1.1 or Google's 8.8.8.8 are reliable choices)
  4. Hostname and IP — confirm the FQDN and primary IP address
  5. Nameservers — configure if you're hosting DNS for client domains
  6. Services — select which services to enable (FTP, mail, etc.)

After completing the wizard, you should immediately install an SSL certificate for WHM/cPanel access using the built-in AutoSSL feature (available in WHM under Manage AutoSSL).

Step 5: Verify and Secure the Installation

Once WHM is configured, verify that key services are running:

/scripts/restartsrv_httpd
/scripts/restartsrv_mysql
whmapi1 version

Install and configure CSF (ConfigServer Security & Firewall) if it wasn't set up automatically:

# CSF is typically installed by cPanel, but verify:
csf -v

CSF replaces firewalld with a more hosting-oriented firewall that includes:

  • LFD (Login Failure Daemon): Monitors logs for brute-force attempts and automatically blocks offending IPs
  • Connection tracking: Limits concurrent connections per IP
  • Port flood protection: Mitigates SYN flood attacks
  • Country-based blocking: Block or allow traffic by country code

This is why the earlier step of disabling firewalld isn't leaving you exposed — CSF/LFD provides more comprehensive protection tailored to hosting environments.

Path B: Ubuntu-Compatible Control Panels

If you're running Ubuntu and don't specifically need cPanel's ecosystem (WHM reseller accounts, cPanel-specific plugins), there are modern control panels that run natively on Ubuntu and provide similar functionality — for free.

CloudPanel is a free, high-performance server control panel built specifically for Debian and Ubuntu. It's lightweight, modern, and handles the most common hosting tasks that cPanel covers.

What you get:

  • Web-based management interface
  • PHP, Node.js, Python, and static site support
  • MySQL/MariaDB database management
  • Let's Encrypt SSL automation
  • File manager, cron job management, and log viewer
  • Vhost management with Nginx
  • Free, with no licensing fees

Installation on Ubuntu 22.04 or 24.04:

# Update your system
apt update && apt upgrade -y

# Install CloudPanel
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh
sudo bash install.sh

The installation takes approximately 5 to 10 minutes. Once complete, access the panel at https://your-server-ip:8443 and create your admin account.

CloudPanel is an excellent choice if you need a cPanel-like experience on Ubuntu without paying licensing fees.

HestiaCP

HestiaCP is a free, open-source control panel forked from VestaCP (which is no longer maintained). It supports Ubuntu 20.04, 22.04, and 24.04.

What you get:

  • Full web hosting management (Apache/Nginx)
  • Mail server with antivirus and antispam
  • DNS server management
  • Database management (MySQL/PostgreSQL)
  • Let's Encrypt integration
  • Multi-user support with hosting packages
  • Backup and restore functionality

Installation on Ubuntu 22.04 or 24.04:

# Download the installer
wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh

# Run with your preferences
sudo bash hst-install.sh --hostname server.yourdomain.com --email admin@yourdomain.com

HestiaCP is the closest free alternative to cPanel in terms of feature set, especially if you need mail server management and multi-user hosting packages.

Control Panel Comparison

Feature cPanel CloudPanel HestiaCP Plesk Webmin
Ubuntu Support No Yes Yes Yes Yes
AlmaLinux Support Yes No Yes Yes Yes
License Cost $15.99/mo+ Free Free $14.50/mo+ Free
Web Hosting Yes Yes Yes Yes Limited
Mail Server Yes No Yes Yes Via config
DNS Management Yes Yes Yes Yes Via config
Database GUI phpMyAdmin Built-in phpMyAdmin Built-in Via module
SSL Automation AutoSSL Let's Encrypt Let's Encrypt Let's Encrypt Manual
Multi-User WHM No Yes Yes Usermin
File Manager Yes Yes Yes Yes Yes
Reseller Support Yes No Yes (basic) Yes No
Learning Curve Medium Low Low-Medium Medium High

Bottom line: If you need reseller hosting with client isolation, cPanel on AlmaLinux or HestiaCP on Ubuntu are your best options. For single-site or developer-focused hosting, CloudPanel on Ubuntu offers the cleanest experience.

Deploying to a cPanel Server with DeployHQ

Whether you've set up cPanel on AlmaLinux or chosen a Ubuntu-based panel, you'll want an automated deployment workflow. DeployHQ connects to your server and deploys code from your Git repository whenever you push changes — no manual FTP uploads required.

Setting Up SSH/SFTP Deployment

cPanel servers support SSH connections, which is the recommended protocol for DeployHQ deployments. Here's how to configure it:

  1. Generate an SSH key in DeployHQ (or upload your own) when adding a new server
  2. Add the public key to your cPanel account under SSH Access in the cPanel dashboard
  3. Configure the server in DeployHQ with these settings:
Setting Value
Protocol SSH/SFTP
Hostname your-server-ip or domain
Port 22
Username your cPanel username
Deployment Path /home/username/public_html

For addon domains or subdomains, adjust the deployment path accordingly — for example, /home/username/subdomain.com or /home/username/public_html/subdirectory.

Configuring Build Pipelines

If your project requires a build step (compiling assets, installing dependencies, running bundlers), you can configure build pipelines in DeployHQ to run these commands before files are transferred to your server.

For example, a typical Node.js or frontend project might use:

npm ci
npm run build

DeployHQ runs these commands in a clean build environment, then deploys only the compiled output to your server. This means you don't need Node.js installed on your cPanel server — the build happens on DeployHQ's infrastructure.

Post-Deployment Commands

You can configure commands to run on your server after each deployment. Common examples for cPanel-hosted sites:

# Clear PHP opcache
php -r "opcache_reset();"

# Run database migrations (Laravel example)
php artisan migrate --force

# Clear application cache
php artisan cache:clear

Zero-Downtime Deployments

For production sites where you can't afford any downtime during deploys, DeployHQ supports zero-downtime deployments. This uses a symlink-based strategy: each deployment goes to a new release directory, and once everything is ready, the live symlink is swapped atomically. If something goes wrong, you can roll back to the previous release instantly.

cPanel Licensing and Cost Breakdown (2026)

cPanel moved to a monthly licensing model in 2019, and prices have increased several times since. Here's what you should budget:

Plan Monthly Cost Accounts Included Additional Accounts
Solo $15.99/mo 1 account Not available
Admin $27.99/mo Up to 5 accounts Not available
Pro $41.99/mo Up to 30 accounts Not available
Premier $55.99/mo Up to 100 accounts $0.30/account/mo

These prices are from cPanel directly. Some hosting providers and license resellers offer discounts (typically 20-40% off). On top of the cPanel license, factor in your server costs:

Provider Minimum VPS for cPanel Monthly Cost Total with cPanel Solo
DigitalOcean 4 GB RAM droplet $24/mo ~$40/mo
Vultr 4 GB RAM instance $24/mo ~$40/mo
Hetzner CPX21 (4 GB RAM) ~$7/mo ~$23/mo
OVHcloud VPS Starter ~$12/mo ~$28/mo

Compared to free alternatives: CloudPanel or HestiaCP on a $5-12/month Ubuntu VPS gives you most of the same functionality at a fraction of the cost. The main reasons to pay for cPanel are WHM reseller support, broad plugin ecosystem, and familiarity if you're migrating from a shared hosting environment.

Troubleshooting Common Issues

Installation Fails with Unsupported Operating System

This means you're running an OS that cPanel doesn't support — most likely Ubuntu or Debian. cPanel requires AlmaLinux, Rocky Linux, or CloudLinux. You'll need to either reprovision your server with a supported OS or use a Ubuntu-compatible panel like CloudPanel or HestiaCP.

License is Not Active After Installation

cPanel checks its license server during installation. Common causes:

  • Your server IP hasn't been registered with a cPanel license yet. Purchase or activate a trial at store.cpanel.net.
  • Your server's IP address changed since the license was issued. Update the license IP through your cPanel Store account.
  • A firewall is blocking outbound connections to cPanel's license verification servers (verify.cpanel.net on port 2089).

WHM/cPanel Interface Not Loading

If you can't reach https://your-ip:2087 after installation:

# Check if cpsrvd (the cPanel web service) is running
/scripts/restartsrv_cpsrvd

# Verify the ports are open
ss -tlnp | grep -E '2086|2087|2082|2083'

# Check CSF firewall isn't blocking your IP
csf -g your-local-ip

If your IP was blocked by LFD due to failed login attempts, unblock it with:

csf -dr your-local-ip
csf -a your-local-ip  # whitelist your IP

High Memory Usage After Installation

cPanel runs many services simultaneously (Apache, MySQL, Exim, cPHulk, etc.). On a 2 GB RAM server, you'll often see high memory usage immediately after installation. Solutions:

  • Upgrade to at least 4 GB RAM (recommended)
  • Disable services you don't need (Exim mail server if you use external email, SpamAssassin, ClamAV)
  • Switch from Apache to LiteSpeed or Nginx (via WHM plugin)

MySQL/MariaDB Won't Start

This is often a memory issue on low-RAM servers. Check the MySQL error log:

tail -50 /var/log/mysqld.log

If you see InnoDB: Cannot allocate memory, reduce the InnoDB buffer pool size in /etc/my.cnf:

[mysqld]
innodb_buffer_pool_size = 128M

Then restart MySQL:

/scripts/restartsrv_mysql

Frequently Asked Questions

Can I install cPanel on Ubuntu?

No. cPanel officially supports only RHEL-based distributions: AlmaLinux, Rocky Linux, and CloudLinux. The installer will not run on Ubuntu. If you want a control panel on Ubuntu, consider CloudPanel or HestiaCP as free alternatives.

Is there a free version of cPanel?

cPanel offers a 15-day free trial, but there is no permanent free tier. After the trial, you'll need to purchase a license starting at $15.99/month. If cost is a concern, CloudPanel and HestiaCP provide free alternatives with similar core functionality.

What happened to VestaCP?

VestaCP was a popular free control panel, but development was abandoned after security vulnerabilities were discovered in 2018. The project was forked as HestiaCP, which is actively maintained, regularly updated, and is the recommended successor.

Can I migrate from cPanel to a free control panel?

Yes, but there's no one-click migration tool. You'll need to manually migrate your websites, databases, email accounts, and DNS records. For straightforward PHP/MySQL sites, this is typically a few hours of work per site. For complex setups with many email accounts or custom configurations, plan for a longer migration window.

Do I need a control panel at all?

Not necessarily. Many developers manage servers directly via SSH, using tools like Nginx, Certbot, and systemd without a graphical panel. A control panel is most useful when you need to manage multiple sites, provide client access, or prefer a GUI for routine tasks like creating databases and email accounts.

How do I deploy code to my cPanel server automatically?

Use a deployment automation tool like DeployHQ. Connect your Git repository, configure your cPanel server as a deployment target via SSH/SFTP, and DeployHQ will automatically deploy your code whenever you push to your chosen branch. This eliminates manual FTP uploads and reduces the risk of deployment errors.


Need to automate deployments to your hosting server? Sign up for DeployHQ free and connect your Git repository to your server in minutes — whether you're running cPanel, CloudPanel, or managing your server manually.

Written by

Facundo F

Facundo | CTO | DeployHQ | Continuous Delivery & Software Engineering Leadership - As CTO at DeployHQ, Facundo leads the software engineering team, driving innovation in continuous delivery. Outside of work, he enjoys cycling and nature, accompanied by Bono 🐶.