Install cPanel on CentOS 7

How To Install cPanel / WHM On CentOS 7

Hi everyone, I’m Harry, and today I will be with you about installing cPanel on CentOS 7. This tutorial will show you how to install the cPanel WHM and access it on your server’s dedicated IP address through the command line. I should consider that it is better to follow all of the steps to prevent any probable issues.

cPanel installation is actually an easy task without any complexity, and as long as you follow all steps one by one, you won’t face any issues.

Note: You can also use this tutorial to install cPanel on CloudLinux OS.

What Is cPanel?

cPanel, as its name implies, is a web control panel. cPanel provides you with the ability to manage Linux-based hosts. This control panel provides users with a wide range of features, and as a result, it has formed the most significant hosting control panel.
Users can create and manage their email addresses in cPanel and control domains, databases, various PHP versions, and almost all web server aspects.

As a result, this powerful control panel makes it possible to manage all of your hosting services in one place. cPanel was developed by a company of the same name and in the Perl programming language.
cPanel is a great, customizable control panel, which has done well over time and has a professional and active team behind it, which is a great help to cPanel users.

The cPanel’s reputation, popularity, and widespread use are due to its simple and understandable user interface. Everyone learns it quickly, and it is used more than ever to launch new websites in 2021.

Why CentOS 7?

As you may know, CentOS 8 is released, but there are some problems with installing cPanel. At the moment that I write this post, CentOS 7 is the most reliable and most compatible operating system to install cPanel. Here we provide cPanel/WHM VPS with CentOS with a reasonable price trial/licensed.

Minimum Resource Requirement To Install cPanel

  • Buy Linux VPS With CentOS 7 Operating System
  • 1 GB RAM
  • 1 core CPU 1.1 GHz
  • 20 GB Storage
  • Static IPv4

cPanel VPS Hosting Banner

Connect To Putty

You can use the topic about How to Use Putty to Connect a Linux VPS for more details.

Pre-Requirements Of cPanel Installation

Note: Before installing, I should mention that you can paste commands by right-clicking inside the SSH connection (Putty).

Note: Use root username or a username that has root privileges to install cPanel, otherwise, you may need to put sudo before each command that you run. For example, “sudo yum update“. To get more details about Sudo, check what is Sudo exactly.

1- Update Centos 7

Use this command to update the server before installing cPanel. The update process will take some minutes according to your network speed and the value of your resources.

yum update -y

You will be asked yes or not, that you should type y and press enter to proceed with the update.

2- Installing Perl

Perl is the language that cPanel has been written with.
Run the following command to make sure that Perl is installed on the server.

yum install perl

3- Installing Curl

The Curl is required to download the cPanel installation script; the following command can install the Curl:

yum install curl

4- Add Hostname

Cpanel requests for a hostname that should be in (FQDN) Fully Qualified Domain Name format. For example, in this topic, we will use myeserver.mydomain.com, and instead of this, you should put your own hostname.
Here is the command to set it:

hostnamectl set-hostname myeserver.mydomain.com

5- Disabling Network Manager Service

Network Manager service is used to connect computers; cPanel asks to remove this service or disable it when installing cPanel.

service NetworkManager stop
chkconfig NetworkManager off

6- Disable SELinux Temporarily

SELinux is the main security defender of the Linux Kernel, and it is better to be disabled to prevent any access issues when we install cPanel on CentOS Server. You can use the below command to disable it temporarily:

setenforce 0

Installing cPanel With Trial License

You can use this code to install WHM / cPanel. The cPanel installation process will take some minutes according to your network speed and the value of your resources.

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

Based on the resources of your server, the installation may take about an hour to 2 hours.

Enabling Network Manager Service

Remember to enable this service once the installation was completed with the below commands.

service NetworkManager start
chkconfig NetworkManager on

Note: It is not essential to reboot the server, but you can still restart all installed services through the below command.

reboot

Once the installation was completed, you will face the login URL to login into WHM / cPanel.

 

URL to login to the admin panel of cPanel / WHM:

 

https://serverIP:2087 ( Consider that instead of server IP, you should put your server’s IP, which is this for me: https://48.68.149.135:2087 )

Username to log in to the admin panel of WHM: It is the root or the username that you use instead of the root.

The password to login to the admin panel of cPanel: It is the password of your server.

Activate Free 15 Days Trial WHM / cPanel License

Formerly, you didn’t need to do anything to activate the free 15 days license of cPanel. But now you need to login into your cPanel Store account. If you have an account, sign in and if you don’t have, sign up. I will explain now how to do it.

In this section, we will sign up and continue the steps to create a cPanel free 15 days license.

To create a free license, you should log in to your cPanel web interface after installing it. Then you will be asked to log in to your account or to sign up if you don’t have one.

Use your server’s username and password to login into your WHM account.

 

cPanel first login after installation

 

Read cPanel terms and agree to all if you wish!

 

Accept cPanel Terms to continue basic WHM configurations

 

As you can see it asks to login into your cPanel Store account, which we will create now, so choose login to continue.

 

Get started with WHM free 15 days license

 

In this step, there are 2 options that we can choose from. To login to your cPanel Store account if you have, or to sign up for it.

Click create an account if you don’t have one.

 

Login or sign up to create cPanel free license

 

Enter your email address, agree to cPanel terms of use, and click to create an account.

 

Create a WHM customer account

 

Now, you will receive an email to set a password for your cPanel customer account.

