How to Install cPanel on a VPS — Step-by-Step Guide (2026)

install cpanel on vps

cPanel is still the most widely used web hosting control panel in the world — and for good reason. It turns a raw Linux VPS into a fully managed hosting environment with file management, email accounts, databases, DNS zones, backups, and SSL all accessible from a browser.

The catch is that cPanel isn’t free and it’s not something you install from a package manager. There’s a specific process, specific OS requirements, and a few things you need to get right before running the installer — otherwise you’ll waste an hour troubleshooting a hostname issue or a blocked port.

This guide covers the full cPanel + WHM installation on a VPS, from a fresh server to a working control panel with firewall, DNS, and AutoSSL configured. We’re using AlmaLinux 8 — the most stable cPanel-supported OS right now after CentOS 7 reached end of life.


What Is cPanel and WHM — and Why They’re Different

A lot of people use “cPanel” as a catch-all term, but you actually get two interfaces when you install cPanel on a VPS:

Interface Full Name Who Uses It Default Port What You Do There
WHM WebHost Manager Server admin (you) 2087 (HTTPS) Create hosting accounts, manage server config, DNS, firewall, SSL, server-level settings
cPanel Control Panel Individual hosting account users 2083 (HTTPS) Manage files, emails, databases, subdomains, backups for their own account

You install one package — cPanel/WHM — and both interfaces come with it. WHM is the admin layer. cPanel is what each hosted website owner sees. If you’re running a VPS just for your own sites, you’ll use WHM to set things up and cPanel to manage your individual sites day to day.


Server Requirements Before You Start

cPanel is not lightweight. It runs several background services (Apache, Exim, MySQL, cPHPFPM, cPanelLogd, and more) and requires meaningful resources to run well. These are the minimums — and genuine minimums, not comfortable ones:

Requirement Minimum Recommended (1–5 sites) Recommended (5–20 sites)
RAM 1 GB 2 GB 4–8 GB
CPU 1 core 2 cores 4+ cores
Disk space 20 GB 40 GB SSD 80+ GB NVMe
Virtualization KVM or Xen KVM KVM
Static IP ✅ Required ✅ Required ✅ Required
Root SSH access ✅ Required ✅ Required ✅ Required
Resolvable hostname ✅ Required ✅ Required ✅ Required
⚠️ OpenVZ not supported: cPanel requires KVM or Xen virtualization. OpenVZ containers share a kernel and can’t run cPanel — the installer will fail. If your current VPS is OpenVZ, you’ll need to switch. VPSWala uses KVM-based Proxmox virtualization, so it’s fully compatible.

For the 30-day Professional free trial — 8-core AMD EPYC, 8 GB DDR5 ECC RAM, 1 TB Micron NVMe — cPanel runs without breaking a sweat and handles 10–20 hosted sites comfortably.


Supported Operating Systems in 2026

OS cPanel Support Status Recommended?
AlmaLinux 8 ✅ Full support Active LTS ✅ Yes — best choice
AlmaLinux 9 ✅ Full support Active LTS ✅ Yes
CloudLinux 8 ✅ Full support Active — paid OS For shared hosting resellers
Rocky Linux 8/9 ✅ Full support Active LTS ✅ Yes
CentOS 7 ⚠️ Legacy support only EOL June 2024 ❌ No — avoid
Ubuntu 20.04 / 22.04 ❌ Not supported ❌ No
Debian ❌ Not supported ❌ No

This guide uses AlmaLinux 8. If you’re on AlmaLinux 9 or Rocky Linux, the commands are identical — just make sure your VPS is deployed with the right OS before starting. See our guide on how to reinstall or change the OS on your VPS if you need to switch.

For a broader comparison of AlmaLinux vs Rocky Linux, read our AlmaLinux vs Rocky Linux breakdown.


Step 1 — Get a VPS and Connect via SSH

You need a fresh AlmaLinux 8 VPS with root SSH access and a static IP. “Fresh” matters — installing cPanel on top of an existing server with Apache, Nginx, or MySQL already running causes conflicts. Start with a clean OS install.

If you don’t have a VPS yet, the 30-day Professional free trial deploys AlmaLinux 8 in 60 seconds with KVM virtualization, a static IP, and root SSH access — everything cPanel needs.

Connect via SSH:

ssh root@YOUR_VPS_IP

If this is your first time connecting to a fresh VPS, our SSH tips guide covers key-based authentication setup, which you should do before running any installer.


Step 2 — Prepare the Server

Update everything and disable services that will conflict with cPanel’s own stack:

dnf update -y
dnf install -y curl wget perl

Disable NetworkManager — cPanel manages networking directly and NetworkManager interferes:

systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl enable network
systemctl start network

