Skip to content
Hosting

How to Install cPanel and WHM on a VPS (Step by Step)

A step-by-step guide to installing cPanel and WHM on a VPS: requirements, hostname, the official installer, WHM setup and securing the server.

By TremAfrica Research Updated November 5, 2026 5 min read

To install cPanel and WHM on a VPS, start with a fresh server running a cPanel-supported operating system, set a fully qualified hostname, update the system, then log in as root and run cPanel’s official installer. When it finishes, open WHM on port 2087, complete the setup wizard and make sure the server has a valid cPanel licence. This guide walks through each step and the checks that prevent common failures.

Before you start: requirements

A fresh VPS

cPanel must be installed on a clean operating system. Do not install it on a server that already runs a web server, another control panel or hosted sites. If in doubt, rebuild the VPS with a fresh image first.

A supported operating system

Current cPanel versions support AlmaLinux, Rocky Linux and CloudLinux (versions 8 and 9), and Ubuntu LTS releases. CentOS 7 and CentOS 8 are no longer supported for new installations. Check cPanel’s current system requirements before you build the server, because supported versions change over time.

Enough resources

cPanel’s documentation lists low absolute minimums, but a usable server needs more. Plan for at least 2 GB of RAM and 40 GB of disk for a small server, and more if you will host several busy sites, email for many users or large databases. A Tremhost KVM 1 VPS, with 2 dedicated cores, 2 GB RAM and 40 GB NVMe, meets that starting point.

Root access and a static IP

You need root SSH access and a static public IPv4 address. cPanel licences are tied to the server’s main IP address.

A cPanel licence

cPanel is commercial software. You need a licence for the server’s IP address, either directly from cPanel or through a provider. Official cPanel licences are priced by the number of accounts on the server.

Step 1: Connect to the server

From your computer, open a terminal and connect as root:

ssh root@your-server-ip

The installation takes a while, so run it inside screen or tmux. If your connection drops, the install keeps running and you can reconnect to it.

Step 2: Set a fully qualified hostname

cPanel needs a hostname that is a fully qualified domain name and is not the same as a website you will host. A common pattern is server.yourdomain.com:

hostnamectl set-hostname server.yourdomain.com

Create a DNS A record pointing that hostname to the server’s IP address, so it resolves correctly. This helps with SSL for the server itself and with email delivery.

Step 3: Update the operating system

On AlmaLinux, Rocky Linux or CloudLinux:

dnf update -y

On Ubuntu:

apt update and apt upgrade -y (run as two commands)

Reboot if a new kernel was installed.

Step 4: Check SELinux (RHEL-family systems)

cPanel does not support SELinux in enforcing mode. Check with the getenforce command. If it shows Enforcing, edit /etc/selinux/config, change SELINUX=enforcing to SELINUX=disabled, and reboot. Ubuntu does not use SELinux by default, so skip this step there.

Step 5: Run the cPanel installer

As root, run cPanel’s official installation command:

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

The installer checks the system, downloads cPanel and WHM, and installs the web server, mail server, DNS server, database server and other components. It can take from under an hour to several hours depending on the server and network. Do not interrupt it. Only download the installer from cPanel’s own domain.

When it completes, the output shows the address to open WHM.

Step 6: Log in to WHM and complete setup

  1. Open https://your-server-ip:2087 in a browser. You will see a certificate warning at first because the server’s own SSL is not yet issued; proceed to the page.
  2. Log in as root with your root password.
  3. Accept the licence agreement.
  4. Enter a contact email address for server notices.
  5. Set your nameservers, for example ns1.yourdomain.com and ns2.yourdomain.com, or use external DNS such as your registrar’s or Cloudflare’s.
  6. Finish the wizard.

If WHM reports that no licence is active, activate the licence for the server’s IP, then run /usr/local/cpanel/cpkeyclt to refresh it.

Step 7: Secure and configure the server

  • Firewall: allow the ports you use, such as 22 or your custom SSH port, 80, 443, 2083 (cPanel), 2087 (WHM), 2096 (webmail), 53 (DNS, if hosting DNS) and the mail ports 25, 465, 587, 993 and 995.
  • SSH: use key-based login and consider disabling root password login.
  • Two-factor authentication: enable it for WHM.
  • AutoSSL: enable it so each site gets a free certificate automatically.
  • Backups: configure WHM backups to a separate destination, not only the same disk.
  • Updates: leave automatic cPanel updates on.
  • PHP: choose the PHP versions and handler your sites need in MultiPHP Manager.

Step 8: Create your first hosting account

In WHM, create a package with the limits you want, then use Create a New Account to add a domain. The account owner logs in to cPanel at https://yourdomain.com:2083 or through /cpanel on the domain.

Common installation problems

  • Installer refuses to run: the OS is unsupported or not fresh. Rebuild with a supported image.
  • Hostname warnings: the hostname is not fully qualified or does not resolve. Fix the DNS record.
  • Licence errors: the licence is not bound to the server’s main IP. Check with your licence provider.
  • Cannot reach port 2087: a firewall at the provider or on the server is blocking it.

Frequently asked questions

How much does a cPanel licence cost for a VPS?

Official cPanel pricing depends on the number of accounts. Tremhost lists a shared cPanel licence for VPS servers at $5 a month with unlimited accounts on its cPanel licence page. Shared licences are third-party licensing arrangements rather than licences issued directly by cPanel, so review the terms before buying.

Tremhost’s shared licences receive official vendor updates.

Can I install cPanel on CentOS 7?

No. CentOS 7 is end of life and current cPanel versions do not support it. Use AlmaLinux, Rocky Linux, CloudLinux or a supported Ubuntu LTS release.

Can I uninstall cPanel later?

Not cleanly. cPanel changes many parts of the system. To remove it, back up your data and reinstall the operating system.

Do I need a separate VPS for each website?

No. One cPanel server can host many websites, each in its own account, as long as resources allow.

Next step

If you want to install cPanel yourself, start with a Tremhost KVM VPS. If you would rather skip the setup, a managed cPanel VPS comes with cPanel and WHM, CloudLinux, LiteSpeed and Imunify360 installed and maintained for you.

Ask us on WhatsApp