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

By RunRacks Team · Published

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.

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.

Check the Ubuntu version

Log in and confirm the release:

Terminal
ssh [email protected]
lsb_release -ds

Expected output:

Text
Ubuntu 24.04.x LTS

If 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:

Terminal
apt update && apt -y full-upgrade
reboot

Set the hostname

The hostname must be a resolvable FQDN of 60 characters or fewer that is not one of your website domains.

Terminal
hostnamectl set-hostname server.example.com
hostname -f

Add an A record for server.example.com at your DNS provider with the VPS IP, then check it:

Terminal
dig +short server.example.com

Disable UFW

cPanel recommends disabling the OS firewall before installing and setting up a cPanel-aware firewall such as CSF afterwards.

Terminal
ufw status
ufw disable

AppArmor can stay enabled. cPanel supports it on Ubuntu.

Run the installer

Use screen so a lost SSH connection does not interrupt the install:

Terminal
apt -y install screen
screen -S cpanel
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

The 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:

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

The 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:

Text
https://203.0.113.10:2087

Sign 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

Terminal
/usr/local/cpanel/cpanel -V
systemctl is-active cpanel pdns exim

The 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 status and 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

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.

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