Install cPanel on Rocky Linux

How to Install cPanel/WHM on Rocky Linux?

cPanel is one of the powerful web hosting control panels used to manage web servers and host websites. By using cPanel, in addition to managing Linux-based hosts, users can control and manage email, files, databases, domains, programs, and different versions of PHP and all aspects of the web server. Also, cPanel provides the possibility to view, edit, delete, and upload files on the web server.

This excellent control panel helps users in creating and managing MySQL and PostgreSQL databases, as well as website monitoring, firewall management and security settings, and data backup. cPanel is customizable and one of its valuable advantages is its simple and understandable user interface, which makes it easier and faster for novice users to learn about it.

Unlike other control panels, cPanel can be installed and run on Red Hat Enterprise Linux-based distributions, and due to its optimal performance, most Linux users prefer using cPanel to set up and manage their websites. For this reason, the topic of this article is how to install cPanel/WHM on Rocky Linux, one of the modern and unique Linux distributions.

Don’t worry about the complexity of installing cPanel/WHM on Rocky Linux, by following the instructions in this guide you will install cPanel/WHM on Rocky Linux without any problems.

What are the reasons to use Rocky Linux?

CentOS has long been a reliable and stable choice for servers. With the ending CentOS8 life cycle on December 31, 2021, the CentOS community has Changed and many distributions have been developed as alternatives to CentOS8, Rocky Linux being one of them. As you know and we have already talked about Rocky Linux, Rocky Linux is a stable, open-source, free, and user-friendly operating system developed based on RHEL in 2021.

Rocky Linux is an RHEL emulator that is compatible with the binary system and is currently supported by large and powerful financial sponsors. The purpose of Rocky Linux development is to satisfy CentOS8 users and choose Rocky Linux as an ideal replacement for CentOS8, so by improving the features of CentOS, it tries to attract the attention of Linux users.

As we mentioned at the beginning of the article, cPanel can be installed on RHEL derivatives, as long as CentOS7 and CentOS8 were supported, the best operating systems to install and use cPanel were CentOS. By stopping CentOS8 and upgrading to CentOS Stream, users hoped to use cPanel on CentOS Stream. With the announcement of cPanel about the lack of support for CentOS stream, users were once again looking for a compatible operating system to install cPanel, till they found Rocky Linux which is one of the compatible and stable choices in this field.

Prerequisites for installing cPanel on Rocky Linux

Steps to install cPanel on Rocky Linux

Installing cPanel on Rocky Linux has simple steps, by following the steps that we will teach later, you can manage your web server and hosting services efficiently with cPanel facilities.

Step 1: Updating Rocky Linux server repository packages

Before installing any program, we recommend updating the Rocky Linux server resources and repositories by running the following command:

yum update -y

If you are asked to confirm the update process, type Y and press Enter.

Step 2: Installing Perl

cPanel is written based on the Perl programming language, so installing Perl on a Rocky Linux server is a prerequisite for installing cPanel on Rocky Linux. To install Perl on Rocky Linux, run the following command:

yum install perl

Step 3: Installing Curl

If Curl is not installed, the required cPanel installer script will not be installed, so install Curl using the following command:

yum install curl

Step 4: Adding hostnames

To use cPanel, you must enter the hostname in Fully Qualified Domain Name (FQDN) format. So enter the following command:

hostnamectl set-hostname myserver.mydomain.com

Note: In the Mydomain and Myserver fields, replace the hostname and domain you want.

Step 5: Disabling Network Manager Service

Cpanel is incompatible with Network Manager Service, which is implemented to manage the connection of computers, so to install cPanel, you need to ensure that Network Manager Service is disabled:

service NetworkManager stop
chkconfig NetworkManager off

Step 6: disabling SELinux and firewall Temporarily

SELinux is a Linux kernel security module that supports access control security policies through a mechanism. Therefore, to avoid problems and incompatibility, it is recommended to temporarily disable SELinux before installing cPanel:

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

The second way to disable SELinux is to edit the SELinux configuration file using any text editor (preferably VI). To do this, change the content of the SELinux configuration file by running the following command and using a text editor:

vi /etc/selinux/config

