Skip to main content
← Blog
GuidesVPSLinuxself-hostedautomation

How to Install cPanel & WHMCS on a Linux VPS (2026)

Step-by-step guide to installing cPanel/WHM and WHMCS on a Linux VPS. Cover server prep, WHM setup, WHMCS billing platform, and security hardening.

Rohan
Rohan
12 min read
How to Install cPanel & WHMCS on a Linux VPS (2026)

This guide walks you through the complete process of installing cPanel/WHM and WHMCS on a fresh Linux VPS, giving you a fully functional web hosting control panel paired with an automated billing and client management platform. Whether you are launching a hosting business or managing infrastructure for clients, this step-by-step tutorial covers server preparation, cPanel installation, WHM configuration, WHMCS setup, and essential security hardening.

Last updated: May 8, 2026

The web hosting industry continues to grow rapidly, with over 330,000 web hosting providers operating globally. Running your own hosting infrastructure gives you complete control over pricing, resources, and the customer experience. cPanel/WHM remains the industry-standard control panel, and WHMCS is the most widely adopted billing and automation platform for hosting providers.

This guide covers both tools on a single VPS, from a clean OS install to a production-ready hosting environment.

Prerequisites

Before you begin, make sure you have:

  • A FlashRDP Linux VPS with at least 2 vCPUs, 4 GB RAM, and 40 GB NVMe storage
  • A supported OS: AlmaLinux 8/9, Rocky Linux 8/9, or Ubuntu 22.04 (fresh, minimal install)
  • Root SSH access to the server
  • A valid cPanel license (15-day free trial available at cpanel.net)
  • A valid WHMCS license (purchased from whmcs.com)
  • A registered domain with DNS access (for your hostname and client portal)
  • An SSL certificate (free via AutoSSL in cPanel, or use Let's Encrypt)
Tip

💡 Tip FlashRDP Linux VPS plans include full root access, KVM virtualization, 1 Gbps unmetered bandwidth, and a dedicated static IPv4 address. Plans start at $11.99/month. View Linux VPS plans.

cPanel & WHMCS Architecture Overview

Before diving in, here is a quick overview of how the components fit together:

ComponentRoleDefault Port(s)
WHMServer-level admin panel (root access)2087 (HTTPS)
cPanelPer-account hosting control panel2083 (HTTPS)
WHMCSBilling, invoicing, client management443 (HTTPS)
Apache/LiteSpeedWeb server (managed by WHM)80, 443
MySQL/MariaDBDatabase engine3306
EximMail transfer agent25, 465, 587

Step 1: Prepare the Server

Start by connecting to your VPS via SSH and configuring the basics.

1.1 Connect via SSH

Open your terminal and connect to the server using the IP address from your FlashRDP dashboard:

×
-
+
bash
ssh root@YOUR_SERVER_IP

1.2 Set the Hostname

cPanel requires a Fully Qualified Domain Name (FQDN) as the server hostname. This should not be a domain you plan to host as a client website.

×
-
+
bash
hostnamectl set-hostname server.yourdomain.com

Verify the change:

×
-
+
bash
hostname -f
Warning

⚠ Warning The hostname must resolve to your server's IP address. Create an A record in your DNS zone for server.yourdomain.com pointing to your VPS IP before proceeding.

1.3 Update the System

Update all packages to their latest versions:

×
-
+
bash
# AlmaLinux / Rocky Linux
dnf update -y

# Ubuntu
apt update && apt upgrade -y

1.4 Disable SELinux (RHEL-based Only)

cPanel does not support SELinux in enforcing mode. Disable it:

×
-
+
bash
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0

1.5 Configure the Firewall

Allow the essential ports cPanel uses:

×
-
+
bash
firewall-cmd --permanent --add-port={80,443,2083,2087,25,465,587,993,995}/tcp
firewall-cmd --reload

Step 2: Install cPanel & WHM

cPanel provides an automated installer script that handles all dependencies and configuration.

2.1 Run the Installer

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

ℹ Note The installation takes 15 to 45 minutes depending on your server's hardware and network speed. Do not interrupt the process.

2.2 Verify the Installation

Once complete, the installer displays a summary with your WHM access URL. Verify cPanel services are running:

×
-
+
bash
/usr/local/cpanel/cpanel -V

This prints the installed cPanel version.

2.3 Reboot the Server

Reboot to apply kernel updates and finalize service configurations:

×
-
+
bash
reboot

Step 3: Configure WHM

After reboot, access WHM through your browser to complete the initial setup.

3.1 Access WHM

Open your browser and navigate to:

https://YOUR_SERVER_IP:2087

Log in with:

  • Username: root
  • Password: Your root SSH password

3.2 Complete the Setup Wizard

The WHM Initial Setup Wizard walks you through:

  1. License Agreement: Accept the cPanel license terms
  2. Contact Email: Enter an admin email for server alerts
  3. Nameservers: Configure your nameserver hostnames (e.g., ns1.yourdomain.com, ns2.yourdomain.com)
  4. DNS Resolvers: Use reliable resolvers like 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google)
  5. Networking: Confirm the server's IP configuration

