📋 Step-by-Step Tutorial

How to Install cPanel & WHM
on a Dedicated Server

A complete, verified guide to deploying cPanel & WHM on AlmaLinux 9 or Ubuntu 22.04/24.04 LTS — covering prerequisites, installer, WHM configuration, nameservers, security hardening, and your first cPanel account.

● AlmaLinux 8 & 9 ● Ubuntu 22.04 / 24.04 LTS ● cPanel v114+ ● ~30–60 min install time ● Updated April 2026

cPanel & WHM (Web Host Manager) is the industry-standard hosting control panel used by web hosts and system administrators worldwide. WHM is the server-level admin interface — you use it to create hosting accounts, manage services, and configure the server. cPanel is what each website owner logs into to manage their domain, email, databases, and files.

This guide covers the real, verified steps using the official cPanel installer script. No guesswork, no outdated CentOS-era instructions. We cover both AlmaLinux (the recommended OS) and Ubuntu LTS (now officially supported).

âš ī¸

Fresh server only. Never install cPanel on a server that already has Apache, Nginx, MySQL, or any other web stack running. cPanel deploys and manages its own versions of these services. Installing on an existing stack causes conflicts that are nearly impossible to untangle.

1 Choosing Your Operating System

cPanel no longer supports CentOS (which reached end-of-life in June 2024). You now have two solid options: AlmaLinux (the recommended path) or Ubuntu LTS (officially supported since cPanel v102).
AlmaLinux 8
Ubuntu 24.04 LTS
Ubuntu 22.04 LTS

AlmaLinux 9 is the top recommendation for new cPanel deployments. It is free, binary-compatible with RHEL 9, community-maintained, and supported until 2032. cPanel v114 and later support AlmaLinux 9 in full production status. AlmaLinux 8 is supported through 2029.

Ubuntu LTS is fully supported — not experimental. cPanel supports Ubuntu 22.04 LTS and Ubuntu 24.04 LTS. Ubuntu 24.04 LTS is recommended for new installs, as cPanel v136 has deprecated Ubuntu 22.04 upgrade paths. If you are already on Ubuntu as a platform and prefer Debian-based tooling, Ubuntu 24.04 is a valid production choice.

â„šī¸

CentOS Stream is not supported. cPanel explicitly does not support CentOS Stream. Do not attempt to install cPanel on a CentOS Stream server.

2 System Requirements

These are the minimum requirements from cPanel's official documentation. Meeting only the minimums may cause performance issues under load — the recommended specs below are what you should actually target for a production server.
CPU
1.1 GHz, 64-bit
Recommended: Multi-core
RAM
1 GB minimum
2 GB recommended; 3 GB+ with ClamAV
Disk Space
20 GB minimum
40 GB+ recommended for production
Architecture
x86_64 only
ARM is not supported
Network
Static IPv4 required
IPv6-only servers unsupported
Hostname
Valid FQDN
Max 60 chars, resolves to your IP
License
Required (paid)
15-day free trial available at install
Installer Disk
+5 GB free
For /usr/local/cpanel directory
đŸšĢ

Important: Once cPanel is installed, it cannot be uninstalled cleanly. If you ever need to remove it, you must reinstall the operating system from scratch. Test on a disposable VPS or snapshot first if you are evaluating it.

3 Pre-Installation Setup

These steps must be completed before running the cPanel installer. Skipping any of them is the most common cause of a failed installation.

Step 3.1 — SSH in as root

You must be logged in as the root user. cPanel requires root-level access throughout the installation and ongoing operation.

bash

# Connect to your server as root
ssh root@YOUR_SERVER_IP

# Or if you logged in as a sudo user, switch to root
sudo -i
                                    

Step 3.2 — Update the system

Bring all packages up to date before installation. This prevents conflicts with outdated package versions and ensures you have the latest security patches applied to the base OS.

bash — AlmaLinux 8 / 9

dnf update -y && dnf upgrade -y
reboot
                                    
