How to install cPanel?

cPanel is a popular web hosting control panel that simplifies server management tasks. In this guide, we will walk you through the process of installing cPanel on an AlmaLinux Virtual Private Server (VPS). By following these steps, you will be able to set up cPanel and start managing your web hosting environment efficiently.

Step 1: Login to your vps

You must be logged in via SSH as sudo or root user. If you don’t know How do I access your VPS then read this article carefully

Once you’ve entered the correct password, press Enter, and you should be logged in to your VPS via SSH.

If it’s your first time connecting to the VPS, you may see a message about the authenticity of the host. Verify that the fingerprint matches the expected fingerprint of your server, and then type “yes” to proceed with the connection.

Step 2: Update System Packages
Before installing any software, it’s crucial to update the system packages to their latest versions. Connect to your AlmaLinux VPS using SSH or a terminal and run the following command to update the packages:

 sudo yum update -y

Step 3: Set a Hostname
Ensure that your VPS has a fully qualified domain name (FQDN) assigned to it. You can set the hostname by executing the following command, replacing “yourhostname” with your desired hostname:

 sudo hostnamectl set-hostname yourhostname

Step 4: Install Perl
cPanel is written in Perl, ensure that you have Perl installed on your server, other wise run the command below to install it on your system.

 yum install perl

Step 5: Install Curl

You do not have to run any commands to install it, there is an auto installer script built for you. All you have to do is download the cPanel installer script with the cURL command, if you don’t have the cURL command installed, first install it like so

 yum install curl

You can Install Perl and other additional dependencies by a single command. Run the following command to install them:

 sudo yum install -y perl gcc gcc-c++ wget screen bind-utils net-tools tcpdump lsof perl-libwww-perl perl-Time-HiRes perl-Digest-SHA perl-Digest-MD5

Step 6: Download and Run the cPanel Installation Script

cPanel provides an installation script that automates the installation process. Execute the following command to download and run the script:

 cd /home && curl -o latest -L && sh latest

Note: This script will take some time to complete as it downloads and installs various cPanel packages.

Step 7: Accessing WHM (Web Host Manager)

Once the installation is finished, you can access the WHM interface by opening a web browser and navigating to https://your_server_ip:2087. Replace “your_server_ip” with the actual IP address of your VPS. Use root as username & vps password as WHM password.

Step 8: Initial WHM Configuration
Upon accessing WHM for the first time, you’ll be prompted to complete the initial configuration. Follow the on-screen instructions to set up your server, including choosing a root password, configuring nameservers, etc.

Step 9: License Activation
To activate your cPanel license, you’ll need to provide a valid license key. You can obtain a trial license from cPanel’s official website or purchase a license from a cPanel distributor. Follow the instructions provided to activate your license.


Two Important Thing

Disable Network Manager
To prevent any conflicts, cPanel Installation Process recommended to disable Network Manager. If need, Execute the following commands to stop and disable it:

 sudo systemctl stop NetworkManager
 sudo systemctl disable NetworkManager

Disable SELinux
cPanel doesn’t work well with SELinux enabled, so cPanel Installation Process recommended to disable it. If need in cause, Open the SELinux configuration file using a text editor:

 sudo vi /etc/selinux/config

Locate the line that says SELINUX=enforcing and change it to SELINUX=disabled. Save the file and exit the text editor.

Congratulations! You have successfully installed cPanel on your AlmaLinux VPS. You can now start using cPanel to manage your server and set up hosting accounts. Remember to refer to cPanel

Leave a Reply

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