3.3 Activate Your License

If you have a cPanel license key, activate it under WHM > Manage Your cPanel & WHM License. If you are using the trial, it activates automatically based on your server IP.

3.4 Enable AutoSSL

Enable free SSL certificates for all hosted domains:

  1. Navigate to WHM > Manage AutoSSL
  2. Select the cPanel (powered by Sectigo) provider
  3. Click Save

AutoSSL automatically provisions and renews SSL certificates for every domain on the server.

Step 4: Create a Hosting Account for WHMCS

WHMCS runs as a web application on your server. Create a dedicated cPanel account to host it.

4.1 Create the Account in WHM

  1. Navigate to WHM > Create a New Account
  2. Fill in the details:
    • Domain: billing.yourdomain.com (or your preferred subdomain)
    • Username: whmcs (auto-generated from domain)
    • Password: Use a strong password
    • Package: Select a hosting package or use defaults
  3. Click Create

4.2 Set Up DNS

Create an A record for your WHMCS domain pointing to the server IP:

Record TypeNameValue
Abilling.yourdomain.comYOUR_SERVER_IP

Step 5: Install WHMCS

You can install WHMCS using Softaculous (the fastest method) or manually.

Softaculous comes pre-installed with cPanel and provides one-click WHMCS installation.

  1. Log in to cPanel for the billing.yourdomain.com account at https://YOUR_SERVER_IP:2083
  2. Scroll to the Software section and click Softaculous Apps Installer
  3. Search for WHMCS in the search bar
  4. Click Install and fill in the configuration:
    • Choose Protocol: https://
    • Choose Domain: billing.yourdomain.com
    • In Directory: Leave blank to install on the domain root
    • License Key: Enter your WHMCS license key
    • Admin Username: Choose a secure admin username (not admin)
    • Admin Password: Use a strong, unique password
    • Admin Email: Your admin email address
  5. Click Install at the bottom

Softaculous downloads, extracts, configures the database, and sets up WHMCS automatically.

Method B: Manual Installation

Use this method if you need full control over the installation process.

5.1 Download WHMCS

Log in to the WHMCS Members Area, navigate to Downloads, and download the latest full release ZIP file.

5.2 Upload and Extract

  1. Log in to cPanel for billing.yourdomain.com
  2. Open File Manager and navigate to public_html
  3. Click Upload, select the WHMCS ZIP file, and wait for the upload to complete
  4. Right-click the ZIP file and select Extract

5.3 Create the Database

  1. In cPanel, navigate to MySQL Database Wizard
  2. Create a new database (e.g., whmcs_db)
  3. Create a new database user with a strong password
  4. Assign the user ALL PRIVILEGES on the database
  5. Save these credentials for the next step

5.4 Run the Web Installer

  1. Rename configuration.php.new to configuration.php in the WHMCS directory
  2. Open your browser and navigate to https://billing.yourdomain.com/install/install.php
  3. Follow the installer wizard:
    • System Requirements Check: Verify all requirements pass
    • License Key: Enter your WHMCS license key
    • Database Configuration: Enter the database name, user, and password you created
    • Admin Account: Set your admin login credentials
  4. Click Complete Setup