bash — Ubuntu 22.04 / 24.04

apt update && apt upgrade -y
reboot
                                    

Step 3.3 — Install Perl and core dependencies

cPanel is written in Perl, so Perl must be present on the system before the installer runs. The installer script will fail immediately without it.

bash — AlmaLinux

dnf install -y perl curl wget tar screen
                                    
bash — Ubuntu

apt install -y perl curl wget tar screen
                                    

Step 3.4 — Set a fully qualified hostname (FQDN)

cPanel requires a valid FQDN as the server hostname — something like server1.yourdomain.com. It must not match any of your hosted domain names, must be registered and resolvable, and must be 60 characters or fewer. This hostname should have a DNS A record pointing to your server's static IP address before you install.

bash

# Set your FQDN — replace with your actual hostname
hostnamectl set-hostname server1.yourdomain.com

# Add it to /etc/hosts as well
echo "YOUR.SERVER.IP  server1.yourdomain.com  server1" >> /etc/hosts

# Confirm it's set correctly
hostname -f
                                    

Step 3.5 — Disable SELinux (AlmaLinux only)

cPanel does not support SELinux. It must be disabled before installation. On AlmaLinux, if SELinux is enforcing, the cPanel installer will fail or produce unexpected errors.

bash — AlmaLinux

# Disable SELinux immediately (no reboot needed for this)
setenforce 0

# Make it permanent across reboots
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

# Verify
getenforce
# Should output: Disabled
                                    

Step 3.6 — Disable the firewall temporarily

Disable any active OS firewall before running the installer. The cPanel installer sets up its own firewall rules (via CSF/LFD) during installation. An active firewall can interfere with the installer's network calls and service binding. You'll re-enable protection via cPanel's built-in tools afterward.

bash — AlmaLinux (firewalld)

# Save current rules, then disable firewalld for the install
iptables-save > ~/firewall.rules
systemctl stop firewalld
systemctl disable firewalld
                                    
bash — Ubuntu (ufw)

iptables-save > ~/firewall.rules
systemctl stop ufw
systemctl disable ufw

# Ubuntu also requires disabling NetworkManager before installing
systemctl stop NetworkManager
systemctl disable NetworkManager
                                    

4 Running the cPanel Installer

The official cPanel installer is a single-command script that downloads and installs all cPanel components. Installation takes between 10 and 50 minutes depending on your server's hardware and network speed.

Use screen or tmux to run the installer inside a persistent terminal session. If your SSH connection drops mid-install, the installation will continue in the background and you can reattach to monitor it.

bash

# Start a screen session so the install survives SSH disconnects
screen -S cpanel-install

# Move to /home, download the official installer, and run it
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
                                    
â„šī¸

If you disconnect from SSH: Reattach to your screen session with screen -r cpanel-install. The install log is always available at /var/log/cpanel-install.log — you can tail it with tail -f /var/log/cpanel-install.log.

The installer will display progress messages in real time. A successful install ends with output similar to:

output

( INFO): Thank you for installing cPanel & WHM!
( INFO): Visit https://your-server-ip:2087 to configure your server.
                                    

Optional: Skip CloudLinux auto-conversion

If your server's IP address has an active CloudLinux license, cPanel will automatically convert your AlmaLinux install to CloudLinux. If you want to keep AlmaLinux, add the skip flag:

bash

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

5 Initial WHM Configuration

After installation completes, open WHM in your browser to run through the Initial Setup Wizard. This configures the critical server-wide settings for your hosting environment.

Step 5.1 — Access WHM

Open your browser and navigate to WHM using any of these URLs (replace YOUR_SERVER_IP with your actual IP or FQDN):

URL options

https://YOUR_SERVER_IP:2087
https://YOUR_SERVER_IP/whm
https://server1.yourdomain.com:2087
https://server1.yourdomain.com/whm
                                    
âš ī¸