Consider that if you are logged in to your email in the same browser that you are configuring the WHM and creating the account, you will be asked to allow access to the IP of your server to be connected to the email address you entered.

To do so, choose to allow access.

Note: Otherwise, if you are not logged in to your email in the same browser, you should click on the link that you will receive to your email to set a password for your account. Then you can go one step back and try to log in.

 

Allow Access To cPanel

 

In this step, you will receive a code that you should enter.

 

Enter Verification Code

 

This page shows that your trial license activation was successful. So you can continue to the server setup section.

 

WHM free 15 days License Activated

 

In the next section, you should enter an email address to receive probable error notifications from WHM.

Then you should enter 2 name servers. Name servers are used to connect your domain or subdomain to your WHM server.

Note: You should also create these as child name servers in your domain control panel too.

 

WHM first basic Configuration step (add email address and set name-servers)

 

And congratulations, you are finished installing the cPanel WHM and creating the free trial license.

 

WHM(Server-end)

 

Note: Once the installation of WHM and its basic configuration is finished, reboot the server to apply kernel and software updates.

 

Related Article: How To Install cPanel On AlmaLinux.

 

Purchase, Verify And, Update The cPanel License

  • Purchase cPanel License.

You can order a cPanel license through the licenses page of our website.

  • Verify the cPanel License.

If you wish to verify that your license has been activated successfully or not, you can use the cPanel verify system.

  • Update cPanel License.

Once you ordered a license, you should run this command inside your server, and as a result, the license will be updated.

/usr/local/cpanel/cpkeyclt

Be free to share your opinions and questions with us in the comments section!

Be always victorious and successful.

Another Recommendation From OperaVPS For You

If you want to experience something other than cPanel, we suggest using Directadmin, which is cheaper than cPanel and has a good user interface and features that you can see in the Directadmin installation and usage guide.

 

FAQ

  • Is cPanel free?

It has a free trial for 15 days, but after that, you should order a license.

 

  • How long does cPanel take to install?

It is related to the resources of your server. It takes about 1 to 2 hours in VPS servers, but it takes about 15 minutes in a dedicated server.

 

  • How do I know if cPanel is installed?

It can be checked through this command:

usr/ local/cPanel/cPanel-V

 

  • How do I access the web interface of cPanel in CentOS?

The default link and port to log in to cPanel are like this: https://hostname or server IP:2087 | Instead of hostname or server IP, you should put yours.

 

  • Who uses cPanel?

cPanel is the world’s most popular web hosting control panel, and most of the hosting companies use it, and everybody can use it on a server or shared hosting.

 

  • How do I change the hostname in CentOS?

In the WHM panel, there is a section by the name change hostname to change the hostname.

 

  • Do I need WHM / cPanel for WordPress?

To use WordPress, you don’t have to run it on cPanel, and it can run on any web server and any control panel.

 

  • How do I find my hostname in CentOS?

In your Linux server, type hostname and press enter, then you will see your hostname.

 

In this article, we learned how to install cPanel on CentOS 7. Please do not hesitate to contact us through the comments section if you faced any issues through the installation or if you had any questions.

Leave a Reply

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


cool ferg Publish in July 25, 2021 at 12:51 am

Great tutorial, thank you. So after installing whmcs and cpanel, mydomain.com has no SSL installed and defaults to mydomain.com/cgi-sys/defaultwebpage.cgi, however, myeserver.mydomain.com has cpanel Inc SSL installed. 1. How do I get mydomain.com to use the same SSL cert for myeserver.mydomain.com? 2. If I want to install for eg. wordpress on mydomain.com, do I have to install mysql and php, and if I do, will they mess with cpanel?

    Harry Hill Publish in July 25, 2021 at 3:25 am

    Hi, It's a pleasure you found this article useful. Consider that you should use your own domain name instead of mydomain.com. And myserver.mydomain.com is your hostname that should be something like server.operavps.com. When you install cPanel / WHM, some packages like PHP and Mysql install automatically, and you don't need to install them manually. The procedure of installing WordPress on cPanel is that you should create a cPanel account with your domain name then you should create a database for your WordPress from "MySQL® Databases" section and then you should install WordPress. After installing WordPress, you can add SSL from the "SSL/TLS Status" section that cPanel provides for free.

Daniel Publish in June 14, 2021 at 2:40 pm

Errata: The step to set the hostname is there, my mistake. Very good job with the tutorial, I appreciate it ! Regards

    Harry Hill Publish in June 15, 2021 at 5:20 am

    Hi Daniel, we are glad this article was helpful for you!

Daniel Publish in June 14, 2021 at 1:02 pm

You forgot the step where you need to set your hostname to a FQDN PS: commands with sudo and commands without sudo Many newbies won't know the difference and also does not look pro Best regards

    Harry Hill Publish in June 15, 2021 at 5:19 am

    Hi Daniel, thanks for bringing up this issue, it was really helpful in developing this content to its best quality, it will help the visitors to install cPanel easier and without any issue. Sudo will be discussed in the next update of this content.

Phillip Ndegwa Publish in April 7, 2021 at 4:28 pm

[root@server home]# service NetworkManager stop Redirecting to /bin/systemctl stop NetworkManager.service Failed to stop NetworkManager.service: Unit NetworkManager.service not loaded. [root@server home]#

    Harry Hill Publish in April 7, 2021 at 4:35 pm

    It means, the network manager service is not loaded already and you don't need to stop it. Please continue the steps and if you faced any other error, tell me.

Zohare Publish in December 21, 2020 at 11:06 pm

It was a good article and useful for me