Best Steps To Install cPanel WHM on Rocky Linux 8

Posted on

Best Steps To Install cPanel WHM on Rocky Linux 8

Best Steps To Install cPanel WHM on Rocky Linux 8

In this guide on the Orcacore website, you will learn to Install cPanel WHM on Rocky Linux 8. cPanel is one of the most popular control panels in the United States. Many web hosting companies supply cPanel to customers as part of their hosting package.

cPanel has two interfaces: a user interface called cPanel and a server management interface called Web Host Manager (WHM). This combination allows users to manage their websites and supplies hosting providers with tools to manage the server.

To complete this guide, you must log in to your server as a root or non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Rocky Linux 8.

1. Disable Rocky Linux 8 Firewall

First, you need to update your local package index with the following command:

dnf update -y

Then, you must disable the Rocky Linux OS firewall using the following commands:

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

2. Disable SELinux on Rocky Linux 8

To make your system compatible with the cPanel installation, you must disable SELinux. To do this, open the SELinux config file with your desired text editor, here we use vi:

vi /etc/selinux/config

Find the SELinux line and set it to disabled as shown below:

...
SELINUX=disabled
...

When you are done, save and close the file.

Then, use the following command to install the required packages and dependencies on Rocky Linux 8:

dnf install perl curl -y

3. Set up FDQN on Rocky Linux 8

Next, you must add a hostname that should be in ( FQDN) Fully Qualified Domain Name format. You can set your hostname with the following command:

hostnamectl set-hostname <mark>cpanel.rocky</mark>

Note: Remember to use your own hostname.

When you are done with these requirements you can continue to Install cPanel WHM on Rocky Linux 8.

4. Install cPanel WHM on Rocky Linux 8

At this point, we use this script to download and install the cPanel with a trial license:

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

Note: If you get an error that cannot resolve the host, Check if the server has internet. For example:

ping 8.8.8.8

If you don’t have a connection, edit the /etc/resolv.conf and add the following line to your file:

nameserver 8.8.8.8

When you are done, save and close the file. Then, run the script again and it works.

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

This will take some time to complete. Be patient!

Enable Network Manager on Rocky Linux 8

When your cPanel installation is completed on Rocky Linux 8, enable the Network Manager service with the commands below:

# 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

At this point, you can log in to your WHM.

5. Access cPanel WHM Web Interface Rocky Linux 8

To access the WHM login screen, type your server’s IP address in your web browser followed by 2087:

https://<mark>your-server-ip</mark>:2087

In the WHM login screen, you should enter your Rocky Linux root user and password and click login to access data for cPanel.

WHM login screen
Access cPanel WHM

Then, read cPanel terms and conditions and click Agree to All.

cPanel terms and conditions

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

free cPanel trial

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

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

Create cPanel account

Enter your email address, agree to cPanel terms of use, and click to create an 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 you will receive to set a password for your account. Then you can go one step back and try to log in.

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

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

Activate cPanel trial license

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.

When you are finished, you will see your WHM dashboard on Rocky Linux 8.

WHM dashboard on Rocky Linux 8
Access cPanel WHM

From WHM you can easily perform your tasks.

Conclusion

At this point, you have learned to Install cPanel WHM on Rocky Linux 8. It allows for efficient web hosting management with an intuitive control panel. Also, it simplifies tasks like domain management, email setup, and server configuration. You are now ready to manage your web hosting environment with cPanel WHM on Rocky Linux 8.

Hope you enjoy it. Please subscribe to us on Facebook, Instagram, and YouTube.

You may also like these articles:

How To Set up cPanel and WHM on Centos 7

How To Install ClamAV on DirectAdmin

Install Let’s Encrypt on cPanel New Version

Resolve cPanel Error ‘PHP PECL imagick fails on PHP 8.3’

Fix cPanel/WHM Installation on Red Hat 6 & 7

Alternative Solutions for Installing cPanel WHM on Rocky Linux 8

While the above guide provides a direct method to Install cPanel WHM on Rocky Linux 8, there are alternative approaches that can provide different benefits. Here are two alternative methods:

1. Using a Pre-Built Docker Image

Docker provides a way to containerize applications, making them portable and isolated. Instead of directly installing cPanel/WHM on your Rocky Linux 8 server, you can use a pre-built Docker image containing cPanel/WHM. This approach offers several advantages:

  • Isolation: cPanel/WHM runs in a container, preventing conflicts with other software on your server.
  • Portability: The container can be easily moved to another server with Docker installed.
  • Simplified Updates: Updating cPanel/WHM involves simply pulling a newer version of the Docker image.
  • Rollbacks: Rollback to a previous version is easy.

Explanation:

This method involves first installing Docker on your Rocky Linux 8 server. Then, you pull a cPanel/WHM Docker image from a trusted source (if available and officially supported, or build your own). Finally, you run the container, mapping the necessary ports and volumes.

Steps:

  1. Install Docker:

    dnf install docker -y
    systemctl start docker
    systemctl enable docker
  2. Search for a cPanel/WHM Docker image. (Note: Officially supported images are rare, proceed with caution and verify the image’s source and security)
    docker search cpanel
  3. Pull the Docker image (replace example/cpanel with the actual image name):

    docker pull example/cpanel
  4. Run the Docker image (This is an example and may require adjustments based on the image. Consult the image’s documentation):

    docker run -d -p 2087:2087 -p 2086:2086 -p 2083:2083 -p 2082:2082 -p 80:80 -p 443:443 --name cpanel_whm example/cpanel
    • -d: Runs the container in detached mode (background).
    • -p: Maps the specified ports from the container to the host.
    • --name: Assigns a name to the container.
  5. Access cPanel/WHM: Open your web browser and navigate to https://your-server-ip:2087.

Important Considerations:

  • Image Source: Carefully vet the source of any Docker image before using it. Unofficial images may contain malware or be outdated.
  • Licensing: cPanel/WHM requires a valid license, even within a Docker container.
  • Persistence: Use volumes to persist cPanel/WHM data (accounts, websites, etc.) so that it is not lost when the container is stopped or removed.

2. Using a Cloud-Based Server with cPanel/WHM Pre-Installed

Many cloud providers offer virtual machines or dedicated servers with cPanel/WHM pre-installed. This eliminates the need for manual installation and configuration.

Explanation:

Cloud providers like DigitalOcean, AWS, Google Cloud, and others offer marketplace images or server configurations that include cPanel/WHM. You simply create a new instance using this image, and cPanel/WHM is ready to go.

Steps:

  1. Choose a Cloud Provider: Select a cloud provider that offers cPanel/WHM images or pre-configured servers.
  2. Create an Account: Sign up for an account with the chosen provider.
  3. Launch a New Instance: Create a new virtual machine or dedicated server instance.
  4. Select cPanel/WHM Image: When prompted, choose an image that includes cPanel/WHM. Look for options like "cPanel/WHM on Rocky Linux 8" or similar.
  5. Configure the Instance: Set the instance size, region, and other parameters as needed.
  6. Launch the Instance: Start the newly created instance.
  7. Access cPanel/WHM: Once the instance is running, access cPanel/WHM through your web browser using the server’s IP address and port 2087 (e.g., https://your-server-ip:2087).

Advantages:

  • Ease of Use: Simplifies the installation process.
  • Scalability: Cloud providers offer scalable resources, allowing you to easily increase server capacity as needed.
  • Managed Infrastructure: The cloud provider handles the underlying infrastructure, including hardware maintenance and network connectivity.

Considerations:

  • Cost: Cloud-based solutions often involve ongoing costs for server usage and cPanel/WHM licenses.
  • Vendor Lock-in: Migrating away from a specific cloud provider can be complex.

Choosing the best method for installing cPanel WHM on Rocky Linux 8 depends on your specific needs and technical expertise. The manual installation provides the most control but requires more technical knowledge. Docker offers isolation and portability, while cloud-based solutions prioritize ease of use and scalability. Ultimately, you need to evaluate the pros and cons of each approach and select the one that best fits your requirements.

Leave a Reply

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