You will see a browser SSL certificate warning on first access. This is expected — cPanel generates a self-signed certificate during install. Click "Advanced" → "Proceed" to continue. You will install a proper SSL certificate in the next step.

Log in with the username root and your server's root password.

Step 5.2 — Activate your license

On first login, you will see a trial license banner. Click "Purchase a License" or "Continue with Trial" for the 15-day free trial. cPanel licenses are tied to your server's IP address and are managed through the cPanel Store. If you already purchased a license, it activates automatically when the installer detects your IP.

Step 5.3 — Run the Setup Wizard

The Setup Wizard walks through the following configuration screens:

  • â–ļ Networking: Confirm your server's hostname and primary IP. Set your DNS resolver — use a reliable resolver such as Cloudflare's 1.1.1.1 or Google's 8.8.8.8.
  • â–ļ Nameservers: Configure your nameserver entries (see Section 5.4 below).
  • â–ļ Services: Enable or disable FTP, mail, and other services based on your hosting needs.
  • â–ļ Update Preferences: Set the cPanel update tier. The Stable tier is recommended for production — it receives tested updates rather than bleeding-edge releases.

Step 5.4 — Configure nameservers

If you plan to host DNS for your clients' domains, you need at least two nameservers. You can use your own nameservers (which requires creating DNS A records for them at your domain registrar) or use an external DNS provider. A typical self-hosted setup looks like this:

WHM → Basic WebHost Manager Setup → Nameservers

Nameserver 1:  ns1.yourdomain.com  →  YOUR.SERVER.IP
Nameserver 2:  ns2.yourdomain.com  →  YOUR.SERVER.IP
                                    

At your domain registrar, add A records pointing ns1.yourdomain.com and ns2.yourdomain.com to your server's IP. Some registrars require you to register "glue records" for nameservers within the same domain.

Step 5.5 — Install AutoSSL (Let's Encrypt)

After completing the wizard, immediately configure AutoSSL so WHM, cPanel, webmail, and all hosted domains get valid SSL certificates automatically.

Go to WHM → SSL/TLS → Manage AutoSSL and select Let's Encrypt as the provider. Click "Save" and then run AutoSSL for all users. This replaces the self-signed certificate on WHM/cPanel access URLs with a trusted certificate.

6 Security Hardening

A freshly installed cPanel server is not fully hardened by default. These steps close the most critical attack vectors before you go live.

Required open ports

cPanel uses a wide range of ports. Ensure these are accessible through your cloud provider's network firewall (not the OS firewall — cPanel's CSF manages the OS firewall):

Port(s)ServiceRequired?
22SSHRequired
21FTPRequired for FTP
80 / 443HTTP / HTTPSRequired
2082 / 2083cPanel (HTTP / HTTPS)Required
2086 / 2087WHM (HTTP / HTTPS)Required
2095 / 2096Webmail (HTTP / HTTPS)Required for email
25 / 465 / 587SMTP / SubmissionRequired for mail
110 / 995POP3 / POP3SFor email clients
143 / 993IMAP / IMAPSFor email clients
53 TCP/UDPDNSRequired for nameservers
30000–35000Passive FTPRequired for FTP

Enable cPHulk brute-force protection

cPHulk is WHM's built-in brute-force protection system. Navigate to WHM → Security Center → cPHulk Brute Force Protection and enable it. It monitors failed login attempts and automatically blocks attacking IPs.

Disable unused services

Every running service is an attack surface. If you don't need FTP or certain mail protocols, disable them in WHM → Service Manager. Disabling services you don't use reduces both attack surface and server resource usage.

Configure automatic updates

In WHM → Update Preferences, ensure automatic updates are enabled on the Stable tier. You can also run manual updates at any time with:

bash

# Manually update cPanel to the latest version
/usr/local/cpanel/scripts/upcp

# Also keep the OS updated
dnf update -y      # AlmaLinux
apt upgrade -y   # Ubuntu

# Check current cPanel version
/usr/local/cpanel/cpanel -V
                                    

7 Create Your First cPanel Account

