Back to Article List

How to install cPanel on a VPS (AlmaLinux and Ubuntu)

How to install cPanel on a VPS (AlmaLinux and Ubuntu)

In my experience with newbies, installing cPanel on a VPS is one of those jobs that looks scary and turns out to be mostly waiting. The installer does the heavy lifting. Your part is picking the right operating system, preparing the server properly and not skipping the small checks that cause reinstalls later. I've set up more cPanel servers than I care to admit, so this guide includes the mistakes too.

One thing to know before you start: cPanel installs on a freshly-provisioned OS only. There's no uninstaller. If the install goes wrong or you change your mind, you rebuild the server. That's why the preparation section below matters more than the install command itself.

What you need before installing cPanel

cPanel & WHM currently supports four operating systems: AlmaLinux, Rocky Linux, CloudLinux and Ubuntu (LTS releases only, 24.04 being the current one). My advice is AlmaLinux 9 unless you have a specific reason to run Ubuntu. cPanel grew up on RHEL-family systems and the AlmaLinux builds still get the smoothest ride. Ubuntu support is solid these days but it arrived later, and some third-party cPanel plugins still assume an RPM-based system.

The official system requirements list 2 GB of RAM and 20 GB of disk as the minimum. Treat those numbers as theoretical. A cPanel server with 2 GB of RAM will install fine and then crawl the moment Apache, MySQL and a couple of PHP-FPM pools wake up together. Give it 4 GB and 40 GB or more of NVMe and you'll have a server you can host real sites on. A VPS plan with 4 vCPU and 8 GB is a comfortable starting point for a handful of production sites.

Beyond hardware, the installer is picky about four things:

  • A fresh OS. No preinstalled Apache, no MySQL, no leftover panel from a previous experiment. The installer checks for conflicting packages and will refuse or misbehave if it finds them.
  • A static public IP. cPanel licenses are tied to a publicly visible static IP with working DNS resolution. Dynamic and internal NAT addresses won't license.
  • A valid hostname. A fully qualified domain name like server1.example.com, max 60 characters, and it shouldn't match any domain you plan to host on the server.
  • Root access. The whole install runs as root, not sudo from a regular user.

Step 1: Prepare the server

Log in as root and update the system first. On AlmaLinux:

dnf update -y

On Ubuntu:

apt update && apt upgrade -y

Then set the hostname. This is the step people skip and regret, because a bad hostname causes licensing and mail headaches later:

hostnamectl set-hostname server1.example.com

Point an A record for that hostname at your server's IP while you're at it. It doesn't have to resolve before the install starts, but AutoSSL will want it later and your mail deliverability depends on it.

Last prep step: disable the OS firewall for the duration of the install. cPanel configures its own rules and a strict default firewall can strangle the installer halfway through. On AlmaLinux that's systemctl stop firewalld, on Ubuntu ufw disable. You'll put proper firewalling back at the end (I use CSF, more on that below).

Step 2: Run the cPanel installer

The entire installation is one line, documented in the cPanel installation guide:

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

It changes to /home, downloads the latest installer and runs it. Now go make coffee. On a decent NVMe VPS the install takes 30 to 60 minutes; on slow storage I've seen it take two hours. The script compiles nothing but it downloads and configures hundreds of packages, sets up EasyApache, MySQL or MariaDB, Exim, Dovecot and the cPanel services themselves.

Don't close the SSH session while it runs. If your connection is flaky, start it inside screen or tmux so a dropped connection doesn't orphan the installer.

Step 3: Log in to WHM and activate the trial license

When the installer finishes it prints a login URL in this shape:

https://SERVER_IP:2087

Open it, accept the self-signed certificate warning (normal at this stage) and log in as root with your root password. WHM greets you with the initial setup assistant: agree to the terms, confirm the contact email and nameservers, then activate the free 15-day trial license when prompted. Since version 90 the trial activation is built into this first-run flow, so there's no separate signup to chase. After 15 days you either buy a license or the panel locks. Licensing is per-account-tier these days rather than a flat unlimited fee, so check current pricing on cpanel.net rather than trusting any blog post's numbers, mine included.

Two settings worth fixing right away in WHM:

  • Nameservers (WHM » Basic WebHost Manager Setup): set ns1 and ns2 entries even if you'll use external DNS, because Exim reads them.
  • AutoSSL (WHM » SSL/TLS » Manage AutoSSL): switch the provider to Let's Encrypt and run it for the hostname so port 2087 stops showing certificate warnings.

Step 4: Create your first cPanel account