5.5 Post-Installation Cleanup

×
-
+
bash
# Remove the install directory (critical for security)
rm -rf /home/whmcs/public_html/install

# Set secure permissions on the configuration file
chmod 400 /home/whmcs/public_html/configuration.php
Warning

⚠ Warning Leaving the /install directory on a production server is a serious security risk. Always delete it immediately after installation.

Step 6: Secure and Harden WHMCS

Follow these essential security steps before going live.

6.1 Rename the Admin Directory

Edit configuration.php and change the admin directory path:

×
-
+
php
$customadminpath = 'secureadmin';

Then rename the actual directory:

×
-
+
bash
mv /home/whmcs/public_html/admin /home/whmcs/public_html/secureadmin

6.2 Set File Permissions

×
-
+
bash
# Writable directories required by WHMCS
chmod 777 /home/whmcs/public_html/attachments
chmod 777 /home/whmcs/public_html/downloads
chmod 777 /home/whmcs/public_html/templates_c

# Lock down the configuration file
chmod 400 /home/whmcs/public_html/configuration.php

6.3 Disable MySQL Strict Mode

WHMCS does not support MySQL Strict Mode. Create or edit the MySQL configuration:

×
-
+
bash
nano /etc/my.cnf.d/disable-strict.cnf

Add:

×
-
+
ini
[mysqld]
sql_mode = ""

Restart MySQL:

×
-
+
bash
systemctl restart mysqld

6.4 Set Up the WHMCS Cron Job

WHMCS requires a cron job to automate invoicing, suspensions, domain renewals, and other scheduled tasks.

In cPanel, navigate to Cron Jobs and add:

*/5 * * * * php -q /home/whmcs/public_html/crons/cron.php

This runs the WHMCS cron every 5 minutes.

6.5 Enable SSL

If AutoSSL has not yet provisioned a certificate for your WHMCS domain, force it:

  1. Navigate to WHM > Manage AutoSSL
  2. Select the whmcs cPanel user
  3. Click Run AutoSSL

Verify SSL is active by visiting https://billing.yourdomain.com.

Step 7: Connect WHMCS to WHM

Link WHMCS to your cPanel/WHM server so it can automatically provision, suspend, and terminate hosting accounts.

7.1 Add the Server in WHMCS

  1. Log in to your WHMCS admin panel at https://billing.yourdomain.com/secureadmin
  2. Navigate to Configuration > System Settings > Servers
  3. Click Add New Server and fill in:
    • Name: Your server name (e.g., "FlashRDP Node 1")
    • Hostname: server.yourdomain.com
    • IP Address: Your server IP
    • Server Type: Select cPanel/WHM
    • Username: root
    • Access Hash / API Token: Generate an API token in WHM under Development > Manage API Tokens
  4. Click Test Connection to verify, then Save Changes

7.2 Create a Server Group

  1. Navigate to Configuration > System Settings > Servers
  2. Click the Server Groups tab
  3. Create a new group (e.g., "Production Servers")
  4. Assign your server to the group

7.3 Create a Product

  1. Navigate to Configuration > System Settings > Products/Services
  2. Create a new product group (e.g., "Web Hosting Plans")
  3. Add a product:
    • Product Type: Hosting Account
    • Product Name: e.g., "Starter Hosting"
    • Module: cPanel
    • Server Group: Select the group you created
    • Package: Select or create a cPanel hosting package
  4. Configure pricing, billing cycles, and other settings

New client signups can now automatically provision cPanel accounts on your server.

Troubleshooting Common Issues

cPanel installer fails to start

  • Verify your OS is a supported version (AlmaLinux 8/9, Rocky Linux 8/9, Ubuntu 22.04)
  • Ensure no pre-installed web servers exist (Apache, Nginx)
  • Check available disk space with df -h (minimum 20 GB free)
  • Confirm SELinux is disabled