Disable firewalld — cPanel installs its own firewall (CSF) and the two will conflict if both run:

systemctl stop firewalld
systemctl disable firewalld

Disable SELinux — cPanel doesn’t play well with SELinux enforcing mode. Open the config:

nano /etc/selinux/config

Change the SELINUX line to:

SELINUX=disabled

Apply without rebooting:

setenforce 0
💡 Why disable SELinux? SELinux in enforcing mode blocks many of the file operations cPanel needs during installation and normal operation — particularly around mail and PHP. Permissive mode still logs violations without blocking, but disabled is what cPanel officially recommends on shared hosting VPS environments.

Step 3 — Set the Server Hostname

This step trips up more cPanel installs than anything else. cPanel requires a fully qualified domain name (FQDN) as the server hostname — something like server.yourdomain.com. It cannot be an IP address, a single word, or unresolvable.

Set the hostname:

hostnamectl set-hostname server.yourdomain.com

Verify it’s set correctly:

hostname -f

Should output: server.yourdomain.com

Now make sure the hostname resolves. Open /etc/hosts:

nano /etc/hosts

Add this line (replace with your actual VPS IP and hostname):

YOUR_VPS_IP   server.yourdomain.com   server

Before running the installer, add an A record in your domain’s DNS panel pointing server.yourdomain.com to your VPS IP. The installer checks this — if it can’t resolve the hostname, it warns you and may fail at the license verification step. Our guide on setting up DNS for a VPS hosted website covers exactly how to add A records.


Step 4 — Run the cPanel Installer

Download and run the official cPanel installer. This is a single command — cPanel handles the rest automatically:

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

The installer will:

  • Download and install cPanel/WHM and all dependencies
  • Install Apache (as LiteSpeed or Apache depending on your license)
  • Install Exim mail server, Dovecot, ProFTPD, MySQL/MariaDB
  • Configure PHP via cPHPFPM
  • Set up cron jobs for background services
  • Apply an initial firewall configuration

Installation time: 20–45 minutes depending on your server speed and connection. Don’t close the SSH session. If you need to run this in the background and reconnect later, use screen:

# Run installer inside screen so it survives SSH disconnection
screen -S cpanel_install
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

# Detach with Ctrl+A then D
# Reconnect with:
screen -r cpanel_install

When installation is complete you’ll see output like:

cPanel installation complete.
You can access WHM at: https://YOUR_VPS_IP:2087
💡 Licensing: cPanel requires a paid license after the 15-day free trial. Pricing starts at around $18–22/month for a VPS license. If you’re just testing, the trial is enough to evaluate the full feature set. For production use on a single server with your own sites, the Solo license covers one account (yours). For reseller hosting, you’ll need a higher tier.

Step 5 — Access WHM and Complete Initial Setup

Open your browser and go to:

https://YOUR_VPS_IP:2087

You’ll get a certificate warning — that’s expected on first access since WHM is using a self-signed cert before AutoSSL runs. Accept and proceed.

Log in with:

  • Username: root
  • Password: your VPS root password

WHM launches the setup wizard on first login. Work through it:

Setup Wizard Steps

Step What to Do Notes
License agreement Agree
Networking setup Confirm your VPS IP and hostname Should auto-populate from Step 3
Nameservers Enter ns1 and ns2 — e.g. ns1.yourdomain.com / ns2.yourdomain.com We configure these properly in Step 8
Contact email Enter an email for server alerts Use a real address — WHM sends security alerts here
FTP server Pure-FTPd or ProFTPD Either works — ProFTPD is slightly more compatible
MySQL Leave defaults WHM manages MySQL automatically
Update preferences Automatic updates on Keeps cPanel and security patches current

Click Finish. WHM will apply settings and bring you to the main dashboard.


Step 6 — Configure CSF Firewall

cPanel comes with its own basic firewall, but the industry standard for cPanel servers is CSF (ConfigServer Security & Firewall). It’s free, integrates directly into WHM, and gives you a full UI for managing rules.

Install CSF:

cd /tmp
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

Check that CSF works on your server (it tests iptables modules):

perl /usr/local/csf/bin/csftest.pl

All lines should return RESULT: csf should function on this server. After installing, CSF appears in WHM under Plugins → ConfigServer Security & Firewall.

Essential ports to have open in CSF (these are the defaults — verify in WHM → CSF → Firewall Configuration):

Port Service Direction
22 SSH In
80 HTTP In
443 HTTPS In
2083 cPanel HTTPS In
2087 WHM HTTPS In
2086 WHM HTTP In
2082 cPanel HTTP In
21 FTP In
25, 465, 587 SMTP / Mail sending In/Out
110, 143, 993, 995 POP3 / IMAP In
53 DNS In/Out

