Use this guide if you did not choose the cPanel template during checkout. We’ll cover a fresh manual installation on supported OSes, required prerequisites (FQDN, static IPv4, SELinux), the official installer command, first-time WHM setup, and common pitfalls.

Firewall note: On LifeinCloud, the Cloud Firewall is disabled by default (all ports open). If you enable it later, remember to allow TCP 80/443, 2087 (WHM), 2083 (cPanel), and typical mail/FTP/SSH ports as needed.

Before You Start

  • Fresh OS (no panel installed): Only install cPanel on a clean OS. Removing cPanel requires a full OS reinstall.
  • Supported OS (choose one):
    • AlmaLinux 8 or 9 (recommended)
    • Rocky Linux 8 or 9
    • CloudLinux 8 or 9 (licensed)
    • Ubuntu 22.04 LTS
    We recommend AlmaLinux/Rocky for most production setups.
  • Static public IPv4 (no dynamic IP). If using NAT, configure proper 1:1 NAT.
  • Hostname (FQDN): e.g. server.example.com — must be a unique FQDN, not used by a cPanel account or a service subdomain like cpanel.example.com.
  • Resources: Minimum ~2 GB RAM recommended, 40 GB+ disk (more for email/databases). SSD/NVMe preferred.
  • License: You can start with a 15-day trial and convert to a paid license later.

Step 1 — Connect to the VPS and Update the OS

SSH to the server as root:

ssh root@YOUR.SERVER.IP

AlmaLinux / Rocky:

dnf -y update

Ubuntu 22.04:

apt update && apt -y upgrade

Set timezone (optional) and a proper FQDN hostname:

timedatectl set-timezone Europe/Bucharest
hostnamectl set-hostname server.example.com
    

Tip: Point an A record for server.example.com to your VPS IP. You can issue SSL for the hostname later in WHM.

Step 2 — SELinux & System Prep (RPM-based OS)

AlmaLinux / Rocky / CloudLinux only: cPanel is not compatible with SELinux. Disable it before installation.

# Check current mode (Enforcing/Permissive/Disabled)
getenforce || sestatus

# Temporarily set to Permissive for this session (if Enforcing)
setenforce 0  # ignore if it errors (already Permissive/Disabled)

# Permanently disable across reboots:
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
# or manually edit /etc/selinux/config and set: SELINUX=disabled

# Reboot if SELinux was changed:
reboot
    

Ubuntu: Do not install SELinux; it’s not supported with cPanel. No action needed here.

Step 3 — (Optional) Add Swap if RAM Is Tight

If your VPS has low RAM, add a small swapfile to reduce out-of-memory risks during install:

fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
    

Step 4 — Run the Official cPanel Installer

Use the vendor-provided installer. It will fetch dependencies (including Perl if missing) and configure services.

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

Notes:

  • Install only on a fresh OS without other control panels or LAMP stacks.
  • Do not close your SSH session until the installer completes.
  • If something fails, check the log: /var/log/cpanel-install.log

Step 5 — First Login to WHM and Initial Setup

  • Open WHM: https://YOUR.SERVER.IP:2087
  • Login with: root and your root password.
  • Complete the setup wizard:
    • Enter a contact email for server alerts.
    • Confirm the hostname (server.example.com) and main resolvers.
    • Set up nameservers (or use external DNS first; you can change later).
    • Agree to terms and finish.
Licensing: New installations are eligible for a 15-day trial. You can convert to a paid license anytime from the cPanel Store or your LifeinCloud client area. If you add a paid license later, refresh it on the server with /usr/local/cpanel/cpkeyclt.

Step 6 — Open Ports (Only If You Later Enable LifeinCloud Firewall)

By default, LifeinCloud Firewall is off, so you can reach WHM/cPanel immediately. If you enable it later, allow:

  • WHM: TCP 2087 (SSL)
  • cPanel: TCP 2083 (SSL)
  • Web: TCP 80, 443
  • Mail (optional): TCP 25, 465, 587, 110, 995, 143, 993
  • FTP (optional): TCP 21
  • SSH: TCP 22 (or your custom port)

For licensing, ensure the server can reach cPanel via DNS (outbound UDP/TCP 53) and inbound 2083/2087 as applicable.

Step 7 — Post-Install Checklist

  1. Secure WHM access: Change root password (if needed), add SSH keys, and restrict SSH password auth.
  2. Hostname SSL: In WHM, issue an SSL for server.example.com so WHM/cPanel/webmail use a trusted certificate.
  3. Packages & Features: Create hosting packages, enable services you need (Apache/PHP-FPM, Mail, DNS).
  4. Backups: Configure automated backups (local + remote). Verify restores.
  5. rDNS (PTR): If sending mail, set the PTR of your server IP to your hostname and add SPF/DKIM/DMARC.
  6. Updates: Keep the OS and cPanel updated (WHM → cPanel Update Preferences).

Troubleshooting

  • Installer failed: Check /var/log/cpanel-install.log. Ensure fresh OS, SELinux disabled (RPM-based), and sufficient RAM/disk.
  • WHM won’t load: Use https://YOUR.SERVER.IP:2087. If you enabled firewall rules, confirm port 2087 is allowed.
  • License issues: Verify a trial/paid license is active for your public IPv4, then run:
    /usr/local/cpanel/cpkeyclt
  • Change hostname later: WHM → Networking SetupChange Hostname (use a valid FQDN).
  • Service errors/logs: cPanel logs live under /usr/local/cpanel/logs/; installer log at /var/log/cpanel-install.log.
Tip: For production, we recommend AlmaLinux/Rocky with a unique FQDN and static IPv4. If you prefer a faster path next time, use the LifeinCloud cPanel template during checkout.
Hai trovato utile questa risposta? 1 Utenti hanno trovato utile questa risposta (1 Voti)