With WHM configured and secured, you're ready to create your first hosting account. Each cPanel account corresponds to one primary domain and gets its own file space, email, and databases.

Step 7.1 — Create a hosting package (optional but recommended)

Packages define resource limits for accounts — disk space, bandwidth, email account limits, database limits, etc. Creating a package first makes it easier to apply consistent limits across multiple accounts. Go to WHM → Add a Package and define your resources.

Step 7.2 — Create the cPanel account

Navigate to WHM → Create a New Account and fill in:

  • â–ļ Domain: The primary domain for this account (e.g., myclientsite.com)
  • â–ļ Username: A username (max 16 chars, alphanumeric, lowercase)
  • â–ļ Password: A strong password for the cPanel login
  • â–ļ Email: The account owner's contact email address
  • â–ļ Package: Select the package you created, or set custom resource limits

Click "Create". WHM will provision the account, create the home directory, set up DNS zone files, and configure the web server virtual host — all automatically.

Step 7.3 — Access cPanel for the new account

You can access cPanel for any account you created in two ways:

URL options

# Via browser URL
https://YOUR_SERVER_IP/cpanel
https://YOUR_SERVER_IP:2083

# Or via WHM (no password needed) → List Accounts → cPanel icon
                                    

Step 7.4 — Set up a website

Once inside cPanel, a typical website deployment looks like this:

  • ✓ Upload files via File Manager or FTP to /home/username/public_html/
  • ✓ Create a MySQL database via MySQL Databases (for WordPress, etc.)
  • ✓ Use Softaculous (in cPanel) to auto-install WordPress, Joomla, or 400+ other apps in one click
  • ✓ Create email accounts under Email Accounts
  • ✓ SSL will be applied automatically by AutoSSL — check SSL/TLS Status to verify

8 Ubuntu-Specific Notes

Ubuntu support in cPanel is officially production-ready as of 2026. However, there are a few Ubuntu-specific differences you should know about before and after installing.
✅

Ubuntu is no longer experimental. cPanel officially supports Ubuntu 22.04 LTS and 24.04 LTS. Ubuntu 24.04 LTS is the recommended version for new installs as of cPanel v136+, because cPanel has deprecated upgrade paths on Ubuntu 22.04.

Key differences from AlmaLinux on Ubuntu:

  • â–ļ No SELinux to disable — Ubuntu uses AppArmor instead, and cPanel handles AppArmor compatibility automatically.
  • â–ļ NetworkManager must be disabled before installation and re-enabled after (Ubuntu only).
  • â–ļ UFW (uncomplicated firewall) should be disabled before the install — use the commands in Section 3.6 above.
  • â–ļ Package manager differences — cPanel on Ubuntu uses apt for OS-level packages. The cPanel installer script detects the OS and uses the correct package manager automatically.
  • â–ļ Ubuntu 22.04 upgrade block — You cannot upgrade to cPanel v136 on Ubuntu 22.04. Plan a migration to Ubuntu 24.04 if you are on 22.04 and want future cPanel version support.

The cPanel installer command is identical on Ubuntu — the same curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest command shown in Section 4 works on Ubuntu as well. The script detects your OS and adapts automatically.

9 Common Issues & Fixes

