How to Install & Configure cPanel/WHM on a New Dedicated Server

Install cPanel WHM Dedicated Server
cPanel / WHM Systems Engineering ✓ Updated for current cPanel/WHM requirements

How to Install & Configure cPanel/WHM on a Dedicated Server

Learn how to install cPanel/WHM on a dedicated server and turn a clean Linux installation into a manageable hosting platform. This step-by-step guide covers pre-install checks, the cPanel installer, WHM setup, performance tuning, backups, and security hardening. Examples use supported AlmaLinux releases; always confirm the exact operating-system and cPanel-version combination in the official requirements before you begin.

OS
Written & Verified by OnLive Server Systems Engineering Team
Specialization: Linux Kernel Hardening, High-Concurrency MySQL & cPanel Cluster Architecture
📌 Technical guide for dedicated-server administrators

Installing cPanel on bare metal requires careful planning. Start with a clean, supported operating system, a resolvable hostname, enough memory and disk space, and a documented firewall plan. Then configure EasyApache 4, choose a database version that your cPanel release supports, create backups, and apply security controls before production traffic arrives.

While lightweight workloads can run on budget VPS hosting server solutions, agencies, SaaS platforms, and high-traffic sites may benefit from dedicated hardware when they need predictable CPU, memory, storage, and network resources. Below is a practical deployment blueprint.

Before you start, review cPanel’s official system requirements and confirm that your hosting provider can provide console access, a licensed server IP, reverse DNS, and a supported 64-bit operating system.

1. Core Pillars of Enterprise cPanel Deployment

A resilient cPanel server deployment follows five practical phases:

⚙️
1. Pre-Flight Hygiene
Clean supported OS image, hostname and DNS checks, firewall plan, SELinux compatibility, and optional swap.
🚀
2. Screen Execution
Deploying via persistent GNU Screen session with official cPanel installation binaries and real-time log monitoring.
🛡️
3. Web Stack & Hardening
EasyApache 4 and PHP-FPM configuration, workload-based database tuning, backups, and firewall hardening.

2. Phase 1: Pre-Flight Environment & Network Configuration

Before launching the cPanel installer, complete these pre-flight checks on a fresh server. The exact service requirements differ by operating system, so confirm each command against cPanel’s current documentation. Learn more about hardware standards in our guide to bare metal NVMe storage hosting.

Phase 1: Terminal Pre-Flight Commands AlmaLinux 8 / 9 Root Shell
# 1. Update system packages & set static FQDN Hostname
dnf update -y
hostnamectl set-hostname server1.yourdomain.com

# 2. Temporarily disable the OS firewall during installation
# Save your existing rules first if you manage them manually.
systemctl stop firewalld.service
systemctl disable firewalld.service

# AlmaLinux 8 only: disable NetworkManager if cPanel requires it.
# Do not disable NetworkManager on AlmaLinux 9 or later.
# systemctl stop NetworkManager
# systemctl disable NetworkManager

# 3. Disable SELinux to prevent installer permission locks
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

# 4. Optional: allocate swap for build stability on smaller servers
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile swap swap defaults 0 0' >> /etc/fstab

# 5. Install Perl, Wget, Curl, and GNU Screen
dnf install perl curl wget screen tar -y

3. Phase 2: Executing the cPanel Installer via GNU Screen

Because installation can take 15 to 30 minutes, run the installer inside a detached GNU Screen session. This prevents a dropped SSH connection from interrupting the process. Review our tutorial on connecting to remote servers via SSH key authentication.

Phase 2: cPanel Execution Binary Bash Installer
# Launch screen session named cpanel_install
screen -S cpanel_install

# Fetch and execute latest installation binary
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest

# Detach without stopping the installer: press Ctrl-A, then D

# (Optional) Tail logs in real time from a second SSH terminal window
tail -f /var/log/cpanel-install.log

4. Phase 3: Initial WHM Setup Wizard (Port 2087)

Once installation finishes, open WHM and complete the initial configuration before creating customer accounts:

  • Access WHM securely: Open https://YOUR_SERVER_IP:2087 and sign in as root. Use a strong credential or SSH key and restrict root access after the first setup.
  • Complete licensing: WHM verifies the server IP with cPanel’s licensing service. Confirm that the license is active before continuing.
  • Set the hostname and resolvers: Use a fully qualified hostname and reliable recursive DNS resolvers. Verify that forward and reverse DNS resolve correctly.
  • Configure nameservers: Create glue records such as ns1.yourdomain.com and ns2.yourdomain.com, then assign them to the correct server IP addresses.

