Step-by-step guide for a clean install on AlmaLinux 8/9, Rocky Linux 8/9, or Ubuntu 22.04 LTS. Works on KVM VPS. Estimated time: 20–45 minutes, depending on server specs.
TL;DR (Quick Start)
- Deploy a fresh VPS (no control panel preinstalled) with AlmaLinux 8/9, Rocky 8/9, or Ubuntu 22.04.
- Set a valid hostname (FQDN), update the OS, then run the installer:
cd /home curl -o latest -L https://securedownloads.cpanel.net/latest sh latest
- Open
https://YOUR.SERVER.IP:2087
, finish the WHM wizard, add nameservers, create your first account.
1) Before You Begin
- Supported OS: AlmaLinux 8/9, Rocky Linux 8/9, CloudLinux 8/9, or Ubuntu 22.04 LTS (fresh, minimal install).
- Minimum resources: 2 GB RAM (4 GB+ recommended), 1–2 vCPU (2–4 vCPU recommended), 40 GB disk (80 GB+ recommended for production).
- Access: Root SSH to your VPS (KVM). Public IPv4 assigned and reachable.
- Licensing: cPanel requires a license. You can start with a trial, then apply a paid license to your server IP.
- Clean system: Do not preinstall Apache/Nginx/MySQL/Postfix etc. The installer will handle required services.
- Firewall: Ensure outbound HTTP/HTTPS is allowed; you can configure an inbound firewall after installation.
Tip: For best results on LumaDock, pick a plan with at least 2 vCPU / 4 GB RAM / 80 GB NVMe if you’ll host multiple sites or mail.
2) Set a Proper Hostname (FQDN)
Use a fully-qualified domain name that resolves to your server IP, e.g. server1.example.com
.
# Example (AlmaLinux/Rocky/Ubuntu):
hostnamectl set-hostname server1.example.com
# Verify
hostnamectl status
hostname -f
Important: Avoid using your root domain (e.g., example.com
) as the hostname. Use a subdomain instead.
3) Update the System
Apply the latest updates and reboot if the kernel was upgraded.
# AlmaLinux / Rocky
dnf -y update
reboot
# Ubuntu 22.04
apt update && apt -y full-upgrade
reboot
4) Prepare Basic Packages
Install required tools. Perl and curl are needed for the installer.
# AlmaLinux / Rocky
dnf -y install perl curl tar
# Ubuntu 22.04
apt -y install perl curl tar
Optional: Install screen
or tmux
so the installer continues even if your SSH session disconnects.
5) Run the cPanel Installer
Run the official installer. This will download and install all dependencies automatically.
cd /home
curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest
- The process may take 15–45 minutes depending on resources.
- Do not interrupt the installer. If using
screen
ortmux
, detach and reattach as needed.
6) Access WHM (Initial Setup Wizard)
After installation, access the WHM interface:
https://YOUR.SERVER.IP:2087
- Log in as root with your root password.
- Accept the license agreement and confirm your contact email.
- Configure DNS resolvers (use your datacenter or public resolvers like 1.1.1.1 / 8.8.8.8).
- Set up nameservers (e.g.,
ns1.example.com
,ns2.example.com
) and add A records for them. - Choose default services (Apache/PHP, Dovecot, Exim, etc.). The defaults are fine to start.
Tip: You can enable AutoSSL in WHM → SSL/TLS → Manage AutoSSL (cPanel includes Sectigo; Let’s Encrypt provider can be enabled as an option).
7) Open Required Firewall Ports
If you configure a software firewall (e.g., firewalld or CSF), allow these commonly used ports:
Service | Port/Proto | Notes |
---|---|---|
SSH | 22/tcp | Change if desired |
HTTP/HTTPS | 80/tcp, 443/tcp | Web traffic & AutoSSL |
WHM (SSL) | 2087/tcp | Admin panel |
cPanel (SSL) | 2083/tcp | User panel |
Webmail (SSL) | 2096/tcp | Roundcube, etc. |
Mail (SMTP) | 25/tcp, 465/tcp, 587/tcp | Outbound may be restricted by some providers |
Mail (POP3/IMAP) | 110/995 tcp, 143/993 tcp | POP3/IMAP (SSL/Non-SSL) |
FTP | 20-21/tcp | Passive range configurable in WHM |
DNS | 53/tcp+udp | If hosting your own nameservers |
MySQL | 3306/tcp | Only if remote access needed |
Note: LumaDock provides network-level DDoS protection. You can still use CSF (ConfigServer Security & Firewall) for host-level controls.
8) Create Your First Hosting Account
- In WHM, go to Packages → Add a Package (define limits and features).
- Go to Account Functions → Create a New Account.
- Enter a domain, username, and password, select your package, and create the account.
- Log in to cPanel at
https://YOUR.SERVER.IP:2083
using the new account credentials.
Tip: Point your domain’s DNS to your server (via your registrar or your own nameservers) so websites and mail resolve correctly.
9) Recommended Post-Install Tasks
- AutoSSL: Enable/verify AutoSSL and run an issuance check for hosted domains.
- PHP Versions/Handlers: Use EasyApache 4 to select PHP versions and extensions per account.
- Backups: Configure WHM → Backup Configuration. Store to a remote destination (S3, another VPS, etc.).
- Mail Deliverability: Set proper rDNS (PTR) on your server IP, SPF/DKIM/DMARC for sending domains.
- Security: Enable cPHulk, consider CSF, keep the system updated (
dnf update
/apt upgrade
). - Performance: Consider installing OPcache, adjusting PHP-FPM, enabling HTTP/2 (default) and Brotli (optional).
10) Troubleshooting
Installer fails or stops
- Ensure you’re on a supported OS and a fresh install without other web stacks.
- Check disk space and RAM; add swap if RAM is limited.
- Re-run from a clean shell session (
screen
ortmux
helps).
Hostname warnings
- Set a valid FQDN (e.g.,
server1.example.com
) and ensure it resolves to your server IP. - Update in WHM → Networking Setup → Change Hostname if needed.
Ports blocked
- Open required ports in your software firewall (firewalld/CSF) and any external firewall in front of the VPS.
Mail delivery issues
- Set PTR (rDNS) for your server IP, and correct SPF/DKIM/DMARC records.
- Some providers restrict outbound SMTP (25). Use ports 465/587 or a relay (e.g., MailChannels, SES) if needed.
License problems
- Ensure the public IP in WHM matches your licensed IP. Rebuild license from WHM or via cPanel store if required.
FAQ
Q: Can I install cPanel on an existing server with Apache/MySQL already installed?
A: It’s strongly recommended to start with a fresh OS image. The installer expects to provision and configure its own stack.
Q: Which OS should I choose?
A: We recommend AlmaLinux 8/9 or Rocky Linux 8/9 for stability and long-term support. Ubuntu 22.04 is also supported.
Q: Can I change my server’s IP after installing?
A: Possible, but not ideal. Update license and network/DNS records accordingly if you must change it.