Control panels

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.

IntermediateLinux server4 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.

Note: 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 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 VPS provider's control panel.
  • A domain for the server hostname, such as server.example.com.

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

Bash
ssh root@203.0.113.10
lsb_release -ds

Expected output:

Ubuntu 24.04.x LTS

If it shows Ubuntu 22.04 or another release, reinstall the VPS with Ubuntu 24.04 from your VPS provider's 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:

Bash
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.

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

Bash
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.

Bash
ufw status
ufw disable

AppArmor can stay enabled. cPanel supports it on Ubuntu.

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

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

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

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

Bash
/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 MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.