Then by pressing the I and C buttons, add the desired codes in the content of the SELinux configuration file and change the SELINUX parameter from Enforcing to disabled:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
# targeted – Targeted processes are protected,
# minimum – Modification of targeted policy. Only selected processes are protected.
# mls – Multi Level Security protection.
SELINUXTYPE=targeted

Then save the SELinux configuration file by pressing the Esc button and typing wq to apply the changes.

In addition to disabling SELinux, to avoid problems when installing cPanel, it is better to temporarily disable the firewall and use a third-party firewall. To temporarily disable the firewall in Rocky Linux, run the following command:

iptables-save > ~/firewall.rules
systemctl stop firewalld.service
systemctl disable firewalld.service

Step 7: Installing cPanel with a 15-day trial license

By using the command that we will provide below, you can use the features of cPanel with a trial license and do not need to buy a license.

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

You may have to wait for approximately 1 hour to complete the installation process of WHM /cPane with a trial license. Of course, the waiting time depends on the speed of your network.

Step 8: enabling Network Manager Service

After installing cPanel, re-enable Network Manager Service because computer connections require Network Manager Service. For this purpose, run the following command:

service NetworkManager start
chkconfig NetworkManager on

To apply your changes, reboot the Rocky Linux server using the following command:

reboot

After restarting the Rocky Linux server, enter the cPanel management panel by using a browser and typing the address https://serverIP:xxxx.

It should be noted that you must replace your IP address in the login address of the cPanel management panel.

Then type your server password for the cPanel login password and Root username for the cPanel login username.

Step 9: License activation for Cpanel/WHM

You have two ways to enable the license for cPanel: 1. Using a free trial license 2. Buying a paid license.

Free trial license activation for Cpanel/WHM

cPanel 15-day free license activation requires configuration, so log into your cPanel Store account.

Note: If you do not have a cPanel Store account, you must register.

  • Log in to the cPanel management panel.
  • Log in to your account.
  • Type your server username and password to enter the WHM panel.
  • After reading the conditions, accept them.

Install cPanel/WHM on Rocky Linux

  • You will be faced with a cPanel Store account login page, if you already have an account, you can enter by entering your username and password, otherwise, this is where you can create an account for cPanel Store. Assuming you do not have an account, continue the steps to create an account and select the log in option.

Install cPanel/WHM on Rocky Linux

  • In the window that opens, select the Create Account option to create a cPanel Store user account.

Install cPanel/WHM on Rocky Linux

  • Enter your email address, after agreeing to the terms of use of cPanel, select the Create Account option.

Install cPanel/WHM on Rocky Linux

  • To specify the password for the cPanel account, you will receive an email in the email inbox you set for WHM.
  • Select the ALLOW ACCESS option to link your server’s IP address to the email address you have specified.

Install Cpanel/WHM on Rocky Linux

If you create a user account in the browser you configured WHM and enter your email account, the previous step is applicable, but if you do not use the same browser to enter the email, you can specify a password by clicking on the link you received.

  • Enter the code that was sent to your email.

Install cPanel/WHM on Rocky Linux

  • Displaying the following page and the phrase 15-day free Trial License Activated informs about the activation of the cPanel trial license. Then go to the settings section.

Install cPanel/WHM on Rocky Linux

  • To be notified of possible WHM errors, enter an email address.
  • To connect your domain or subdomains to the WHM server, type the name servers.

Install cPanel/WHM on Rocky Linux

  • enter these as child name servers in your domain control panel.

Finally, you have successfully activated your free trial license for cPanel.

After installing WHM and the necessary configurations, reboot the server to apply your settings.

Activation and purchase of a paid license

To order a cPanel license, visit the Opera VPS licenses page.

Then confirm the activation of the license, from the cPanel License Verification site.

Update the desired license by running the following command on the Rocky Linux server:

/usr/local/cpanel/cpkeyclt

FAQ

By using the features of cPanel, the management of domains, databases, files, and email accounts is facilitated, while the user can manage multiple accounts in the field of deletion, creation, and even services by using WHM. The accounts in WHM can each have different cPanels.

Conclusion

In this article, we have taught how to install cPanel/WHM on Rocky Linux step by step so that you can easily use cPanel facilities to manage web servers and host sites. We hope you can install cPanel/WHM on Rocky Linux without facing any problems by following the instructions given in this article.

If you need more help at any step of the article, share your question with us in the comments section so that we can respond as soon as possible.

Leave a Reply

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