WHM shows a license error

  • Verify your server IP matches the cPanel license IP
  • Run /usr/local/cpanel/cpkeyclt to refresh the license
  • Ensure port 2089 is open for outbound license verification

WHMCS shows a blank page after install

  • Check PHP error logs: tail -f /home/whmcs/logs/error.log
  • Verify ionCube Loader 13.0+ is installed for PHP 8.2+
  • Confirm all required PHP extensions are enabled: PDO, cURL, GD, mbstring, iconv, SimpleXML

WHMCS cron not running

  • Verify the cron path: which php should return the cPanel-managed PHP binary
  • Use the full PHP path in the cron: /usr/local/bin/php -q /home/whmcs/public_html/crons/cron.php
  • Check cPanel cron logs under Cron Jobs > View Log

Why FlashRDP for Hosting Panels

FlashRDP VPS plans are purpose-built for running hosting infrastructure:

  • KVM Virtualization: True hardware isolation ensures consistent performance for cPanel and WHMCS under multi-tenant load
  • NVMe M.2 Storage: Fast I/O for database-heavy operations like WHMCS billing queries and cPanel account creation
  • Unmetered 1 Gbps Bandwidth: Handle client traffic without overage charges
  • DDoS Protection: Always-on Layer 4 mitigation protects your hosting panel and client websites
  • Dedicated Static IPv4: Every VPS includes a static IP for cPanel license binding and DNS configuration
  • Full Root Access: Install cPanel/WHM without restrictions
  • No KYC Required: Deploy with 50+ cryptocurrencies and launch instantly
  • 99.95% Uptime SLA: Reliable infrastructure your clients can depend on

Plans start at $11.99/month. View all VPS plans.

Frequently Asked Questions

What are the minimum server requirements for cPanel and WHMCS?

cPanel requires at least 2 GB RAM (4 GB recommended), 20 GB disk space, and a supported Linux OS like AlmaLinux or Rocky Linux. WHMCS requires PHP 8.2+, ionCube Loader 13.0+, and MySQL 5.7+. For running both on the same server, 4 GB RAM and 40 GB storage is the practical minimum.

Can I install WHMCS without cPanel?

Yes. WHMCS is a standalone billing platform that works with any PHP-capable web server. However, installing it alongside cPanel gives you access to Softaculous for easy setup, automatic PHP management, and native integration for account provisioning.

How much does a cPanel license cost?

cPanel licenses are based on the number of accounts. Solo licenses (for a single site) start at around $15/month. Admin licenses (up to 5 accounts) and Pro licenses (up to 30 accounts) cost more. Visit cpanel.net/pricing for current rates.

Can I run cPanel on Ubuntu?

Yes, cPanel now supports Ubuntu 22.04 LTS. However, AlmaLinux 8/9 and Rocky Linux 8/9 remain the recommended distributions for cPanel/WHM deployments.

How do I automate hosting account creation with WHMCS?

After connecting WHMCS to your WHM server (Step 7), create a product linked to a cPanel hosting package. When a client places an order and payment is confirmed, WHMCS automatically creates the cPanel account, sends login credentials, and manages the entire lifecycle including suspensions and terminations.

Is it safe to run cPanel and WHMCS on the same VPS?

Yes, this is the standard setup for small to mid-sized hosting providers. For higher volumes (100+ active accounts), consider separating WHMCS onto its own VPS for performance isolation. FlashRDP's Linux VPS plans make this affordable.

How do I update WHMCS to a newer version?

Log in to the WHMCS admin panel, navigate to Utilities > Update WHMCS, and follow the on-screen update wizard. Always take a full database backup before upgrading. Review the WHMCS changelog for breaking changes.

What PHP version does WHMCS require?

WHMCS 9.x requires PHP 8.2 as the minimum, with PHP 8.3 recommended. You can manage PHP versions per account in WHM under MultiPHP Manager.

Rohan

Rohan

Operations Manager & Founder

Operations Manager at FlashRDP. With 5+ years in cloud infrastructure, Rohan specializes in KVM virtualization, network security, and building privacy-focused hosting solutions for professionals worldwide.