Installing cPanel on a Linux server is a straightforward process if your server meets the necessary requirements. Here's a detailed guide for supported operating systems like CentOS, AlmaLinux, and CloudLinux.
Prerequisites
- Supported OS: Ensure your server runs a supported operating system:
- CentOS 7 or 8 (deprecated but still functional)
- AlmaLinux 8 or 9
- CloudLinux 8 or 9
- Server Requirements:
- Minimum 1 GB RAM (2 GB recommended).
- At least 20 GB disk space (more for production use).
- Root access to the server.
- Fresh Installation: cPanel requires a clean server without pre-installed software like Apache, MySQL, or PHP to avoid conflicts.
Step 1: Update the System
- Log in to your server as root or a user with sudo privileges.
- Update the system:
yum update -y
Step 2: Set the Hostname
Set a fully qualified domain name (FQDN) as the hostname:
hostnamectl set-hostname server.example.com
Replace server.example.com with your desired hostname.
Step 3: Disable SELinux
Disable SELinux to avoid conflicts during installation:
- Check SELinux status:
sestatus - If it's enabled, disable it temporarily:
setenforce 0 - To disable it permanently, edit the configuration file:
Changenano /etc/selinux/configSELINUX=enforcingtoSELINUX=disabled.
Step 4: Install cPanel
- Navigate to the home directory:
cd /home - Download the cPanel installation script:
curl -o latest -L https://securedownloads.cpanel.net/latest - Run the script to install cPanel:
sh latest - The installation process will take 30–60 minutes, depending on your server resources.
Step 5: Access WHM (Web Host Manager)
-
After installation, WHM (the admin interface for cPanel) will be accessible via:
https://your-server-ip:2087Replace
your-server-ipwith your server's IP address. -
Log in using:
- Username:
root - Password: Your root password.
- Username:
Step 6: Configure cPanel/WHM
- On your first login, you'll be prompted to activate your cPanel license. You can purchase a license or use a trial license.
- Follow the setup wizard to configure:
- Networking
- Nameservers
- Security settings
Optional Step: Install Additional Features
- Add DNS cluster configurations.
- Set up email, FTP, and database services for hosting accounts.
Important Notes
- cPanel is a paid product, so you'll need a valid license to use it beyond the trial period.
- Always secure your server by enabling a firewall, setting up SSH key authentication, and using a strong root password.
Let me know if you encounter any issues during installation!