How to Install cPanel WHM on CentOs 7
Enjoying this content? Subscribe to the Channel!
Mastering Web Hosting: How to Install cPanel & WHM on CentOS 7
Welcome back to Darren’s Tech Tutorials! If you’re serious about web hosting, you know that managing servers manually can be a huge headache. That’s where cPanel comes in.
cPanel is the industry-standard online Linux-based web hosting control panel. It provides a beautiful graphical interface and essential automation tools designed specifically to simplify the process of hosting, managing, and maintaining your websites. When paired with WHM (Web Host Manager), you get total administrative control over your server environment.
In this comprehensive guide, we are going step-by-step through the process of installing cPanel and WHM successfully on a fresh CentOS 7 server. Before we download a single file, we need to ensure our system is configured perfectly for this powerhouse software!
Before You Begin: System Requirements and Preparation
While cPanel is powerful, it does have specific requirements. Ensure your CentOS 7 installation meets the following:
- Hostname: Must be a Fully Qualified Domain Name (FQDN).
- Networking: Static IP address is required.
- Memory: Minimum 1 GB RAM (2 GB recommended).
- Disk Space: Minimum 20 GB (40 GB recommended).
Step 1: Pre-Installation Checks – Disabling Network Manager
One of the most common reasons a cPanel installation fails is due to conflicts with CentOS’s default network management service, NetworkManager. For cPanel to run smoothly, we need to stop and permanently disable this service and ensure the traditional network service is running instead.
Execute the following commands in your server terminal:
A. Stop and Disable Network Manager
systemctl stop NetworkManager
systemctl disable NetworkManager
B. Enable and Start the Network Service
systemctl enable network
systemctl start network
Once disabled, it’s a good idea to reboot your server to ensure the changes take full effect, although it is optional at this stage.
Step 2: Setting the Hostname (FQDN)
cPanel requires that your server has a Fully Qualified Domain Name (FQDN) as its hostname. This is a critical step for proper licensing and operation.
If your hostname is currently set to localhost or is not an FQDN, use the hostnamectl command to fix it. Replace your.domain.com with your actual desired hostname.
hostnamectl set-hostname your.domain.com
You can verify that your hostname has been updated correctly by running:
hostname
The output should display the FQDN you just set.
Step 3: Downloading the Official cPanel Installation Script
With the pre-checks complete, we are ready to download the installation script directly from cPanel’s servers.
For simplicity, navigate to the /home directory before downloading the script:
cd /home
Now, use curl to fetch the installation script and name it latest:
curl -o latest -L https://go.cpanel.net/install
This command downloads the official installation script directly to your /home directory.
Step 4: Executing the cPanel / WHM Installation
We are now ready to unleash the cPanel installer! This single script will handle the entire installation process, including dependency checks, software installation, and initial configuration.
Execute the script using the sh command:
sh latest
Note on Timing: The installation process is substantial and highly dependent on your server’s speed and internet connection. This step will take significant time—often between 20 minutes and an hour. During this period, the script will install hundreds of packages, set up configurations, and compile necessary components. Be patient and do not interrupt the process!
Once the script completes, you will receive a confirmation message stating that the installation is finished, and it will provide the URL necessary to access WHM for the first time.
Step 5: Completing the WHM Initial Setup
The final step is accessing the web interface to complete the initial setup wizard, securing your installation and accepting the licensing terms.
-
Access WHM: Open your web browser and navigate to the following URL, replacing
your.ip.addresswith your server’s public IP address:https://your.ip.address:2087You may receive a browser warning about an insecure connection because cPanel generates a self-signed certificate during installation. Accept the risk and proceed.
-
Login: Log in using your server’s root username and password.
-
Initial Configuration: The WHM setup wizard will guide you through crucial steps, including:
- Agreeing to the cPanel EULA (End User License Agreement).
- Setting up administrative email addresses.
- Configuring nameservers and IP settings.
Once you have stepped through the initial configuration wizard, cPanel and WHM will be fully installed, operational, and ready for you to start hosting!
Conclusion
Congratulations! You have successfully installed cPanel and WHM on your CentOS 7 server, transforming a basic command-line machine into a fully featured web hosting control center. With cPanel and WHM, managing domains, email accounts, databases, and security has never been simpler.
Ready to dive in and create your first hosting account? Give it a try!
If this tutorial helped you master your server setup, please let us know by Liking this post and Subscribing to Darren’s Tech Tutorials for more clear, practical technology guides! Happy hosting!