WHM is the admin layer; sites live in cPanel accounts. Go to WHM » Account Functions » Create a New Account, enter the domain, a username and a strong password, pick a package (the default is fine to start) and create it. Log in to that account at https://SERVER_IP:2083 and you've got the familiar cPanel interface with File Manager, MySQL Databases, Email Accounts and the rest. From here the usual first job is putting a site on it, and the cPanel WordPress setup guide picks up exactly where this step ends.

Step 5: Put a firewall back

Remember the firewall we disabled? Don't leave it that way. The standard choice on cPanel servers is CSF (ConfigServer Security & Firewall), which understands cPanel's port layout out of the box:

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

After installing, set TESTING = "0" in /etc/csf/csf.conf once you've confirmed you can still log in. CSF in testing mode flushes its rules every few minutes, which is exactly what you want while you confirm you can still get in.

Verify the install worked

Quick checklist. WHM loads on port 2087 and shows a green license status (trial counts). /scripts/upcp --force runs a cPanel update without errors. Your first cPanel account loads on port 2083 and can create an email address. If all four pass, the server's healthy.

Common problems and fixes

"Unable to verify license" after install. Almost always the IP. Check your server IP against https://verify.cpanel.net/, then confirm the machine isn't behind NAT. Trial licenses need the public IP the server reports.

Installer dies complaining about existing packages. The OS image wasn't clean. Some VPS providers ship images with Apache or a LAMP stack preinstalled. Rebuild from a minimal image and rerun.

Hostname warnings during first WHM login. You used something like "localhost" or a bare domain. Fix it with hostnamectl and WHM » Change Hostname, then restart cpsrvd.

Everything installed but pages time out. Check the firewall you forgot about. cPanel needs 2082, 2083, 2086, 2087, 80 and 443 open at minimum.

If you'd rather not babysit an installer at all, that's a fair position too. We ship cPanel as a preconfigured template on our cPanel VPS plans, so the panel comes up with the OS in one deploy and you skip everything above except creating accounts.

And if the per-account license pricing puts you off cPanel entirely, ispmanager is the alternative we keep recommending; there's a full ispmanager control panel guide on the blog that covers the same ground for that panel.

Give your websites a server of their own

Launch a virtual server as simple as shared hosting, with guaranteed resources and stronger security.
Betalingscyclus

Personal Web Hosting

$6.99 Save  14 %
$5.99 Maandelijks
  • Perfect voor persoonlijke websites, blogs en portfolio’s, en biedt je een snelle en betrouwbare manier om online te gaan zonder complexiteit.
  • 40 GB NVMe opslag
  • 2 GB RAM-geheugen
  • 2 vCPU AMD EPYC
  • IPv4 & IPv6 inbegrepen IPv6-ondersteuning is momenteel niet beschikbaar in Frankrijk of Nederland.
  • Onbeperkt 1 Gbps netwerk
  • Gratis automatische back-up
  • Firewall beheer
  • Gratis server monitoring
  • KVM isolatie

Business Web Hosting

$23.99 Save  21 %
$18.99 Maandelijks
  • Ideaal voor gevestigde websites en drukke teams, met de kracht om meerdere projecten en stabiele groei te ondersteunen.
  • 250 GB NVMe opslag
  • 8 GB RAM-geheugen
  • 4 vCPU AMD EPYC
  • IPv4 & IPv6 inbegrepen IPv6-ondersteuning is momenteel niet beschikbaar in Frankrijk of Nederland.
  • Onbeperkt 1 Gbps netwerk
  • Gratis automatische back-up
  • Firewall beheer
  • Gratis server monitoring
  • KVM isolatie

Agency Web Hosting

$44.99 Save  22 %
$34.99 Maandelijks
  • Ontworpen voor zeer veeleisende gebruikers, met de capaciteit om eenvoudig veel klanten en zware workloads te beheren.
  • 600 GB NVMe opslag
  • 16 GB RAM-geheugen
  • 4 vCPU AMD EPYC
  • IPv4 & IPv6 inbegrepen IPv6-ondersteuning is momenteel niet beschikbaar in Frankrijk of Nederland.
  • Onbeperkt 1 Gbps netwerk
  • Gratis automatische back-up
  • Firewall beheer
  • Gratis server monitoring
  • KVM isolatie

FAQ

Can I install cPanel on Debian or CentOS?

No. Debian was never supported and CentOS support ended with CentOS 7's retirement. Your current options are AlmaLinux, Rocky Linux, CloudLinux and Ubuntu LTS. If you're on an old CentOS server, migrate accounts to a fresh AlmaLinux box rather than trying to upgrade in place.

Your ideas deserve better hosting

Bring your winning ideas online faster, with modern hardware and unmetered bandwidth. Join a European cloud trusted by thousands of developers and businesses worldwide.

GPU products are in high demand at the moment. Fill the form to get notified as soon as your preferred GPU server is back in stock.