Building a web hosting service would take an incredible amount of effort if it wasn’t for the automation tools already available. One of the comprehensive solutions comes with cPanel & WHM that provide you with all the tools needed for automating server management tasks.
The WebHost Manager, or WHM, gives you an interface tailor-made for control and flexibility. It allows hosting providers to get the most out of their servers and offer the most to their customers. Manage hundreds of features built into cPanel or allow your customers to take control of their domains. Together with cPanel and WHM, you can take the lead on your customers’ needs.
Get started using cPanel & WHM quickly and easily by following this tutorial!
cPanel and WHM requirements
Before getting started with installing cPanel and WHM, you’ll want to take a look at the system requirements. You need to have the following:
Networking requirement
- A fully-qualified hostname that does not match any of your server’s domains, e.g. cpanel.example.com and that resolves to a valid IPv4 or IPv6 address.
- A static IP address configured to a network interface. The system attempts to detect and set the ethernet device during the installation process.
- Disable firewall at the OS level before you run the cPanel & WHM installation. When the installation process finishes, configure a firewall with a third-party client, cPanel recommends APF or CSF.
- Disable Network Manager before running the cPanel & WHM installer. The Network Manager service automates the network’s settings and can disrupt connections to the IP addresses that reside in the IP aliases module.
Hardware requirements
- A compatible 64-bit operating system version of CentOS, CloudLinux, or RHEL
- Minimum 1 GB of RAM, while 2 GB is recommended
- The minimum of 20 GB storage, 40 GB recommended
Other requirements
- cPanel is designed for commercial hosting and can only be licensed on public static IP address. The license is not free but you can follow this guide perfectly well using their free trial.
- cPanel & WHM should only be installed on a freshly deployed operating system.
- Log in to the server as the root user in order to install cPanel & WHM.
- Use the cPanel & WHM installer, which installs all of the required services. Installing other services before cPanel & WHM is likely to cause compatibility issues.
We’ll be showing you how to fulfil most of the requirements while deploying the server and making the pre-required configurations. However, you will need to register a domain and delegate the cPanel server as your domain’s nameserver to get everything working.
The sudo command lets us use our account and password to execute system commands with root privileges, whereas the su command allows us to switch to a different user and execute one or more commands in the shell without logging out from our current session.
When you log into a new cloud server for the first time, it’s good practice to install the latest updates as the first step.
Next, disable the NetworkManager service to allow cPanel to install successfully. Use the following two commands to stop and disable the service.
Installing Perl
A hostname is simply the name a server goes by on a network. Setting a unique hostname is an excellent way to quickly find and identify different servers on your network.
Then uninstall NetworkManager packages with the command below.
As mentioned, you will also need to disable the firewalld service. CentOS has a rather strict preconfigured firewall already installed which could cause an issue with the cPanel and WHM installation later on. Disable firewalld using the two commands underneath.
Afterwards, uninstall the firewalld as well with the next command.
As mentioned, you will also need to disable the firewalld service. CentOS has a rather strict preconfigured firewall already installed which could cause an issue with the cPanel and WHM installation later on. Disable firewalld using the two commands underneath.
That’s it for the pre-requisites. However, as an additional convenience, cPanel recommends that the installation command is run within a Linux screen session.
The Linux screen command allows you to create a shell session that will stay active through any network disruption and allows you to return to where you left off.
Install screen with the command below.
Then start a new screen session with the screen command.
If you get disconnected for any reason, log back into your cloud server and use the screen -r command to resume your screen session.
Installing cPanel & WHM
Now that all pre-requisites have been met, you are ready to install cPanel and WHM themselves.
Installing cPanel & WHM on your own server signs the server IP up for a trial license to use for 15 days free, no strings attached and no limitations.
The installation is easy and quick using the installer provided by cPanel. Any new installations default to the fast installation mode. If you want to customize your installation, follow the steps in the custom installation documentation.
Install cPanel & WHM using the following command
Then start a new screen session with the screen command.
The installation process might take a moment but once done you’ll see a confirmation similar to the output example below.
The passwd command sets and changes passwords
It works! Congratulations, you’ve successfully configured cPanel & WHM on your cloud server.
Other settings to consider
Your cPanel & WHM server is then ready to roll! However, you might still want to check through a few other settings. WHM includes a whole lot of further options to customize your server and improve server security.
Check AutoSSL settings
WHM can automatically configure pages with SSL certificates to enable HTTPS. The setting for this should be on by default but confirm that AutoSSL has obtained SSL certificates for your website.
Open the Manage AutoSSL page and verify that the feature is enabled by having a provider selected, cPanel by default.
On the same page, you can also check the logs for previous SSL certificate runs, manage settings per user, and run AutoSSL for all enable users.
Set up two-factor authentication
The WHM installation includes brute force protections by default but for the best results, you should configure two-factor authentication.
Go to the Two-factor authentication page where you can set the 2FA policy per site and user.
Enable the policy by clicking the toggle switch, then on the Manage My Account tab, click the button for Set Up Two-Factor Authentication.
Scan the QR code with your preferred 2FA authenticator application and enter a security code provided in the field underneath. Then click the Configure Two-Factor Authentication button to confirm.
Consult the cPanel Security Advisor
WHM includes a very useful tool for checking for security issues and recommendations called Security Advisor. It can automatically test and check for multiple different configuration options and security features to help you maintain your cPanel server.
Run the check by opening the Security Advisor page or by clicking the Scan Again button on that page.
Pay close attention to the Important issues highlighted in red, while also taking a look at the Recommendations listed in yellow. Settings that have already been optimized are shown in green.
Summary
Awesome job! With cPanel & WHM, you’ve got the tools to run a web hosting solution at any scale. The cPanel interface allows your customers to manage their sites, intranets and ensures their online properties running smoothly, while WHM keeps you in control of server resources.