How to Install cPanel & WHM in CentOS 6

cPanel is one of the most popular commercial control panel for Linux web hosting, I have been working with cPanel for last 3+ years to manage all Shared, Reseller and business hosting customers.

It comes with cPanel and Web Host Manager, which makes web hosting easier for you. WHM provides you root level access to your server whereas cPanel provides user level access interface to manage their own web hosting account on the server.

Features of cPanel

cPanel control panel is very versatile control panel for managing your hosting servers, It has lots of features which make Web hosting easier for you. Some of them are listed below:

  • Powerful GUI controls on your server with WHM.
  • Can perform tedious tasks like Backups, Migrations and restorations in a very easy and smooth manner.
  • Excellent DNS and mail server management for main server and as well as client account.
  • Can easily switch/enable/disable services for server.
  • Can configure SSL/TLS for all server services and client domains.
  • Easy integration with Phpmyadmin to provide a web based interface to manage your MySQL databases.
  • Feel free to Rebrand it.
  • Can be easily integrated with WHMCS to automate billing management.

Here In this article, We’ll be covering cPanel & WHM installation on CentOS/RHEL 6.5 and share some more useful information which will help you to manage cPanel & WHM.

Installation Prerequisites

  1. A fresh and minimal installation of CentOS 6.5 server.
  2. A minimum of 1 GB.
  3. A Minimum of 20GB free disk space required for cPanel installation.
  4. A cPanel license.

Installation of cPanel in CentOS and RHEL 6

First insure that OS version on which your Linux box is running, to do so, please use following command.

# cat /etc/redhat-release

CentOS release 6.4 (Final)

If you don’t have the latest version, please update your OS to its latest version, In CentOS and RHEL, we can simply do it with yum package installer.

# yum update

Once updates completes, and then check the latest OS version with same above command.

# cat /etc/redhat-release

CentOS release 6.5 (Final)

Next, ensure that your system has a standard hostname, otherwise set it as follows.

# hostname cpanel.tecmint.lan

Once you’ve ensured the OS version and hostname, you don’t have to install any other dependency packagees, cPanel auto installer script does all for you. We can download cPanel installer file under /home directory.

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

This above command changes your session to the home directory, downloads the most recent version of cPanel & WHM, and runs the installation script.

Important: I strongly recommended to run cPanel auto installer script in screen mode if you are doing it with SSH because it takes 30-40 minutes to complete the installation depending on your server resources and bandwidth speed.