For more on firewall configuration at the OS level, see our guide on securing and firewalling your VPS server. Also make sure your VPS provider’s external firewall (if separate from the OS firewall) has these ports open — covered in our guide to opening ports 80 and 443.


Step 7 — Create Your First cPanel Account

In WHM, go to Account Functions → Create a New Account.

Field What to Enter
Domain yourdomain.com (the site you’re hosting)
Username Auto-generated from domain — keep it or customize (max 8 chars)
Password Use the generator — cPanel enforces minimum strength
Email Account contact email
Package Default package or create a custom one first
DNS settings Leave as default — auto-creates DNS zone

Click Create. WHM creates the cPanel account, sets up the home directory at /home/username/, creates the DNS zone, and sets up a default mail account. Access your new cPanel account at:

https://YOUR_VPS_IP:2083

Log in with the username and password you just set.


Step 8 — Set Up DNS and Nameservers

For hosted domains to resolve through your VPS, you need to set up nameservers. This is what lets you point a domain to your cPanel server so WHM manages its DNS zone.

Create Nameserver A Records

In your domain registrar’s DNS panel (wherever you bought the domain), add two A records pointing to your VPS IP:

ns1.yourdomain.com → YOUR_VPS_IP
ns2.yourdomain.com → YOUR_VPS_IP

Both ns1 and ns2 point to the same IP on a single-server setup — that’s fine for personal and small hosting use.

Register Glue Records

At your domain registrar, register “glue records” (also called nameserver registration or child nameservers) for ns1 and ns2 pointing to your VPS IP. This step is required — without it, the nameservers can’t resolve because DNS needs to know the IP of the nameserver itself before it can look up anything else.

Configure Nameservers in WHM

In WHM, go to DNS Functions → Nameserver IPs. Enter your ns1 and ns2 IP (your VPS IP for both). Save.

Then go to Server Configuration → Basic WHM Setup and confirm your nameserver hostnames match what you set at the registrar.

💡 DNS propagation: After setting glue records and nameservers, allow 4–24 hours for propagation before testing. You can monitor propagation at dnschecker.org. For a broader explanation of how DNS works with a VPS, see our DNS setup guide for VPS hosted websites.

Step 9 — Enable AutoSSL (Free SSL for All Accounts)

cPanel’s AutoSSL automatically provisions and renews Let’s Encrypt SSL certificates for every hosted domain on the server — for free. Enable it in WHM:

  1. Go to SSL/TLS → Manage AutoSSL
  2. Under “Provider”, select Let’s Encrypt
  3. Agree to the Let’s Encrypt Terms of Service
  4. Click Save

Run AutoSSL immediately to provision certificates for all existing accounts:

/usr/local/cpanel/bin/autossl_check --all

AutoSSL runs on a cron schedule after this — it automatically renews certificates before they expire. No manual intervention needed. For why SSL matters for SEO and security, see our post on why your website needs SSL.


cPanel vs Free Alternatives — Is It Worth the Cost?

cPanel’s pricing changed significantly in 2019 — what used to be a flat fee is now per-account monthly billing, which stings for small users. Here’s how it stacks up against the main free alternatives:

Feature cPanel/WHM HestiaCP AAPanel Virtualmin
Cost ~$18–22/month (VPS) ✅ Free ✅ Free ✅ Free (GPL)
OS support AlmaLinux, Rocky, CloudLinux only Ubuntu, Debian Ubuntu, CentOS, Debian Most Linux distros
Email server ✅ Exim + Dovecot built-in ✅ Exim + Dovecot Basic ✅ Postfix + Dovecot
WHM-equivalent (reseller layer) ✅ Full WHM Limited ❌ No ✅ Webmin/Virtualmin
Plugin ecosystem ✅ Huge — Softaculous, Installatron, etc. Small Medium Medium
1-click WordPress install ✅ Via Softaculous ✅ Built-in ✅ Built-in ✅ Via Virtualmin
AutoSSL / Let’s Encrypt ✅ AutoSSL built-in ✅ Built-in ✅ Built-in ✅ Built-in
Learning curve Low — industry standard Low Low Medium
Support ✅ Official paid support Community Community Community + paid
Best for Resellers, agencies, client hosting Personal/small use on Ubuntu Simple LAMP management Linux power users

Verdict: cPanel is worth it if you’re hosting client sites, running a web hosting reseller business, or you need the full WHM reseller layer. For personal VPS use with just your own sites, HestiaCP on Ubuntu gives you 80% of the functionality at zero cost. We have a full guide on installing and configuring HestiaCP on Ubuntu/Debian if you want to compare hands-on.

See also our overview of 7 most popular web hosting control panels and top 4 free control panels for VPS for the full landscape.


Troubleshooting Common cPanel Install Errors