5. Phase 4: EasyApache 4 & Production MySQL 8.0 Tuning

Do not copy a database configuration blindly. Use WHM’s database configuration tools, measure memory usage, and size MySQL or MariaDB settings for your workload. The following is an example starting point for a dedicated database server; replace the placeholder values after testing.

/etc/my.cnf – MySQL 8.0 InnoDB Production Optimization MySQL Config File
[mysqld]
# Example only: size the buffer pool after measuring available RAM
innodb_buffer_pool_size = 8G
# Use the redo-log setting supported by your MySQL version
innodb_redo_log_capacity = 2G
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT

# Connection and table-cache values must match the workload
max_connections = 200
key_buffer_size = 128M
max_allowed_packet = 256M
open_files_limit = 65535
table_open_cache = 10000

# Slow Query Logger
slow_query_log = 1
slow_query_log_file = /var/lib/mysql/slow-queries.log
long_query_time = 2

6. Phase 5: Mission-Critical Dedicated Server Hardening

Harden the server after the cPanel installation by enabling SSH protection, ModSecurity rules, regular backups, and a firewall that matches your operating system. If you choose ConfigServer Security & Firewall (CSF), use the package and instructions maintained for your cPanel release. Do not run CSF alongside a conflicting firewall manager.

CSF Firewall Installation & SSH Hardening Security Automation Shell
# Use cPanel's supported CSF package when available
yum install cpanel-csf -y

# Review the generated rules and allow your SSH, WHM, cPanel,
# mail, DNS, and application ports before enabling production mode.
csf -l

# Enable production mode only after testing from a second session
sed -i 's/TESTING = "1"/TESTING = "0"/g' /etc/csf/csf.conf
csf -r

7. Common Sysadmin Installation Errors & Quick Shell Fixes

⚠️ Error 1: “cPanel installation failed: NetworkManager is active”
Fix: Check cPanel’s operating-system requirements first. NetworkManager is handled differently by each supported OS; it is not normally necessary to disable it on AlmaLinux 9 or later.
⚠️ Error 2: “FATAL: Hostname does not resolve to an IP address”
Fix: Add your server IPv4 and FQDN in /etc/hosts: echo "YOUR_SERVER_IP server1.yourdomain.com" >> /etc/hosts.
⚠️ Error 3: “RPM or package-manager lock”
Fix: Check whether another dnf or yum process is still running. Let it finish, then retry. Do not delete lock files while a package transaction is active.

8. Deployment Roadmap & Verification Matrix

Phase Shell Tools Duration Verification Criteria
1. Pre-Flight hostnamectl, fallocate swap 5 Mins FQDN resolves & 4GB Swap Active
2. Installer screen -S cpanel, sh latest 20 Mins Zero build errors in logs
3. DB Tuning my.cnf innodb_buffer_pool 5 Mins InnoDB buffer allocated in RAM
4. Security csf, mod_security, cpHulk 15 Mins Passes WHM Security Advisor Audit

📌 Frequently Asked Questions (FAQ)

Can I install cPanel on Ubuntu 24.04 LTS? +
Yes. Current cPanel documentation lists Ubuntu 24.04 LTS as a supported installation option. AlmaLinux 8, 9, and 10 are also supported by specific cPanel versions. Always check the version-specific requirements before you provision a new server.
How do I check if my cPanel license is active on my dedicated server IP? +
You can verify your licensing status anytime by visiting the official cPanel verification portal (verify.cpanel.net) and entering your server’s public IPv4 address, or via SSH by running /usr/local/cpanel/cpkeyclt.
Does OnLive Server offer pre-installed and licensed cPanel dedicated servers? +
Yes. OnLive Server provides fully automated 1-click provisioning of dedicated bare-metal servers with pre-installed cPanel/WHM, genuine commercial licenses, optimized EasyApache 4 stacks, and 24/7 technical management. Explore all our hosting solutions in our overview of essential hosting services and features.

10. Conclusion: Run a Secure cPanel/WHM Dedicated Server

When you install cPanel/WHM on a dedicated server, you get a central place to manage websites, domains, email, DNS, databases, and backups. Use a supported operating system, test every performance change, and keep your firewall, software, and backup policies documented before the server goes live.

Need help deploying a managed cPanel server? Explore OnLive Server dedicated hosting or contact the support team to confirm the operating system, licensing, DNS, and security requirements for your workload.