Sample Output
Verifying archive integrity... All good.
Uncompressing cPanel & WHM Installer.....
        ____                  _
    ___|  _ \ __ _ _ __   ___| |
   / __| |_) / _` | '_ \ / _ \ |
  | (__|  __/ (_| | | | |  __/ |
   \___|_|   \__,_|_| |_|\___|_|
  
  Installer Version v00061 r019cb5809ce1f2644bbf195d18f15f513a4f5263

Beginning main installation.
2017-03-04 04:52:33  720 ( INFO): cPanel & WHM installation started at: Sat Mar  4 04:52:33 2017!
2017-03-04 04:52:33  721 ( INFO): This installation will require 20-50 minutes, depending on your hardware.
2017-03-04 04:52:33  722 ( INFO): Now is the time to go get another cup of coffee/jolt.
2017-03-04 04:52:33  723 ( INFO): The install will log to the /var/log/cpanel-install.log file.
2017-03-04 04:52:33  724 ( INFO): 
2017-03-04 04:52:33  725 ( INFO): Beginning Installation v3...
2017-03-04 04:52:33  428 ( INFO): CentOS 6 (Linux) detected!
2017-03-04 04:52:33  444 ( INFO): Checking RAM now...
2017-03-04 04:52:33  233 ( WARN): 
2017-03-04 04:52:33  233 ( WARN): To take full advantage of all of cPanel & WHM's features,
2017-03-04 04:52:33  233 ( WARN): such as multiple SSL certificates on a single IPv4 Address
2017-03-04 04:52:33  233 ( WARN): and significantly improved performance and startup times,
2017-03-04 04:52:33  233 ( WARN): we highly recommend that you use CentOS version 7.
2017-03-04 04:52:33  233 ( WARN): 
2017-03-04 04:52:33  233 ( WARN): Installation will begin in 5 seconds.
....

Now, you need to wait for the cPanel installer script to complete its installation.

What Auto Installer Script Does for You

cPanel heavily modifies your operating system and that is the reason that no cPanel Uninstaller available on the web so far, you need to reformat your server to remove cPanel completely from your server.

  1. It checks for various packages to ensure that there will be no conflicts and it finds any package conflict, it uninstalls previous packages with yum and that’s why its recommended to install cPanel on a Fresh OS.
  2. Downloads language and base files for installation.
  3. Installs various Perl modules through CPAN and other required packages with yum.
  4. Downloads and compiles PHP and Apache with various associated modules.

Once that script completes its installation, it will shows up that cPanel installation is complete. You may be asked to reboot the server after installation.

After that you need to complete the installation wizard from its web based interface and you can access WHM with the following URL.

http://your-server-ip:2087

OR

http://your-host-name:2087

cPanel will open up its web interface like similar to below.

cPanel WHM Login

cPanel WHM Login

Please login with user “root” and your password. There are some more clicks remaining to complete the cPanel installation. Agree End User License Agreement by clicking “I Agree?/Go to Step 2” button:

cPanel WHM Agreement

cPanel WHM Agreement

Please do provide the working email address and contact SMS address in the column of “Server Contact Email Address” and “Server contact SMS address” respectively because your cPanel sends all important alerts, notification to this EMail-id (Recommended). You can fill the rest details as well, if you have one.

cPanel WHM Networking Setup

cPanel WHM Networking Setup

Please provide a valid FQDN hostname and Resolver entries for your server in this Networking section, you can use Google resolvers in this section if you don’t have your ISP’s resolvers. Please see the image below.

cPanel WHM Hostname Setup

cPanel WHM Hostname Setup

If you have more than one IP attached with your NIC card and you want to set up a specific IP for your Server’s main IP, you can do that from here, to do so please choose the IP from the drop down and click on “Go to Setup 4”.

cPanel WHM IP Address Setup

cPanel WHM IP Address Setup

In the 4th setup wizard, you can select DNS server which you want to use. You can choose one of them according to their Advantages, disadvantages and your server resources. Please read the comparison carefully and select the DNS server. Please see the image below.

cPanel WHM Setup Name Servers

cPanel WHM Setup Name Servers

In the same step, please write down Name Servers you want to use in format of ns1/ns2.example.com. Also, Add an A entry for your hostname and nameserver by selecting the check box, please see the image below.

cPanel WHM Add Name Servers

cPanel WHM Add Name Servers

You can select and set up different services like FTP, Mail and Cphulk in the Step 5 of this web based wizard, please see the snapshots and description below.

You can select FTP server of your choice from this wizard, which you want to use for your server depending on their advantages, disadvantages and depending upon your ease and requirements.

cPanel WHM FTP Setup

cPanel WHM FTP Setup

Cphulk brute force protection detects and block false password attacks activities and block their IP for your server. You can enable/disable and configure it from this installation wizard. Please see the snapshot below.

cPanel WHM Brute Force Protection

cPanel WHM Brute Force Protection

Last Step 6, allows you to enable quotas which helps you to track down the disk space usages.

cPanel WHM System Quotas

cPanel WHM System Quotas

Please select “Use file system quotas” and click on “Finish setup wizard” to complete the Installation process. Once you are done with Installation, WHM’s home page will Appear like below..

cPanel WHM Dashboard

cPanel WHM Dashboard

You can see that Home page of WHM is displaying all Control panel option and sidebar with search facility which allows you to search options by just typing their names.

Sometimes, cPanel installer script is not able to update the licence because of firewall or resolvers entries and you’ll see trial warning in the page. You can do it manually with following command.

[email protected] [~]# /usr/local/cpanel/cpkeyclt

As I told you above that Cpanel is for user level access and WHM is for root level access, you need to create an account with option available in WHM. Here I have created an account with the username “tecmint” to show you the view of cPanel for users. Please see the image below.

cPanel Preferences

cPanel Preferences

Other Useful thing to know before you start working with Cpanel and WHM.

CPanel Backend Files

  1. Cpanel directory : /usr/local/cpanel
  2. Third Party tools : /usr/local/cpanel/3rdparty/
  3. Cpanel addons directory : /usr/local/cpanel/addons/
  4. Base files like Phpmyadmin, skins : /usr/local/cpanel/base/
  5. cPanel binaries : /usr/local/cpanel/bin/
  6. CGI files : /usr/local/cpanel/cgi-sys/
  7. Cpanel access & error log files : /usr/local/cpanel/logs/
  8. Whm related files : /usr/local/cpanel/whostmgr/

Important conf files

  1. Apache configuration file: /etc/httpd/conf/httpd.conf
  2. Exim mail server conf file:/etc/exim.conf
  3. Named conf file : /etc/named.conf
  4. ProFTP and Pureftpd conf file :/etc/proftpd.conf and /etc/pure-ftpd.conf
  5. Cpanel user file: /var/cpanel/users/username
  6. Cpanel configuration file (Tweak settings) : /var/cpanel/cpanel.config
  7. Networking configuration file: /etc/sysconfig/network
  8. Addons, parked and subdomain information: /etc/userdomains
  9. Cpanel update config file: /etc/cpupdate.conf
  10. Clamav conf file: /etc/clamav.conf
  11. Mysql configuration file: /etc/my.cnf
  12. PHP ini conf file : /usr/local/lib/php.ini

Reference Links

cPanel/WHM Homepage

For now that’s all with Cpanel installation, there are so many features in Cpanel and WHM which help you to setup web hosting environment. If you face any problem with setting up Cpanel in your Linux server or need any other assistance like backups, restorations, migrations etc, you can simply contact us.

Till then, Stay connected with Tecmint.com for more exciting and interesting tutorials in future. Do leave your valuable comments and suggestions below in our comment section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide
The Complete Linux System Administrator Bundle
Become an Ethical Hacker Bonus Bundle

You may also like...

67 Responses

  1. Rezaul says:

    [[email protected] ~]# sh latest
    Verifying archive integrity… All good.
    Uncompressing Cpanel & WHM Installer…..
    ____ _
    ___| _ \ __ _ _ __ ___| |
    / __| |_) / _` | ‘_ \ / _ \ |
    | (__| __/ (_| | | | | __/ |
    \___|_| \__,_|_| |_|\___|_|

    Installer Version v00041 r3beb783c03f4e885821ebfb2d7fab04dc476197a

    Beginning main installation.
    2015-05-09 22:16:13 460 ( INFO): cPanel & WHM installation started at: Sat May 9 22:16:13 2015!
    2015-05-09 22:16:13 461 ( INFO): This installation will require 20-50 minutes, depending on your hardware.
    2015-05-09 22:16:13 462 ( INFO): Now is the time to go get another cup of coffe e/jolt.
    2015-05-09 22:16:13 463 ( INFO): The install will log to the /var/log/cpanel-in stall.log file.
    2015-05-09 22:16:13 464 ( INFO):
    2015-05-09 22:16:13 465 ( INFO): Beginning Installation v3…
    2015-05-09 22:16:14 341 ( INFO): CentOS 6 (Linux) detected!
    2015-05-09 22:16:14 365 ( INFO): Validating that the system hostname (‘www.deviangroupbd.com’) is a FQDN…
    2015-05-09 22:16:14 366 (FATAL): The installation process detected the following hostname: http://www.deviangroupbd.com
    Hostnames cannot start with www! Use a valid hostname.
    Removing /root/installer.lock.

  2. Rezaul says:

    Plz Help Me

    [[email protected] ~]# sh latest
    Verifying archive integrity… All good.
    Uncompressing Cpanel & WHM Installer…..
    ____ _
    ___| _ \ __ _ _ __ ___| |
    / __| |_) / _` | ‘_ \ / _ \ |
    | (__| __/ (_| | | | | __/ |
    \___|_| \__,_|_| |_|\___|_|

    Installer Version v00041 r3beb783c03f4e885821ebfb2d7fab04dc476197a

    Beginning main installation.
    2015-05-09 22:16:13 460 ( INFO): cPanel & WHM installation started at: Sat May 9 22:16:13 2015!
    2015-05-09 22:16:13 461 ( INFO): This installation will require 20-50 minutes, depending on your hardware.
    2015-05-09 22:16:13 462 ( INFO): Now is the time to go get another cup of coffe e/jolt.
    2015-05-09 22:16:13 463 ( INFO): The install will log to the /var/log/cpanel-in stall.log file.
    2015-05-09 22:16:13 464 ( INFO):
    2015-05-09 22:16:13 465 ( INFO): Beginning Installation v3…
    2015-05-09 22:16:14 341 ( INFO): CentOS 6 (Linux) detected!
    2015-05-09 22:16:14 365 ( INFO): Validating that the system hostname (‘www.deviangroupbd.com’) is a FQDN…
    2015-05-09 22:16:14 366 (FATAL): The installation process detected the following hostname: http://www.deviangroupbd.com
    Hostnames cannot start with www! Use a valid hostname.
    Removing /root/installer.lock.

  3. Aurobinda says:

    I am reading your blog, it is very nice. I want to setup an environment using this Ec2-instance, ELB, RDS, WHM in AWS. can you please suggest me how to configure mysql RDS in WHM ?

  4. Rob says:

    I had the same issue like Rahul; changing the memory size in the php.ini file fixed the problem for me. Thanks for the great tutorial!

  5. Tarun says:

    I have VPS with Daily Razor. This tutorial has resolved one problem. I had deleted one folder by mistake. Now I have reinstalled the C-Panel. Thanks.

  6. neao says:

    Hello Tarunika
    I tried to install the cPanel into a Red Hat Enterprise Linux Server release 6.5 (Santiago) but:

    # sh latest
    Verifying archive integrity… All good.
    Uncompressing Cpanel & WHM Installer…..
    ____ _
    ___| _ \ __ _ _ __ ___| |
    / __| |_) / _` | ‘_ \ / _ \ |
    | (__| __/ (_| | | | | __/ |
    \___|_| \__,_|_| |_|\___|_|

    Installer Version v00035 rba1f2162e9d3a2ba38cc6aa7722aec0d3a7ad371

    Beginning main installation.
    2014-09-25 06:11:59 433 ( INFO): cPanel install started at: Thu Sep 25 06:11:59 2014!
    2014-09-25 06:11:59 434 ( INFO): This install will take 20-50 minutes depending on your hardware.
    2014-09-25 06:11:59 435 ( INFO): Now is the time to go get another cup of coffee/jolt.
    2014-09-25 06:11:59 436 ( INFO): The install will log to /var/log/cpanel-install.log.
    2014-09-25 06:11:59 437 ( INFO):
    2014-09-25 06:11:59 438 ( INFO): Beginning Installation v3
    2014-09-25 06:11:59 338 ( INFO): redhat-server 6 (Linux) detected!
    2014-09-25 06:11:59 366 ( INFO): Validating that ‘ip-10-123-168-170.ec2.internal’ is a FQDN
    2014-09-25 06:11:59 836 ( INFO): Checking Red Hat registration for updates
    Unable to locate SystemId file. Is this system registered?
    2014-09-25 06:12:05 900 ( INFO): Validating you are subscribed to the optional RHN channel
    2014-09-25 06:12:05 921 (ERROR): You do not appear to be registered with a known base channel for redhat
    2014-09-25 06:12:05 922 (ERROR): $> /usr/sbin/spacewalk-channel –list
    Unable to locate SystemId file. Is this system registered?
    2014-09-25 06:12:05 923 (ERROR):
    2014-09-25 06:12:05 925 (ERROR): $> /usr/sbin/subscription-manager repos
    2014-09-25 06:12:06 926 (ERROR): This system has no repositories available through subscriptions.
    Removing /root/installer.lock

  7. Brent says:

    Thanks for this guide! I recently started learning all about unmanaged VPS and this was very helpful.

  8. Hi sir..

    I try to install the cpanel WHM in my server and its working well. The only problem is the trial License.

    Even though i try to update the lincense using the syntax you give, the trial license is displaying all the way. .

    Can you help me to fixed my problem in the trial lincense?

  9. Shiv Shankar says:

    Hi Tarunika,
    I tried but my limitation is that my root parition is just about 90-10 GBs. and my installtion is failing coz of it.

    [20140813.024102] see http://go.cpanel.net/rpmcheckfailed for more information
    [20140813.024102] The Administrator will be notified to review this output when this script completes
    [20140813.024102] E Detected events which require user notification during updatenow. Will send iContact the log
    info [updatenow] upcp Notification => [email protected] via EMAIL [level => 1]
    Cpanel::iContact: icontact /usr/sbin/sendmail is not executable by 0
    [20140813.024103] Removing staged files and directories for x3mail
    [20140813.024103] Removing staged files and directories for x3
    [20140813.024103] Removing staged files and directories for binaries/linux-x86_64, cpanel
    Can’t exec “/usr/local/cpanel/scripts/cpanel_initial_install”: No such file or directory at /home/cPanelInstall/selfgz19245/install line 146.
    2014-08-13 02:41:05 148 (FATAL): Failure to exec /usr/local/cpanel/scripts/cpanel_initial_install
    Removing /root/installer.lock
    [[email protected] shiv_RnD]#
    [[email protected] shiv_RnD]#
    [[email protected] shiv_RnD]#

    Can we install it in my storage directory using some –prefix like we do in rpms…

  10. Rahul says:

    I am getting a Fatal error : allowed memory executed.
    What should i do ?
    Should i edit the ” php.ini ” file ?
    How will I restart the server after that ?
    I need complete procedure to restart server through cpanel.

    Thanks

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.