Error Likely Cause Fix
Installer fails at hostname check Hostname not set or not resolvable Run hostname -f — must return FQDN. Add A record for hostname at your registrar. Re-run installer.
“OpenVZ not supported” error Wrong virtualization type cPanel requires KVM. Check with systemd-detect-virt — if it returns openvz, you need a different VPS
WHM accessible on port 2086 but not 2087 SSL certificate not yet issued or CSF blocking 2087 Access via 2086 first, then go to SSL/TLS in WHM to issue the certificate. Check CSF allows port 2087 in TCP_IN
License error on first WHM login cPanel can’t verify license for your IP Check https://verify.cpanel.net with your VPS IP. If unlicensed, purchase a license or use the 15-day trial
cPanel installer hangs at MySQL step Existing MySQL/MariaDB installation conflict Remove existing MySQL: dnf remove mysql mariadb then re-run installer
AutoSSL fails — “Domain does not resolve” DNS not propagated or nameservers not configured Check domain resolves to your VPS IP with dig yourdomain.com +short. Wait for DNS propagation or check nameserver setup in Step 8
Can’t connect to port 2087 from browser External cloud firewall blocking port Log into your VPS provider’s control panel and open port 2087 in the network firewall — not just CSF. VPSWala’s Proxmox panel has a separate firewall tab.
Email not sending from hosted accounts Port 25 blocked by VPS provider Many providers block outbound port 25 by default to prevent spam. Contact support to unblock, or use port 587 with SMTP authentication
Softaculous not showing after install Softaculous trial not activated In WHM go to Plugins → Softaculous and activate the trial. Softaculous is bundled but needs activation on first use

FAQ

Is cPanel free?

No — cPanel requires a paid license after a 15-day trial. VPS licensing starts at around $18–22/month. If cost is a blocker, check HestiaCP or Virtualmin — both are free and cover most use cases for personal hosting.

Can I install cPanel on Ubuntu?

No. cPanel officially supports AlmaLinux, Rocky Linux, and CloudLinux only. Ubuntu and Debian are not supported. If you want a control panel on Ubuntu, HestiaCP is the closest equivalent. We have a full guide on installing HestiaCP on Ubuntu.

How much RAM does cPanel actually use?

On a fresh install with one account, cPanel’s background services typically consume 600–900 MB of RAM just sitting idle. That’s why 1 GB is a hard floor and 2 GB is the real minimum for any practical use. Running WordPress sites on top of cPanel, budget at least 2 GB for one site, 4 GB for a handful.

Can I install WordPress through cPanel?

Yes — via Softaculous, which comes bundled with cPanel. It’s a 2-minute 1-click install. We have a dedicated guide on installing WordPress with Softaculous if you want the full walkthrough. For direct VPS installs without cPanel, see our guides on WordPress on Apache + MySQL and WordPress on Nginx.

What’s the difference between cPanel and Plesk?

Both are paid control panels with similar feature sets. cPanel is more common in the US and runs only on RHEL-based Linux. Plesk runs on both Linux and Windows Server, making it the go-to for Windows VPS hosting. For most Linux VPS setups, cPanel is the default choice — but if you’re running Windows, see our guide on Windows VPS via RDP and SSL on Windows VPS.

Can I use cPanel with Cloudflare?

Yes — and it’s a common setup. You point your domain’s nameservers to Cloudflare instead of your cPanel nameservers, then proxy traffic through Cloudflare’s CDN while cPanel still handles email, PHP, and databases on the backend. The DNS zone is managed in Cloudflare’s dashboard rather than WHM. Our VPS DNS setup guide covers the DNS side of this.

How do I back up sites in cPanel?

cPanel has a built-in backup system under WHM → Backup Configuration. You can set up automatic full and incremental backups to local storage, remote FTP, S3-compatible storage, or Google Drive. For VPS-level backups (entire server), see our guide on backing up and restoring VPS data and automatic VPS backups to Google Drive or Dropbox.


Your cPanel/WHM server is now fully set up — firewall running, nameservers configured, AutoSSL provisioning certificates automatically, and Softaculous ready for 1-click installs. The whole stack took less than an hour on a fresh VPS.

If you need serious resources to run cPanel comfortably, the  30-day Professional free trial — 8-core AMD EPYC, 8 GB DDR5 ECC RAM, 1 TB Micron NVMe — handles 10–20 cPanel accounts without breaking a sweat. KVM virtualization, static IP, AlmaLinux 8 deploy ready in 60 seconds. No credit card required.

For next steps, read our guides on best practices for managing and updating a VPS, VPS security hardening, and advantages and disadvantages of cPanel on a VPS for a deeper look at whether cPanel is the right long-term choice for your setup.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *