cPanel is a powerful and user-friendly control panel used to configure cPanel manage web servers and host websites. Widely adopted by web hosting companies and individuals, it simplifies tasks like managing web files, MySQL databases, DNS settings, and email accounts—all through an intuitive web interface. Typically paired with Web Host Manager (WHM), cPanel also enables server-wide administration and user account management.

cPanel simplifies many complex tasks for both administrators and users. It’s often chosen for its reliability, ease of use, and wide adoption in the hosting industry.
This guide will walk you through the installation, how to configure cPanel, and manage it effectively on a Linux server.
Prerequisites
Before you begin the cPanel installation, make sure that your server meets the following prerequisites:
- A fresh installation of Linux (CentOS, CloudLinux, or RHEL is recommended)
- Root or sudo privileges to install software and configure the system.
- A valid cPanel license.
- Access to the server via terminal or SSH.
- At least 1 GB of RAM (2 GB or more recommended), 20 GB of free disk space, and a 1+ GHz CPU.
Preparing the Server for cPanel Installation
System Requirements
Ensure that your server meets the minimum requirements for installing cPanel:
- RAM: Minimum of 1 GB (2 GB or more recommended).
- CPU: 1 GHz or faster.
- Disk Space: At least 20 GB of free space.
Supported distributions for cPanel are primarily CentOS, CloudLinux, and RHEL.
Updating System Packages
Before you install cPanel, ensure your server is up to date with the latest system packages. This reduces the chance of installation errors and ensures compatibility with newer software packages. Run the following command:
sudo yum update -y
Disabling SELinux (if applicable)
cPanel recommends disabling SELinux for compatibility. To do this temporarily or permanently, run:
sudo setenforce 0
Then, disable SELinux permanently by editing the SELinux configuration file:
sudo nano /etc/selinux/config
# Change SELINUX=enforcing to SELINUX=disabled
Install cPanel
Let’s install cPanel step by step, below:
Downloading and Installing cPanel
The installation process for cPanel is straightforward. Use the official installation script to download and install the software:
curl -o latest -L https://securedownloads.cpanel.net/latest
sudo sh latest
The installation process may take anywhere from 30 minutes to an hour, depending on the server’s resources and internet connection speed.
Verifying Installation
Once the installation is complete, you can verify that cPanel is running by checking the status of the service:
sudo systemctl status cpanel
This command will confirm whether the cPanel service is up and running on the server.
Configure cPanel
Accessing WHM (Web Host Manager)
After installing cPanel, access the Web Host Manager (WHM) interface, which is the admin dashboard for configuring and managing server-wide settings. You can access WHM through your web browser by navigating to:
https://<server_ip>:2087
Log in using the root username and password of your server.
Running the Setup Wizard
When you log in to WHM for the first time, the Setup Wizard will guide you through the basic configuration of your cPanel installation. The wizard includes steps such as:
- Setting the server’s hostname.
- Configuring the primary IP address.
- Enter your cPanel license details.
- Setting up basic server configurations, such as nameservers and contact information.
Configuring cPanel for Web Hosting
Configuring cPanel is a crucial step in establishing a reliable web hosting environment. This section covers the essentials to get your hosting services up and running smoothly.
Setting Up Nameservers
Once the basic setup is complete, configure nameservers to ensure your server can resolve domain names. You’ll typically configure at least two nameservers, such as:
ns1.example.com
(Primary Nameserver)ns2.example.com
(Secondary Nameserver)
These nameservers can be configured within the WHM panel under the DNS settings.
Configuring Server Settings
You can configure a variety of server settings in WHM:
- Apache: Adjust settings such as keep-alive configurations and manage virtual hosts.
- Nginx: If you use Nginx, configure its settings for reverse proxy or as a web server.
- PHP: Choose the PHP version for your server and configure PHP modules based on hosting requirements.
These configurations are available in the Service Configuration section of WHM.
Setting Up Email Configuration
Email configuration in cPanel is handled by Exim, the mail transfer agent. In WHM, you can set up the default mail routing options and enable email security features like SPF, DKIM, and DMARC to protect against spoofing and phishing attempts.
Managing Hosting Accounts in cPanel
Creating New Accounts
To host websites for users, you need to create new cPanel accounts. This can be done easily via WHM by specifying the domain name, username, password, and selecting a package. Packages determine the resource allocation (disk space, bandwidth, etc.) for each account.
Configuring cPanel Features for Users
After creating an account, you can customize the available features for each user. WHM allows you to enable or disable features like:
- File Manager: Manage web files.
- MySQL Databases: Create and manage databases.
- Email Accounts: Create and manage email addresses.
- Security Features: Enable or disable features such as SSL certificates and password protection.
These features help streamline the management of cPanel accounts, providing a tailored experience for each user.
Managing SSL Certificates
cPanel allows users to manage SSL certificates for their domains. You can install AutoSSL, which automatically issues free SSL certificates for your hosted domains. Additionally, you can manually install third-party SSL certificates for added security.
Securing the cPanel Server
Securing your cPanel server is crucial to protect against unauthorized access and threats. This section covers essential security measures like enabling a firewall, setting up two-factor authentication, and configuring built-in WHM security tools.
Enabling the cPanel Firewall (CSF)
For advanced security, install and configure ConfigServer Security & Firewall (CSF). CSF is a powerful firewall plugin that integrates with cPanel/WHM. To install CSF:
sudo yum install csf
sudo sh /etc/csf/install.sh
After installation, configure firewall rules and set up brute force protection to secure your server.
Enabling Two-Factor Authentication (2FA)
Two-factor authentication (2FA) can significantly improve security by requiring a second verification step during login. In WHM, enable 2FA to require users to authenticate using apps like Google Authenticator or Authy.
Managing cPanel Security Settings
In addition to firewalls and 2FA, WHM offers additional security features:
- Brute Force Protection: Block IPs after multiple failed login attempts.
- cPHulk: Protect against brute-force login attempts for both WHM and cPanel.
Monitoring and Maintaining the Server
Monitoring Server Resources: WHM provides a variety of tools to monitor the server’s health and performance. You can track system resources such as CPU usage, RAM, disk space, and network activity. WHM also allows you to set up alerts to notify you if certain thresholds are exceeded.
Server Logs and Troubleshooting: For troubleshooting, WHM gives access to system logs, Apache logs, email logs, and more. These logs can help diagnose issues and track down the cause of server problems.
Conclusion
By following this guide, you have successfully installed and configured cPanel on your Linux server. You’ve learned how to configure the server for web hosting, secure the environment, manage backups, and monitor system resources. Regular updates and maintenance will help ensure your server remains secure and performs optimally. Whether you’re hosting a few websites or running a full web hosting business, cPanel provides the tools necessary to manage your server with ease.