How to install cPanel & WHM on Ubuntu 24.04 LTS
Install cPanel & WHM on a clean Ubuntu 24.04 LTS VPS. Check support, set an FQDN hostname, run the installer, follow the log and log in to WHM.
- Intermediate
- Linux VPS
- 4 min read
cPanel & WHM runs on Ubuntu as well as on the RHEL family. The install is a single script, but Ubuntu has a few rules of its own: only specific LTS releases are supported, DNS must use PowerDNS, and the server must be a clean, default install. This guide covers the checks, the install and your first WHM login.
RunRacks does not sell cPanel licences. A new install starts a 15-day trial, and you buy a licence from cPanel or a partner afterwards. See how to activate a cPanel licence.
Before you start
- A RunRacks Linux VPS running a fresh Ubuntu 24.04 LTS install. At the time of writing, cPanel lists Ubuntu 24.04 LTS as its supported Ubuntu release. cPanel adds and retires Ubuntu versions with its LTS releases, so confirm on the cPanel system requirements page before you start.
- Enough resources. cPanel's published minimum for Ubuntu is 2 GB RAM and 20 GB disk, with 4 GB RAM and 40 GB disk recommended. Real sites need more.
- Root SSH access. The IP and root password are in your Dashboard.
- A domain for the server hostname, such as
server.example.com.
cPanel cannot be uninstalled. Removing it means reinstalling the OS, so only install it on a server you can wipe.
Check the Ubuntu version
Log in and confirm the release:
ssh [email protected]
lsb_release -dsExpected output:
Ubuntu 24.04.x LTSIf it shows Ubuntu 22.04 or another release, reinstall the VPS with Ubuntu 24.04 from the Dashboard control panel. Upgrading an existing system is not the same as a clean install.
Prepare the server
Bring the system up to date and reboot if the kernel changed:
apt update && apt -y full-upgrade
rebootSet the hostname
The hostname must be a resolvable FQDN of 60 characters or fewer that is not one of your website domains.
hostnamectl set-hostname server.example.com
hostname -fAdd an A record for server.example.com at your DNS provider with the VPS IP, then check it:
dig +short server.example.comDisable UFW
cPanel recommends disabling the OS firewall before installing and setting up a cPanel-aware firewall such as CSF afterwards.
ufw status
ufw disableAppArmor can stay enabled. cPanel supports it on Ubuntu.
The server is unfiltered between now and the moment you configure CSF. Keep that window short.
Run the installer
Use screen so a lost SSH connection does not interrupt the install:
apt -y install screen
screen -S cpanel
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latestThe script checks the OS and installs cPanel's own builds of Apache, PHP, MariaDB, Exim, Dovecot and PowerDNS. On Ubuntu, PowerDNS is the only supported nameserver, so you will not see a BIND option later.
If you get disconnected, log in again and run screen -r cpanel.
Follow the log
From a second session:
tail -f /var/log/cpanel-install.logThe install usually takes 30 to 60 minutes. At the end, the log reports that the installation finished and prints the WHM address.
First WHM login
Open:
https://203.0.113.10:2087Sign in as root. Accept the self-signed certificate warning for now. WHM then asks you to accept the licence agreement and to enter a contact email and nameservers. The WHM initial setup wizard guide explains these screens.
Check it works
/usr/local/cpanel/cpanel -V
systemctl is-active cpanel pdns eximThe first command prints the cPanel version. The second should print active three times. In WHM, Home » Server Status » Service Status gives the same picture in the browser.
To confirm the trial licence, enter the server IP at verify.cpanel.net.
Troubleshooting
- "This operating system is not supported": the Ubuntu release is not on cPanel's current list, or it is not an LTS server install. Reinstall with Ubuntu 24.04 LTS.
- Installer fails on a package conflict: something such as Apache, Nginx or MySQL was already installed. Reinstall the OS and run the installer first.
- Hostname warning during install: the A record does not exist yet or is still propagating. Check with
dig, fix it, and set the hostname again later in WHM. - Cannot reach port 2087: UFW or another filter is still active, or the install has not finished. Check
ufw statusand the end of the install log. - Expecting BIND for DNS: BIND is not available on Ubuntu. Use PowerDNS, or disable local DNS and host zones elsewhere.
Next steps
- Configure the basics: WHM initial setup wizard.
- Add a firewall straight away: install CSF firewall on cPanel.
- Compare with the RHEL family: install cPanel & WHM on AlmaLinux.
- Pick a plan with room for your accounts on Pricing.
Was this guide helpful?
Still stuck?
Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.
Related guides
Control panels
How to install Plesk on a Linux VPS (AlmaLinux and Ubuntu)
Install Plesk on a fresh Linux VPS with the official one-click installer, apply your licence key and log in to the panel for the first time on port 8443.
- Beginner
- Linux VPS
- 8 min read
Control panels
CyberPanel: back up and restore a website
Create on-demand and scheduled website backups in CyberPanel, download the archives off the server, and restore a site from a backup when something breaks.
- Intermediate
- Linux VPS
- 6 min read
Control panels
Plesk Backup Manager: schedule backups and restore a site
Set up scheduled backups in Plesk Backup Manager, keep a copy off the server, and restore a single domain or subscription when something goes wrong.
- Intermediate
- Linux VPS
- 7 min read