cPanel and WHM have become one of the most used web hosting management tools, cPanel is a very stable hosting control panel and WHM is a control panel for server administrators that allows us to control any dedicated server or VPS server where cPanel is installed.
Both cPanel and WHM are two unique tools, which also perfectly complement systems like CloudLinux, achieving very stable servers when it comes to offering a quality shared hosting service or reseller hosting for different customer profiles.
Although cPanel is a very advanced control panel and WHM has many tools, its installation is not very complex, we can install cPanel and WHM (they always go together) on any dedicated server or VPS server that has a CentOS operating system, CloudLinux or RedHat (RHEL).
At the time of writing, the cPanel installer supports CentOS versions 6 and 7, CloudLinux, and RedHat (RHEL) .
The basic installation system of cPanel is simple, we just have to follow a wizard from the Linux terminal and then another wizard directly from the browser using to access the IP address of the server where we are installing cPanel.
Table of Contents
Requirements to install cPanel & WHM
As we have said previously, we can install cPanel and WHM on any dedicated server or VPS server that has CentOS , CloudLinux or RedHat (RHEL) operating system , both in version 6 and in version 7.
At the hardware level cPanel does not need too many resources , but we must bear in mind that we are installing a complete stack of services on a web server , and this means that the webs hosted on the server will need the resources to function, if there are no resources , we are going to have problems.
What I mean by this? Although according to the official cPanel documentation , we can install it on a server with 226 Mhz of CPU frequency and 768 MB of RAM, with these resources we can only install it, we will not be able to host any web because services such as Apache , MySQL and PHP do not work to run properly and will give us quite a bit of trouble.
In principle, what we recommend as MINIMUM to have a fully functional cPanel server with all services working perfectly are these:
- 2 GB of RAM.
- 1 CPU core (at least 2 Ghz).
- 20 GB of HDD or SSD hard drive.
- CentOS 6 or CentOS 7, but 64-bit.
With these requirements met, our cPanel should be fine, and we can start talking about hosting websites , but keep in mind that the more traffic the websites you host have on your server, the more resources your server will need to function properly.
How to install cPanel on CentOS
First of all, we are going to support this installation guide with a video on how to install cPanel & WHM on a CentOS 7 server , since I think that the simple fact of seeing the ease with which we can install cPanel already serves to realize that the process does not have any difficulty (that does not mean that its subsequent configuration is easy, if you need help to configure cPanel after its installation, contact us).
Now that you have seen the video, we are going to follow the process in a written guide format, we are going to start by SSH entering the server where we are going to install cPanel and WHM , for this we use our usual SSH client , in this case I am on Windows, and I’m going to use Putty, but on Linux or Mac we can perfectly use the Linux or Mac terminal with the “ssh” command.
(The SSH terminal you see belongs to one of our VPS servers , specifically a VPS 2 SSD with CentOS 7 ).
We start the work by updating the operating system, since normally there are quite a few updates that will help us keep our system optimized, safe and stable.
To update a CentOS we use the following command:
Now we are going to start with the installation process itself, for this we are going to execute a command in the Linux terminal to which we are connected by SSH.
As you can see in the previous commands, first we move to the / home / folder to download the installation script there and later we download the cPanel installation script with WGET .
And finally we run the installer (script we just downloaded) using the following command in the current folder:
And with this, the installation of cPanel and WHM on our server will begin .
Something to keep in mind is that cPanel compiles many packages during its installation , so the installation requires a lot of CPU power and can take more or less time depending on the resources available on the server and the CPU power it has.
Normally, we can have 30 minutes of waiting, but if the resources of the machine are more limited we can end up waiting 1 hour or more.
When the cPanel installation script finishes working , we will see something similar to this in the SSH terminal:
This means that the installation has finished, and that we must start the initial configuration wizard.
The first thing we are going to do is restart the server using the following command:
We do this simply in case the installer has had to change the version of the kernel or similar, since with this certain changes will be applied that without restarting it would be impossible to apply.
The initial configuration wizard is carried out through the web browser of the computer on which we are working, for this we must put in the navigation bar the IP address of the server where we have just installed cPanel and later we put the port: 2087, if the server is well installed and there was no error, it will redirect us directly to a browser screen like this:
NOTE: BEWARE, IF it takes us to a screen like this:
We must execute the following command in order to stop the default firewall of CentOS 7, CloudLinux 7 or RHEL 7 :
With this we will deactivate IPTABLES , we will reactivate them later after reconfiguring the operating system’s firewall .
Without this we will not be able to access through port 2087 (WHM) or 2083 (cPanel).
On the screen we mentioned earlier in the photo:
Step 1: AGREEMENT
Once we authenticate with the correct data, we can see something similar to this, a 6-step wizard to perform the initial configuration of the cPanel system :
In the previous screen, the first thing we must do is accept the license, for this we simply click on the blue button “I Agree / Go to Step 2” that we have surrounded with a red box in the previous image.
Step 2: SETUP NETWORKING
On the next screen of the wizard (step 2):
We must fill in the boxes or blocks with the corresponding data, some data is mandatory but many are not.
From the “Contact Information” block, we only have to compulsorily fill in the “Server Contact Email Address” field:
In the next block, called “Hostname”, it is necessary to fill in the only information that it asks for, the hostname of the server:
In fact, as you can see in the previous image by the green symbol, it must also be verified so that the server configuration is correct.
If we read the text or legend below the field, it tells us exactly the format that the hostname of the server should have .
In the next block called “Resolvers” we must configure the IP addresses of the DNS servers that we will use to resolve the domain names and hostnames from the server, we simply have to put 2 and with the IPs of Google’s DNS it will be enough as you can see in the image:
Finally, in the last block called “Main Network / Ethernet Device” we must configure which is the default network card or interface of the server.
This is a fairly “personal” configuration depending on the server where we are installing cPanel , but in cases like mine where it is simply a VPS server with 1 single virtual network interface , we leave the default configuration:
Finally we press the blue button “Save & Go to Step 3” to continue to the next step of the cPanel installation wizard .
Step 3: SETUP IP ADDRESSES
On servers with a single IP address and a single network interface, step 3 is fairly simple, as you just need to proceed to step 4.
As I have said, in dedicated servers with a single network interface or VPS servers , we can advance directly to step 4, unless we have several assigned IP addresses and we want to select which IP is the one that will be used for clients to host their webs on the server.
This part of the configuration varies a lot depending on how the server is and its network configuration, we must have knowledge of what we are doing otherwise we will have a problem.
Once this part of the configuration is finished, we advance to step 4 with the blue button “Go to Step 4”.
Step 4: NAMESERVERS
In step 4 we must choose several things related to the DNS server that will serve the cPanel server that we are installing, we can even leave the DNS server disabled , although to have a functional cPanel hosting , it is recommended to install one.
Normally we recommend BIND as a DNS server , so in this case we are going to leave BIND marked, although we know perfectly well that BIND is the one that consumes the most resources if we compare it with MyDNS for example.
Further down, in the block “Choose which nameservers domains on this server will use” we must put the DNS servers that the webs hosted on our cPanel server will use to point to the server.
At this point there are several ways to do this, but we recommend creating two of your own nameservers through the domain registrar and pointing them to the IP of the cPanel server that we are installing.
Unfortunately we cannot explain how to create your own nameservers , since this varies a lot depending on the domain registrar , if your domain is registered with us ask our support department and they will tell you how you can do it.
The final block called “Configure Address Records for Nameservers & Hostname” can be left unfilled.
These configurations can be modified later from WHM to better adapt the operation of our cPanel server.
Once we have finished configuring this, we move on to the next step, step 5, by clicking on the blue button “Go to Step 5”.
Step 5: SERVICES
In this screen we must configure some basic services of the server.
We chose the software that will manage the server’s FTP service , in this case ProFTP , since it is the one we normally select, since we believe that it is much more stable and secure than Pure-FTPD .
In this section (step 5) we are going to leave the rest of the configuration by default, with cPHulk activated.
Finally we press the blue button “Save & Go to step 6” to continue to the last step of the cPanel configuration wizard .
Step 6: SET UP QUOTAS
In this last step we are going to leave the default option “Use file system quotas” checked.
Once we have that option selected, click on the “Finish Setup Wizard” button to finish the initial configuration of the cPanel server .
New cPanel options
But this is not over yet, now cPanel will allow us to configure some new options that have been implemented recently in the installer, and that reminds us that we can configure them, for example, at the time of writing this guide, cPanel allowed us to choose this:
We must bear in mind that this changes as versions of cPanel go by, so it is very possible that when you do your installation, other options will appear, not what I am showing you in the previous image.
Anyway, you can not configure any of these options and finish the wizard if you click on the link at the bottom right that says “Exit to WHM”.
Configure cPanel from WHM:
Now the good begins, something that we will not delve into in this article, since it is simply a cPanel installation guide .
At the end of the installation we will access WHM, which has the following appearance or at least similar:
Once we get to this step, the configuration that we want to implement on our server will vary a lot depending on what use we want to give the server and the profile of clients we want to host.
One of the first things we should do when finishing the installation of cPanel and WHM on our server is to secure the server , re- enable IPTABLES and reconfigure the firewall to avoid attacks or security problems .
Also add, that the WHM screens at the time of writing this article are constantly changing due to cPanel & WHM updates , so they may not be exactly the same in this guide.
cPanel and CloudLinux
CloudLinux is one of the most used and most unknown systems for the shared hosting user .
Normally the user sees cPanel , but in few cases the user realizes that CloudLinux is behind it .
Let’s try to clarify a little better how CloudLinux can help us in shared hosting .
I also want to emphasize that CloudLinux is not only compatible with cPanel , but also compatible with other hosting control panels such as ISPConfig , Plesk , DirectAdmin or even a new one like CentOS Web Panel .
What is CloudLinux?
CloudLinux is really a Linux distro , but it can also be applied as a patch to CentOS to transform it into a system adapted to offer shared hosting .
What CloudLinux does is isolate or virtualize each hosting account in a totally individual way so that what a user does in their account does not affect the rest of the accounts hosted on the server, this is applicable to infections, resource overuse, attacks, etc. …
CloudLinux helps to radically improve the security and stability of the server, the difference in stability between a hosting server with CloudLinux and without CloudLinux is complete, without CloudLinux the larger the server and the more clients are hosted on it, the less stable is the server.
One of the good things about CloudLinux is that it allows blocking processes, which means that a single process cannot completely block a server, since the CloudLinux system will shut it down before it causes a problem.
In addition to the advantages that CloudLinux has for the hosting provider , it also has advantages for the hosting user hosted on the server, since it greatly improves the performance of applications that use PHP and MySQL , but it also currently integrates systems such as OptimumCache that acts as a file cache and allows us to greatly improve performance on large servers that host many websites .
On the other hand, it also allows the hosting user to see the resources that are using RAM, CPU and I / O among other resources.
Install CloudLinux on CentOS
To install CloudLinux and cPanel , you must first have a CentOS installation converted to CloudLinux , let’s see how to convert it.
Starting from a CentOS 6 or CentOS 7 installed on a KVM or Xen VPS server , or on a dedicated server with cPanel previously installed following the process in the previous section, we are going to execute the following commands to convert CentOS to CloudLinux .
We will start by downloading the CloudLinux deploy system and running it:
(We must change <activation_key> for our corresponding key)
We are going to assume that we have a valid CloudLinux key , otherwise we will not be able to install it.
Once we execute the second command (the one with the key) we can see the following in the SSH terminal that we have open and where we execute the commands:
Sometimes it seems that the CloudLinux deploy script freezes and has finished, but it really is not.
When the deployment or installation of the CloudLinux libraries is finished, something similar to this will appear on the screen:
Now we only need to restart the system and see the changes that CloudLinux has made in WHM and cPanel , we must also configure the limits that allow us to configure CloudLinux and review the LVE parameters .