Installing cPanel: A Comprehensive Guide

Installing cPanel on your server is a straightforward process, but it requires careful execution of each step to ensure a smooth setup. Follow this detailed guide to install cPanel effectively and efficiently.

cPanel System Requirements

Before starting, ensure your server meets the following requirements:

  1. Operating System

    • CentOS: 7.x or 8.x
    • CloudLinux: 7.x or 8.x
    • AlmaLinux: 8.x
    • Rocky Linux: 8.x
    • Note: cPanel does not support other operating systems such as Ubuntu or Debian.
  2. Hardware Requirements

    • CPU: Minimum of 1 GHz processor (2 GHz or higher recommended for optimal performance)
    • RAM: Minimum of 2 GB (4 GB or more recommended, depending on the number of accounts and services)
    • Disk Space: Minimum of 20 GB of free disk space (more may be required based on the number of accounts and services)
  3. Network Requirements

    • Static IP Address: At least one static IP address is required. Additional IP addresses may be needed for additional services or to handle more accounts.
    • Hostname: A fully qualified domain name (FQDN) should be set up and resolvable via DNS.
  4. Software Requirements

    • Perl: Perl 5.10 or higher is required.
    • Python: Python 2.7 or higher is recommended for some cPanel features.
    • Apache: Apache 2.4 is recommended, though cPanel will install and configure its own version.
    • MySQL/MariaDB: Version 10.6 or higher for MariaDB or version 8.0 or higher for MySQL, depending on your configuration settings.
  5. Additional Considerations

    • Firewall Configuration: Ensure that the firewall allows traffic on ports required by cPanel (e.g., ports 2083, 2087, 80, 443).
    • SELinux: Should be set to permissive mode during installation.

Pre-Installation Checks

  1. Update the System: Ensure your server's operating system and packages are up to date.
  2. Clean Installation: It’s recommended to start with a clean installation of your chosen operating system.
  3. Disable Other Web Servers: If you have other web servers installed (e.g., Nginx), they should be stopped and disabled.

Prerequisites

Before starting, ensure you have:

  • A fresh installation of CentOS, CloudLinux, or AlmaLinux.
  • Root access to the server.
  • A registered domain name with proper DNS setup.

Installation Steps

Step 1: Change the Hostname

The hostname should be configured before installing cPanel. Use the following commands to set your desired hostname:

hostnamectl set-hostname sub.domain.tld
hostname sub.domain.tld

Replace sub.domain.tld with your actual hostname.

Step 2: Enable Custom SQL Server Installation

cPanel allows you to specify the version of the SQL server. Follow these steps to configure it:

  1. Create a configuration directory:

 
mkdir /root/cpanel_profile

    2. Specify the SQL server version by creating a configuration file. For MariaDB, use version 10.6, and for MySQL, use version 8.0:

echo "mysql-version=10.6" > /root/cpanel_profile/cpanel.config

Step 3: Disable the Network Service Temporarily

To ensure the installation process is not interrupted by network issues, disable the network service:

systemctl disable network
systemctl stop network

Step 4: Verify Network Service Status

Confirm that the network service has been successfully disabled:

systemctl status network

Step 5: Start the cPanel Installation

Begin the installation process by downloading the cPanel installer script and executing it. This process may take between 3 to 10 minutes:


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

Step 6: Re-enable the Network Service

Once cPanel installation is complete, re-enable the network service:

systemctl enable network
systemctl start network

Step 7: Verify Network Service Status

Ensure that the network service is active and running:

systemctl status network

Post-Installation Steps

  1. Access cPanel: After installation, you can access the cPanel/WHM interface by navigating to https://your-server-ip:2087 in your web browser.

  2. Initial Setup: Follow the on-screen instructions to complete the initial setup and configuration of cPanel.

  3. Secure Your Server: Make sure to secure your server by configuring firewalls and other security measures.

Conclusion

Congratulations! You have successfully installed cPanel on your server. For further assistance and to explore advanced features, refer to the official cPanel documentation.

For more tutorials and guides, visit FizHost.

 
 
 
 
 
 
 
 
 
Was this answer helpful? 1869 Users Found This Useful (1872 Votes)