WHM shows "License Not Found" after installation â–ŧ
cPanel licenses are IP-based. If the installer didn't pick up your license automatically, run this command as root to force a license update: /usr/local/cpanel/cpkeyclt. If you're starting a trial, click "Purchase a License" inside WHM and create a cPanel Store account. Your trial starts immediately.
Installation fails or stalls with a network error â–ŧ
Check that securedownloads.cpanel.net is reachable from your server (curl -I https://securedownloads.cpanel.net). Also confirm your server has working DNS resolution (nslookup google.com). Some cloud providers block outbound connections by default — check your cloud firewall/security group rules. Review /var/log/cpanel-install.log for the specific error line.
WHM or cPanel port 2087 / 2083 is not accessible â–ŧ
First check your cloud provider's external network firewall / security groups — these are separate from the OS-level firewall and often block non-standard ports by default. Add inbound rules for ports 2082, 2083, 2086, and 2087. Then verify cPanel's internal services are running with whmapi1 servicestatus service=cpsrvd.
AutoSSL fails to issue certificates â–ŧ
AutoSSL (Let's Encrypt) validates domain ownership by making an HTTP request to your domain on port 80. Confirm that: (1) your domain's DNS A record points to your server's IP, (2) port 80 is open in your cloud firewall, and (3) there is no redirect loop. Run AutoSSL again after fixing DNS: WHM → Manage AutoSSL → Run AutoSSL for All Users.
AlmaLinux installer: "NetworkManager" conflicts â–ŧ
On AlmaLinux 8, the cPanel installer automatically disables NetworkManager and enables network.service. On AlmaLinux 9, NetworkManager stays enabled — you don't need to touch it. If you encounter networking issues after installation on AlmaLinux 8, re-enable NetworkManager with: systemctl start NetworkManager && chkconfig NetworkManager on.
Can I install cPanel on a server with existing websites? â–ŧ
No — cPanel installs its own Apache, PHP, MySQL, and mail server. It will conflict with any existing installations of these services. Always install cPanel on a fresh OS. If you have existing sites, back them up, provision a new server, install cPanel, then migrate the sites using WHM's Transfer Tool.

10 Quick Reference: Key Paths & Commands

cPanel key file locations

# cPanel installation directory
/usr/local/cpanel/

# Per-account home directories
/home/USERNAME/

# Website files (public web root)
/home/USERNAME/public_html/

# Apache configuration (managed by cPanel)
/usr/local/apache2/conf/

# PHP configuration (EasyApache managed)
/usr/local/lib/php.ini

# Mail logs
/var/log/exim_mainlog

# cPanel install log
/var/log/cpanel-install.log

# cPanel error log
/usr/local/cpanel/logs/error_log
                                    
Essential post-install commands

# Check cPanel version
/usr/local/cpanel/cpanel -V

# Update cPanel manually
/usr/local/cpanel/scripts/upcp

# Restart all cPanel services
/scripts/restartsrv_apache
/scripts/restartsrv_mysql
/scripts/restartsrv_exim

# Force license re-check
/usr/local/cpanel/cpkeyclt

# Rebuild Apache configuration
/scripts/rebuildhttpdconf && service httpd restart
                                    

🗨 Frequently Asked Questions

What is the difference between WHM and cPanel? â–ŧ
WHM (Web Host Manager) is the server administrator interface. You use it to manage the server, create hosting accounts, configure services, and set resource limits. cPanel is the per-account interface used by website owners to manage their domain, email, files, and databases. Both are installed together in a single process — they are two portals of the same software.
Does cPanel work on VPS or cloud servers? â–ŧ
Yes. cPanel works on dedicated servers, VPS instances, and cloud servers (AWS EC2, DigitalOcean, Vultr, Hetzner, etc.) as long as you run a supported OS and meet the minimum hardware requirements. For cloud servers, make sure your provider's security groups or network firewall have the required cPanel ports open in addition to the OS-level firewall configuration.
How much does a cPanel license cost? â–ŧ
cPanel is commercial software — a paid license is required. A 15-day free trial is available during the initial setup wizard. Paid license pricing is account-based, starting at around $15–$20/month for up to 5 accounts. Pricing scales with the number of cPanel accounts you host. Check the official cPanel Store for current pricing, as it has changed several times over recent years.
Can I uninstall cPanel from a server? â–ŧ
No — there is no cPanel uninstaller. cPanel deeply integrates with the OS (Apache, PHP, MySQL, Exim, DNS, user accounts). If you need to remove cPanel, you must wipe the server and reinstall the operating system from scratch. Plan carefully before installing on any server you want to repurpose.

Discover fitservers Dedicated Server Locations

fitservers servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.