Installing cPanel on CentOS is a crucial step for managing web servers and hosting. cPanel is a popular web hosting control panel that simplifies website, database, email account management, and much more through a user-friendly graphical interface. This guide will walk you through the steps required to install cPanel on a CentOS server.
Prerequisites
Before installing cPanel, ensure that your server meets the following requirements:
- A clean installation of CentOS 7 or CentOS 8. cPanel cannot be installed on a server that already has other software installed.
- Minimum of 1.5 GB RAM, but 2 GB or more is recommended.
- Minimum of 20 GB of free disk space, but more is recommended for production servers.
Step 1: Prepare the System
First, log in to your server via SSH as the root user. Then, update your system to ensure the latest software and security patches are installed:
yum update -y
Step 2: Network Configuration
cPanel requires the server to have a valid Fully Qualified Domain Name (FQDN). You can set the domain name for your server using the following command:
hostnamectl set-hostname your-domain.com
Replace your-domain.com
with your actual domain name.
Step 3: Install cPanel
cPanel provides a script for automated installation, making the entire process easier. To initiate the installation, use the following command:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
This script will download and run the cPanel & WHM installation program.
Step 4: After Installation
After the installation is complete, you can access cPanel and WHM using your web browser. Use port 2083 for cPanel and port 2087 for WHM:
- cPanel: https://your-ip-address:2083
- WHM: https://your-ip-address:2087
You will be prompted to log in. For the initial login, use the username root
and the password of your root user.
Installing cPanel on CentOS is a relatively straightforward process involving system preparation, network configuration, and running the installation script. Once the installation is complete, you can enjoy all the benefits that cPanel offers for managing your web hosting. Remember to regularly update your cPanel and CentOS to ensure the security and stability of your server.