Knowledgebase

How to Install cPanel/WHM on Your VPS or Dedicated Server

To install cPanel/WHM, start from a freshly installed AlmaLinux 9 or Ubuntu 22.04 server with at least 2 GB RAM, 40 GB disk, a static IP and a fully qualified hostname. Log in as root and run cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest. Then open WHM at https://your-server-ip:2087 to finish setup. cPanel also needs a licence tied to your server's IP address. This guide covers each step for a Cloudesta Cloud VPS or dedicated server, from preparation to your first hosting account.

Prerequisites

  • A Cloud VPS or dedicated server with a fresh AlmaLinux 9 or Ubuntu 22.04 install and no other control panel (Plesk, CyberPanel, aaPanel, etc.).
  • At least 2 GB RAM (4 GB recommended) and 40 GB disk.
  • A dedicated static IPv4 address and root SSH access.
  • A domain you control, so you can create the server hostname, for example server.example.com.
  • A valid cPanel licence for the server's IP (see step 2).
Cloudesta servers ship with Ubuntu 24.04 by default. If your server runs 24.04 or already has software installed, open a support ticket and ask for an OS reinstall to AlmaLinux 9 or Ubuntu 22.04 before you start. cPanel cannot be cleanly uninstalled. Removing it later also means an OS reinstall, so back up any data first.

1. Which operating system should I use for cPanel?

AlmaLinux 9 is the most common choice and has the longest track record with cPanel. Ubuntu 22.04 is also supported. Check cPanel's official system requirements before using any other release. Confirm your OS and resources:

cat /etc/os-release
free -h
df -h /

Update the system and install perl and tmux. The installer needs Perl, and tmux keeps the installation running if your SSH session drops.

# AlmaLinux 9
dnf -y update && dnf -y install perl curl tmux

# Ubuntu 22.04
apt update && apt -y upgrade && apt -y install perl curl tmux

2. How do I get a cPanel licence for my server?

cPanel licences are bound to the server's main IPv4 address. You have two options:

  • Through Cloudesta: open a support ticket with your server IP and ask for a cPanel licence. We will confirm pricing and activate it on your IP.
  • Directly from cPanel: buy a licence from the cPanel store and assign it to your server IP.

An IP that has never been licensed may get a 15-day trial automatically during installation. You can check an IP's licence status at https://verify.cpanel.net.

3. How do I set a fully qualified hostname?

The hostname must be a fully qualified domain name (FQDN) such as server.example.com. It must not be the bare domain (example.com) or a domain you plan to host as a cPanel account. First create an A record for server.example.com pointing to your server IP at your DNS provider. Then set the hostname:

hostnamectl set-hostname server.example.com
echo "203.0.113.10 server.example.com server" >> /etc/hosts
hostname -f

The hostname -f command must print server.example.com. If you plan to send mail from this server, ask support by ticket to set reverse DNS (rDNS) for your IP to the same hostname.

4. Do I need to disable SELinux on AlmaLinux?

Yes. cPanel does not run with SELinux enabled. Ubuntu does not use SELinux, so skip this step there. On AlmaLinux 9, disable it in both the config file and the kernel command line, then reboot:

getenforce
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
grubby --update-kernel ALL --args selinux=0
reboot

After the reboot, getenforce should return Disabled.

5. How do I run the cPanel installer?

Start a tmux session, then run the official installer as root:

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

Installation usually takes 30 to 60 minutes. It can take longer on smaller servers or slow disks. If you get disconnected, log back in and reattach with tmux attach -t cpanel. The full log is saved in /var/log/cpanel-install.log. When it finishes, the installer prints a WHM login URL.

6. How do I log in to WHM for the first time?

Open https://203.0.113.10:2087 in your browser. Your browser will show a certificate warning because the certificate is self-signed at this stage; accept it to continue. Log in with username root and your root password.

The initial setup wizard then asks you to:

  • Accept the cPanel licence agreement.
  • Enter a contact email address for server alerts. Use a mailbox that is not hosted on this server.
  • Set the nameservers, for example ns1.example.com and ns2.example.com.

You can change these later under WHM » Server Configuration » Basic WebHost Manager® Setup. To use your own nameservers, create A records for them and register them as glue records (child nameservers) at your domain registrar. Otherwise, keep using your existing external DNS provider.

7. Which firewall ports does cPanel need?

The core ports are:

  • SSH: 22
  • Web: 80, 443
  • cPanel: 2082, 2083
  • WHM: 2086, 2087
  • Webmail: 2095, 2096
  • Mail: 25, 465, 587, 110, 995, 143, 993
  • DNS: 53 (TCP and UDP)
  • FTP: 20, 21, plus the passive range 49152–65534

If firewalld is active on AlmaLinux:

systemctl is-active firewalld
firewall-cmd --permanent --add-port={20,21,22,25,53,80,110,143,443,465,587,993,995}/tcp
firewall-cmd --permanent --add-port={2082,2083,2086,2087,2095,2096}/tcp
firewall-cmd --permanent --add-port=53/udp
firewall-cmd --permanent --add-port=49152-65534/tcp
firewall-cmd --reload

If ufw is active on Ubuntu:

ufw status
ufw allow 20,21,22,25,53,80,110,143,443,465,587,993,995/tcp
ufw allow 2082,2083,2086,2087,2095,2096/tcp
ufw allow 53/udp
ufw allow 49152:65534/tcp
ufw reload

8. How do I create the first cPanel account?

Go to WHM » Account Functions » Create a New Account and fill in the account details:

  • Domain, for example example.com
  • Username
  • A strong password
  • Contact email

Choose a package, or create one first under WHM » Packages » Add a Package, then click Create. The user can log in at https://example.com:2083 once the domain's DNS points to the server.

Verify it works

/usr/local/cpanel/cpanel -V
systemctl status cpanel --no-pager
/usr/local/cpanel/cpkeyclt

These commands should show:

  • The first prints the cPanel version.
  • The second shows the service as active (running).
  • The third refreshes the licence and should complete without errors.

Also confirm that WHM loads on port 2087 and that your test account's site opens in a browser.

Common problems

Installer stops with a hostname error

The hostname is not an FQDN or does not resolve. Set it with hostnamectl set-hostname server.example.com, add the A record and the /etc/hosts entry, then rerun sh latest. On an installed server, change it under WHM » Networking Setup » Change Hostname.

"perl: command not found"

Minimal images may not include Perl. Run dnf -y install perl on AlmaLinux or apt -y install perl on Ubuntu, then start the installer again.

WHM shows a licence error

Check the IP at https://verify.cpanel.net. If the licence is active, run /usr/local/cpanel/cpkeyclt to refresh it. If there is no licence, or it is on a different IP, open a ticket with Cloudesta support or contact your cPanel licence vendor.

WHM on port 2087 times out

Open the port as shown in step 7 and confirm the service is listening with ss -tlnp | grep 2087. If it still times out from outside, open a support ticket so we can check network-level filtering.

Frequently asked questions

Can I install cPanel on a server that already has websites or another panel?

No. cPanel must be installed on a fresh OS. Back up your data and request an OS reinstall by support ticket first.

Is the cPanel licence included with a VPS?

No. The licence is separate and tied to your server IP. Request one through a Cloudesta support ticket or buy it directly from cPanel.

Do I need my own server to use cPanel?

Not necessarily. If you only need to host a few sites, shared cPanel hosting includes cPanel with no server administration or separate licence.

Need help? If you get stuck at any step, open a support ticket from your client area. Include your server IP and the last lines of /var/log/cpanel-install.log.

Was this answer helpful?

0 Users Found This Useful

Powered by WHMCompleteSolution