Panellicense

How to install cPanel on your VPS

A complete walkthrough for installing cPanel & WHM on a fresh VPS — minimum requirements, the install script, post-install hardening, and your first WHM login.

6 min readUpdated 2026-05-15install · cpanel · vps · almalinux
schema: HowToschema: FAQPageschema: BreadcrumbList

cPanel & WHM is the most widely deployed control panel for Linux hosting. This guide walks through every step needed to take a freshly provisioned VPS from empty to a logged-in WHM, ready to issue cPanel accounts to your customers.

The whole process takes about 30 minutes of clock time, most of which is the installer running unattended.

Before you start

You will need:

  • A VPS or dedicated server with at least 2 vCPU and 4 GB RAM (cPanel's published minimum is 1 GB, but anything below 4 GB will swap heavily under real load).
  • One of the supported operating systems, freshly installed with no other software:
    • AlmaLinux 8 or 9
    • Rocky Linux 8 or 9
    • CloudLinux 7, 8, or 9
    • Ubuntu 20.04 or 22.04 LTS
  • Root SSH access to the server (root user with a working SSH key or password).
  • A valid cPanel license bound to the server's primary public IP. If you don't have one, you can activate a license here and the key will be issued in under 60 seconds.
  • A fully-qualified hostname like server1.example.com resolving to the server's public IP. cPanel refuses to install on a hostname that doesn't resolve.

Step 1 — Set the hostname

cPanel uses the hostname for license validation, certificate provisioning, and outbound mail. SSH into the server as root and set it:

hostnamectl set-hostname server1.example.com
echo "203.0.113.10 server1.example.com server1" >> /etc/hosts

Verify it resolves both ways:

hostname -f          # should print server1.example.com
ping -c1 server1     # should resolve to your public IP

Step 2 — Update the system and reboot

A current kernel and current glibc will save you debugging time later.

# AlmaLinux / Rocky / CloudLinux
dnf update -y && reboot

# Ubuntu
apt update && apt full-upgrade -y && reboot

Wait for the server to come back up, then reconnect over SSH.

Step 3 — Run the cPanel installer

cPanel ships a single install script that handles everything: dependencies, services, MySQL, Exim, Dovecot, the WHM web interface, and the licensing client.

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

The installer will run for 15–25 minutes. It prints progress to the terminal and writes a detailed log to /var/log/cpanel-install.log. You can safely follow that log in another SSH session:

tail -f /var/log/cpanel-install.log

When it finishes you will see:

Thank you for installing cPanel & WHM 11.122!
You can now navigate to https://server1.example.com:2087 and log in as root.

Step 4 — Activate the license

Once the installer reports success, run the license update tool to bind the license to the server's IP:

/usr/local/cpanel/cpkeyclt

You should see Update succeeded. If you see License File Invalid, the license is not yet issued to this IP — check your Panellicense dashboard and confirm the IP matches.

Step 5 — First WHM login

In your browser, go to:

https://server1.example.com:2087

Log in as root with the server's root password. The first time you log in, WHM will walk you through:

  1. Setup wizard — accept the agreement and set your contact email
  2. Nameservers — point your domain's nameservers at this server (e.g. ns1.example.com, ns2.example.com)
  3. Service offering — pick a default mail and DNS configuration (BIND is fine to start)
  4. Resolvers — accept the defaults (Google + Cloudflare)

After the wizard, you land on the WHM home screen.

Step 6 — Post-install hardening

cPanel ships a sane default, but there are five things every operator should do before issuing customer accounts:

1. Tweak Settings

WHM Home → Server Configuration → Tweak Settings. The defaults that catch people out:

  • Brute force protection (cPHulk): enable it under Security Center → cPHulk Brute Force Protection. Set the login interval to 5 minutes and lock duration to 30.
  • SSH port: keep the default 22 for now — changing it requires updating the firewall and cPHulk simultaneously.

2. Install ConfigServer Firewall (CSF)

CSF replaces the default firewall with something easier to manage and adds a log-analysing intrusion-detection layer:

cd /usr/src
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

Then edit /etc/csf/csf.conf and set TESTING = "0" once you've confirmed you can still SSH in.

3. Configure cPanel & WHM updates

WHM Home → Server Configuration → Update Preferences. Set:

  • cPanel & WHM UpdatesRelease tier (stable)
  • Operating System Package UpdatesAutomatic
  • Apache SpamAssassin Rules UpdatesAutomatic

4. Set the cPanel Nameserver IPs

If you plan to run authoritative DNS for your customers, set the nameserver IPs in WHM Home → Server Configuration → Basic WebHost Manager Setup.

5. Create your first reseller (don't use root)

WHM Home → Account Functions → Create a New Account then promote it to reseller via Resellers → Reseller Center. Use this reseller account for day-to-day operations and keep root for true administrator work only.

FAQ

How long does cPanel installation take?+
Plan for 30 minutes end-to-end on a 2-vCPU VPS. The installer itself runs for 15–25 minutes; the rest is OS update, reboot, and first-login wizard.
Is AlmaLinux 9 officially supported by cPanel?+
Yes. cPanel & WHM v110 and later support AlmaLinux 8 and 9, Rocky Linux 8 and 9, CloudLinux 7/8/9, and Ubuntu 20.04 and 22.04 LTS. CentOS 7 is end-of-life.
Do I need a license before installing?+
No — the installer runs without a license, but you cannot create cPanel accounts until a license is bound to the server's IP. Most people activate the license before running the installer so it can self-validate at the end.
Can I run cPanel inside a container?+
cPanel will run inside a KVM, VMware, or Hyper-V virtual machine, but it is not supported inside Docker, LXC, or OpenVZ. The kernel hooks Exim and MySQL rely on are not available in those.
What if the installer fails?+
Check `/var/log/cpanel-install.log` first — 9 times out of 10 the cause is a missing hostname resolution, a firewall blocking outbound port 2087, or a stale yum/dnf cache. After you fix the root cause, you can safely re-run `sh latest` and it will resume.

Next steps

Switch in an afternoon

Switch from your current reseller — free.

We migrate active cPanel, Plesk, LiteSpeed and CloudLinux licenses from any reseller. We prorate the first month so you never pay twice, and your customers see zero downtime during the swap.