Guide to installing cPanel on CentOS 7

Here is a simple guide to easily install cPanel and WHM on a CentOS 7 VPS.

cpanel whm logo

SSH as root into your VPS or server

First step is to set your hostname:

hostname vps.yourdomain.com

Change the part after “hostname” to what main hostname you will have for this VPS.

Run: yum -y install perl

This installs Perl which is what cPanel is written in.

Once that has finished go into the home directory with: cd /home

Then download and install the latest cPanel:

curl -o latest -L https://securedownloads.cpanel.net/latest

Start the installation with: sh latest

The cPanel installation will take some time (~over an hour)

Once you notice the install is finishied dont close out of the terminal, there is important information in the output!

2019-01-02 08:33:43  285 ( INFO): cPanel install finished in 75 minutes and 30 seconds!
2019-01-02 08:33:43 1264 ( INFO): Congratulations! Your installation of cPanel & WHM 11.76 is now complete. The next step is to configure your server.
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): Before you configure your server, ensure that your firewall allows access on port 2087.
2019-01-02 08:33:43 1264 ( INFO): On RHEL, CentOS, and CloudLinux systems, execute /scripts/configure_firewall_for_cpanel to accomplish this.
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): After ensuring that your firewall allows access on port 2087, you can configure your server.
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): 1. Open your preferred browser
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): 2. Type https://1XX.108.2XX.1XX:2087 in the address bar
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): 3. Enter the word root in the Username text box
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): 4. Enter your root password in the Password text box
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): 5. Click the Login button
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): Visit https://go.cpanel.net/whminit for more information about first-time configuration of your server.
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): Visit http://support.cpanel.net or https://go.cpanel.net/whmfaq for additional support
2019-01-02 08:33:43 1264 ( INFO):
2019-01-02 08:33:43 1264 ( INFO): Thank you for installing cPanel & WHM 11.76!

 

Whilst you have terminal up it can be easier to install Lets Encrypt (free ssl’s), this is done with: /scripts/install_lets_encrypt_autossl_provider

Remember to enable and configure Lets Encrypt in WHM.

To access WHM as per the output log above go to https://yourvpsip:2087 Note that you have to use https

Your username will be root and the password will be the root password for your VPS.

You will now begin to setup and configure your hosting with WHM.