cPanel

How to Install cPanel WHM on CentOS 7

cPanel & WHM is the most popular and most widely used Linux based web hosting control panel that offers graphical user interface to manage and host multiple websites on a single server. WHM is also known as a WebHost Manager provides an administrator and reseller level access to manage server administration and account management related settings. cPanel provides a user level access to manage their websites.  The latest cPanel & WHM  provide support for  CentOS, Red Hat Enterprise Linux, and CloudLinux OS operating systems. cPanel / WHM is a commercial software application that requires a license to work.

In this tutorial, we will learn how to install cPanel / WHM on CentOS 7 server.

Requirements

  • A fresh installation of CentOS 7 (Minimal) server.
  • Minimum 2 GB of RAM and 20 GB of free disk space.
  • A static IP address is configured on your server.

Getting Started

Before starting, it is recommended to update your server with the latest version. You can update the server with the following command:

yum update -y

Next, you will need to set a hostname for the server. The hostname must be a fully qualified domain name. You can set the hostname of your server with the following command:

hostnamectl set-hostname test.example.com

Next, you will also need to disable SELinux on your server. You can disable it by editing the following file:

nano /etc/selinux/config

Change the following lines:

SELINUX=disabled
SELINUXTYPE=targeted

Save and close the file. Then, restart your system to apply these changes.

After rebooting the system, check the SELinux with the following command:

sestatus

You should see that SELinux is disabled in the following output:

SELinux status:    disabled

Install cPanel

cPanel provides an automated installation script to install cPanel with all necessary components. You can download and install cPanel by just running the following command:

curl -o latest -L http://httpupdate.cpanel.net/latest && sh latest

The above script will take around 20-60 minutes to complete the installation. Once the installation has been completed successfully, you should see the following output:

2019-07-07 01:36:44 1392 ( INFO): Congratulations! Your installation of cPanel &
WHM 11.80 is now complete. The next step is to configure your server.
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): Before you configure your server, ensure that your
firewall allows access on port 2087.
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): After ensuring that your firewall allows access
on port 2087, you can configure your server.
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): 1. Open your preferred browser
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): 2. Navigate to the following url using the address
bar and enter this one-time autologin url:
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): https://139.5.237.169:2087/cpsess3438670747/login/
session=root%3aEFcxHbIjILlL14m2%3acreate_user_session%2c8846f458c886541e2ffd7ebc11683ac1
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): After the login url expires you generate a new one
using the 'whmlogin' command or manually login at:
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): https://139.5.237.169:2087
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): Visit https://go.cpanel.net/whminit for more
information about first-time configuration of your server.
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): Visit http://support.cpanel.net or
https://go.cpanel.net/allfaq for additional support
2019-07-07 01:36:44 1392 ( INFO):
2019-07-07 01:36:44 1392 ( INFO): Thank you for installing cPanel & WHM 11.80!
Removing /root/installer.lock.

cPanel provides a 15 days trial license. So, you will need to activate it first. You can activate the trial license with the following command:

/usr/local/cpanel/cpkeyclt

You should see the following output:

Updating cPanel license...Done. Update succeeded.
Building global cache for cpanel...Done

Access WHM / cPanel Web Interface

WHM / cPanel is now installed and running on port 2087.

Next, open your web browser and type the URL https://your-server-ip:2087. You will be redirected to the WHM / cPanel login screen as shown in the following page:

Provide your root username and password. Then, click on the Log In button. You should see the WHM / cPanel license agreement in the following page:

Now, click on the Agree to All. You should see the following page:

Now, provide your email address and nameserver details then click on the Finish button. You should see the WHM / cPanel dashboard in the following page:

Next, you will need to enable the FileSystem quotas. To enable it, click on the “Click to enable” top right button. You should see the following page:

Next, click on the Proceed button. Once the FileSystem quota is enabled, you should see the following page:

Next, reboot the server to enable filesystem quotas.

Create Your First cPanel Account

On the WHM / cPanel Dashboard, click on the Home button. You should see the following page:

Now, click on the “Create a New Account” button. You should see the following page:

Now, provide all the required information like, domain, username, password, email, Theme, Enable Apache Spam, Enable DKIM and SPF, Select Mail routing, then click on the Create button. Once the account has been created successfully, you should see the following page:

Now, click on the “Go to cPanel“. You will be redirected to the new cPanel account dashboard as shown in the following page:

You can now create and manage websites, FTP, email, database using the cPanel dashboard.

About the author

Hitesh Jethva

Hitesh Jethva

I am Hitesh Jethva lives in Ahmedabad, INDIA. I am Linux system administrator and Technical writer.

I felt in love with Linux while i was started to learn Linux. I am a fan of open source technology and have more than 8+ years of experience in Linux and Open Source technologies. My main motto is to make uncomplicated things easier.

I have extensive experience within the following areas: CentOS/RHEL/FreeBSD/Ubuntu/Debian, cPanel/WHM, High Availability Architecture, Proactive security/Web Application Security, Amazon Web Services (AWS), Apache/Nginx, OpenLDAP, DevOps automation: Chef/Docker.

My expertise includes Linux system administration, installation, configuration, tuning, security and troubleshooting. I have large skills in configuring/management/support of Apache, Nginx, MariaDB, MongoDB, PHP-FPM, Nagios, Zabbix, Graylg, Redis, Docker and much more.