How To Install cPanel?
Before talking about how to install cPanel, you need to have a clear idea of what you can do with cPanel and why you need it.
What is cPanel?
cPanel is an extremely reliable, feature-rich, popular, and intuitive commercial control panel designed for web hosting services. You can use cPanel through a powerful graphical user interface to manage your shared, reseller, and business hosting services and much more.
It comes with a cPanel and WHM (Web Host Manager) that make it easier for web administrators to handle their web hosting needs. Ideally, you should install cPanel and WHM on a freshly-installed OS as installing services before cPanel installation could make you run into compatibility issues.
cPanel isn’t free to use. You can install cPanel with a trial license after you learn how to install cPanel in 2022, but you’ll have to buy a license from an official cPanel distributor to continue using it beyond the trial period.
Though you can use cPanel for your shared servers, cPanel dedicated servers are ideal if you want to host high-traffic web applications and websites, or have other hosting requirements where top-notch performance is vital.
Before installing cPanel and WHM, you need to remember a few key things:
- cPanel licenses are available only for static, publicly visible IP addresses. It doesn’t offer licenses for reserved, dynamic, internal, or sticky IP addresses.
- Since cPanel doesn’t come with an uninstaller, you’ll have to reformat the server in case you want to remove cPanel.
- For cPanel and WHM installation, you must log in to the server as the root user. If you don’t have root-level access, you’ll need to get in touch with your hosting provider or system administrator for help.
Now that we have discussed the basics, it’s time to talk about how to install cPanel.
How to install cPanel? Standard Installation Guide 2022
You need to run the command mentioned below to get cPanel and WHM installed on your licensed server:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
Your current directory gets altered by this command to /home. Additionally, this command gets the most recent edition of cPanel and WHM downloaded, and runs the script for installation.
Ideally, you should run cPanel’s installation command within a Screen session in Linux. Linux Screen lets you produce a shell session, which remains active even when there’s a disturbance in the network. Depending on what’s the OS of your server and what package management tools the server uses, instructions for installing the Screen utility will differ.
To find if your OS contains the Screen utility and it’s present in your path, you can run the commands given below:
- For a system that uses yum, opt for the “which screen” command. To install Screen, you can use the “yum install screen” command.
- For a system that uses apt, run the “screen –version” command and install Screen with the “apt install screen” command.
- Use the “screen” command to run a Screen session. Next, run the command for installing Screen for your system.
- In case your session gets disconnected due to some reason, log back into your server and run the “screen –r” command to reconnect to your Screen session.
How to install cPanel in Linux server?
The answer to “how to install cPanel in Linux” is easy. As mentioned above in the standard installation guide, you can execute a solitary command as mentioned below that alters the current working directory to /home, gets the latest cPanel package downloaded, and executes the installation script:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
You can also set up cPanel/WHM through web interface by visiting http://IPADDRESS:2086 or https://IPADDRESS:2087 for encrypted connection.
How to install cPanel on Windows 10?
Though cPanel isn’t supported on a Windows server, cPanel and WHM version 102 lets you install cPanel and WHM on an unsupported OS as an experimental feature. To do it, you’ll need to run the command mentioned below, where the OS is one of cPanel and WHM’s supported operating systems:
sh latest --experimental-os=operatingsystem
Thus, if you use the command given below, it’ll compel the system to presume the OS in use is AlmaLinux OS version 8.
sh latest --experimental-os=almalinux-8.4
However, refrain from using CloudLinux as the attempt will fail.
How to install cPanel on CentOS 7?
- Step 1: You need to make sure your server has a standard hostname (Fully Qualified Domain Name or FQDN). Else, set it as follows (in this example, cPanel is the hostname and eliteservermanagement.lan is the domain name):
# hostnamectl set-hostname cpanel.eliteservermanagement.lan
- Step 2: Ensure your server has Perl installed. If not, run this command to get it installed on your system:
# yum install perl
- Step 3: Download the installer script for cPanel with the cURL command. If you don’t have the cURL command installed, install it at first with this command:
# yum install curl
- Step 4: Download the latest cPanel installer script to the home directory:
# curl -o latest -L https://securedownloads.cpanel.net/latest
- Step 5: Run the auto-installer script using the command below, preferably in screen mode if you’ve logged in to the server via SSH:
# sh latest
- Step 6: Once the installation is complete, you’ll get to see the output and could be asked to reboot the server.
- Step 7: Next, you’ll have to complete the installation wizard from its web-based interface, and you can get access to WHM with the following URL:
http://SERVER_IP:2087
- Step 8: Now, login as the root user with your password and use some more clicks to complete the cPanel installation.
- Step 9: After you log in, you’ll see the WHM/cPanel License Agreement. Click “Agree to All,” and move onto the next page, where you’ll need to fill in your email address and nameserver details. This is followed by setting your server’s static IP address.
- Step 10: Next, click on the “Finish” button. This will take you to the WHM/cPanel dashboard on the following page. Enable the FileSystem quotas by clicking on the “Click to enable” button on the top right. Next, click the Proceed button and reboot the server to get the FileSystem quota enabled.
- Step 11: To create your first cPanel account, go to the WHM/cPanel dashboard and click on “Create a New Account.” Provide the requisite information like username, password, domain, email, theme, and click on “Enable DKIM and SPF,” “Enable Apache Spam,” and “Select Mail Routing,” after which you should click on the “Create” button.
- Step 12: After your account is created, click on “Go to cPanel” to create and manage FTP, websites, email, and databases using the cPanel dashboard.
If you’re seeking an answer to “how to install cPanel on CentOS 8,” you can follow similar steps as above to get the job done.
How to install cPanel on VPS?
For those looking for an answer to “how to install cPanel on VPS,” the steps are as follows:
- Step 1: Log into your WHM account.
- Step 2: If you’re logging into a new VPS, agree to the terms and conditions and fill in details like nameservers, etc. Then, create a new cPanel account by clicking on “Create a New Account.” You’ll need to enter the domain name, username, password, and email. Go through the rest of the settings carefully, and once done, click on the “Create” button at the bottom.
- Step 3: After the account is created, click on “Go to cPanel” button, and you’ll be ready to start using cPanel to manage your domain.
How to install cPanel on Ubuntu 20.04?
Those interested in knowing “how to install cPanel on Ubuntu” should rejoice as cPanel and WHM recently added support for Ubuntu.
At present, cPanel and WHM version for Ubuntu is only available in the Edge and Current release tiers. It’s important to remember that Edge and Current tiers aren’t considered production-ready. For production environments, you should think about updating /etc/cpupdate.conf after version 102 gets released to the “Release” update tier.
- Step 1: Since cPanel is written in Perl, your server should have Perl installed. Else, run this command to install it on your system:
apt update && apt upgrade && apt install perl perl-base
- Step 2: For cPanel’s installation on Ubuntu, choose the tier marked “Current,” not the one marked “Release” and shown as default due to the unavailability of version 102 via “Release.”
- Step 3: Run this command below that alters your session to the home directory, downloads cPanel and WHM’s defined version, and runs the installation script:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
How to install cPanel on AWS either via MacOS or on a Windows computer and how to install cPanel on DigitalOcean are other common questions, which we hope to answer in a successive post.
Final Thoughts
Once you successfully install cPanel and start using it, you should opt for cPanel server management and cPanel server monitoring for regular security audits and fixing flaws and issues that could otherwise expose your server to cyberattacks and other malicious elements. To make your server more secure, you may even consider cPanel server hardening.
Now that you know the fundamentals of how to install cPanel, go ahead and use it to experience the benefits it brings to the table.