To install cPanel in VPS is a vital topic for anyone looking to manage their web hosting efficiently.
It’s like giving yourself the ultimate toolkit for managing your websites, domains, and server resources.
cPanel is super popular in the web hosting world, and for a good reason—it’s packed with features that make tasks like file management, database handling, and email setup a breeze.
With a virtual Private Server Hosting (VPS), you get dedicated resources and tons of customization options, perfect for those who need more power and flexibility than shared hosting offers.
And when you pair that with cPanel’s user-friendly interface, you’ve got a winning combo.
In this article, we’ll walk you through the steps to install cPanel on your VPS, whether you’re a pro or just starting out.
Let’s get cPanel up and running so you can unleash its full potential!
Prerequisites to Install cPanel in VPS
Truehost.com offers optional cPanel with their VPS packages which means pre-installed cPanel. Ain’t that easy?
Now, in case you find yourself with a VPS package that doesn’t have the cPanel option, you can always install it manually.
Alright, before we jump into the exciting world of installing cPanel on your VPS, let’s make sure we’ve got everything in place.
Think of this as getting your tools ready before starting a fun DIY project.
So, what do we need? Let’s dive into the essentials.
Minimum Server Requirements for cPanel
To ensure that cPanel operates smoothly, your VPS should meet the following minimum server requirements:
RAM: At least 1 GB of RAM is required, but 2 GB or more is recommended for optimal performance, especially if you plan to host multiple websites.
CPU: A minimum of 1 CPU core is required, though having 2 or more cores will significantly enhance performance, particularly under load.
Disk Space: At least 20 GB of available disk space is necessary for a basic cPanel installation. However, more space will be needed as you add websites, databases, and other resources.
Supported Operating Systems
cPanel is compatible with several operating systems. The following are the officially supported distributions:
CentOS: Versions 7 and 8 are widely used and recommended for cPanel installations.
CloudLinux: A popular choice for shared hosting environments, providing enhanced security and resource management.
AlmaLinux: A community-driven fork of CentOS, suitable for those looking for a stable and free alternative.
Rocky Linux: Another CentOS alternative that aims to provide long-term support and stability.
Access Requirements
To install cPanel on your VPS, you need to ensure you have the appropriate access:
SSH Access: You must be able to connect to your VPS via SSH. This allows you to execute commands and manage your server remotely.
Root Privileges: You will need root access to your VPS or a user account with sudo privileges. This is essential for installing software and making system-level changes.
Preparing the VPS for cPanel Installation
Before you install cPanel on your VPS, it’s crucial to prepare the server properly.
This preparation involves updating the server, setting a hostname, and disabling SELinux.
Each of these steps ensures a smooth installation process and optimal performance of cPanel.
1. Update the Server
Keeping your server’s software up to date is essential for security and compatibility.
An outdated server may have vulnerabilities that could compromise your installation.
Command to Update the Server’s Package Manager:
For CentOS, AlmaLinux, and Rocky Linux, use the following command to update the server:
yum update -y
For systems using dnf, such as newer versions of Fedora, you can use:
dnf update -y
Importance of Ensuring the Server is Up to Date:
Updating your server ensures that you have the latest security patches, bug fixes, and software enhancements.
This reduces the risk of issues during the cPanel installation and improves overall server stability.
2. Set a Hostname
Setting a proper hostname is an important step in preparing your VPS for cPanel installation.
A Fully Qualified Domain Name (FQDN) helps identify your server on the internet and is necessary for cPanel to function correctly.
Importance of Setting a Fully Qualified Domain Name (FQDN):
The FQDN should reflect your domain and provide a clear identification of your server.
For example, if your domain is example.com, a suitable hostname could be server.example.com.
This helps with email delivery and SSL certificate issuance.
Command to Set the Hostname:
You can set the hostname using the following command:
hostnamectl set-hostname server.example.com
Replace server.example.com with your desired hostname.
3. Disable SELinux
SELinux (Security-Enhanced Linux) is a security feature that enforces access control policies on your server.
While it enhances security, it can interfere with cPanel’s functionality if not configured correctly.
Explanation of SELinux and Why It Should Be Disabled for cPanel:
cPanel may not function properly with SELinux enabled due to its restrictive nature.
Disabling SELinux simplifies the installation process and reduces potential conflicts.
Command to Check the Status of SELinux:
To check whether SELinux is currently enabled, run:
sestatus
Command to Disable SELinux:
If SELinux is enabled, you can disable it using the following command:
setenforce 0
To permanently disable SELinux, edit the configuration file:
nano /etc/selinux/config
Change the line SELINUX=enforcing to SELINUX=disabled, then save and exit the editor.
The Steps to Install cPanel on VPS
Once you have prepared your VPS, the next step is to install cPanel.
Here are the detailed steps to guide you through the installation process:
1. Download the Installation Script
The first step in the installation process is to download the latest cPanel installation script.
This script will automate the installation of cPanel and WHM (WebHost Manager) on your server.
Command to Download the Latest cPanel Installation Script:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
This command changes the directory to /home, downloads the latest version of the cPanel installation script, and executes it.
2. Run the Installation Script
After downloading the installation script, you will run it to begin the installation process.
The installation process will configure various services required for cPanel, including Apache, MySQL, and PHP.
During this time, you will see a series of messages in the terminal indicating the progress of the installation.
It is important to note that this process may take some time, and you should not interrupt it.
The command provided above also initiates the installation. Simply run it in your SSH terminal.
The installation typically takes between 10 to 15 minutes, depending on your server’s performance and internet speed.
3. Initial Setup and Configuration
Once the installation is complete, you will need to complete the initial setup and configuration of cPanel.
Logging into the WHM (WebHost Manager)
After the installation, you can access WHM using your web browser. Enter the following URL, replacing your_vps_ip with your server’s IP address:
Login URL: https://your_vps_ip:2087
Use the root username and the password you set for your VPS to log in.
Initial Setup Wizard
Upon logging into WHM for the first time, you will be greeted by the initial setup wizard.
This wizard will guide you through configuring basic settings, including:
1. Setting Up an Email Address: You will need to provide an email address for notifications and important alerts related to your cPanel installation.
2. Configuring Basic Settings: This includes setting your nameservers, configuring your server’s hostname, and other essential settings.
Accessing cPanel and WHM
After you successfully install cPanel and WHM on your VPS you’re probably wondering how to get into these fantastic management tools.
Don’t worry; I’ve got you covered.
Let’s dive into how to access WHM and cPanel, including the URLs and ports you’ll need to know.
How to Access WHM
URL Format to Access WHM through a Browser:
You can access WHM using the following URL format:
https://your_server_IP_address:2087
Alternatively, if you have a domain configured, you can use:
Default Ports Used for WHM
WHM operates on port 2087 for secure connections (HTTPS).
For unsecured connections (HTTP), it uses port 2086, but it is recommended to use the secure port for better security.
How to Access cPanel
To access cPanel, use the following URL format:
https://your_server_IP_address:2083
If you prefer using a domain, it can also be accessed via:
cPanel’s Default Ports
cPanel uses port 2083 for secure connections (HTTPS) and port 2082 for unsecured connections (HTTP).
Again, it is advisable to use the secure port (2083) to protect your login credentials and data.
Post-Installation Tasks
After installing cPanel on your VPS, before you kick back and relax, there are a few things you need to do to make sure everything runs smoothly and securely.
Let’s dive into some important steps, like updating cPanel, configuring your firewall, and setting up those crucial backups.
Updating cPanel
Keeping cPanel up to date is like giving your server a regular check-up—it’s vital for security, performance, and getting the latest features.
Why Bother Updating cPanel?
Regular updates help protect your server from nasty vulnerabilities, ensure everything plays nicely with the latest software, and unlock cool new features that make your hosting experience even better.
How to Check for Updates in WHM
You can easily check for updates right in WHM. Just head over to WHM » Home » cPanel » Upgrade to Latest Version.
This section will show you the current version and let you start an update with just a click.
To update cPanel via the command line, log in as the root user and run:
/usr/local/cpanel/scripts/upcp
This command will update cPanel and WHM, along with other essential software on your server.
Configuring Firewall
Next up, let’s talk about your firewall.
Setting it up properly is key to keeping your server secure while making sure you can still access cPanel and WHM.
Make Sure Your Firewall Isn’t Blocking cPanel and WHM
You’ll need to allow traffic on the default ports that cPanel and WHM use.
Specifically, make sure ports 2083 (for cPanel) and 2087 (for WHM) are open.
Basic Firewall Setup Commands
If you’re using iptables, run these commands:
iptables -A INPUT -p tcp –dport 2083 -j ACCEPT
iptables -A INPUT -p tcp –dport 2087 -j ACCEPT
For firewalld, use:
firewall-cmd –permanent –add-port=2083/tcp
firewall-cmd –permanent –add-port=2087/tcp
and
firewall-cmd –reload
These will make sure your firewall isn’t accidentally locking you out of cPanel or WHM.
Setting Up Backups
Finally, let’s talk backups.
Regular backups are like your server’s insurance policy—they’re absolutely essential for data protection and disaster recovery.
Backups protect your data from getting lost due to hardware failures, accidental deletions, or security issues.
They’re your safety net, allowing you to restore your system to a previous state if anything goes wrong.
How to Set Up Automated Backups in cPanel
To get backups going automatically, log into WHM and navigate to WHM » Home » Backup » Backup Configuration.
Here, you can tweak your backup settings, including:
1. Backup type (full, incremental, etc.)
2. Schedule (daily, weekly, etc.)
3. Backup retention settings
Follow the prompts to set things up just how you like them and make sure your backups are stored somewhere safe.
Conclusion
To sum up, if you need a powerful way to manage your web hosting environment effectively, installing cPanel on your VPS.
Also, to troubleshoot cPanel installation issues on your VPS, you can consider our few straightforward but important steps.
Start by resolving license errors by verifying your hostname and time settings.
Next, ensure your firewall and DNS configurations are correct to avoid access issues.
Regularly updating your system is also crucial for maintaining smooth performance.
By taking these steps, you can effectively address installation problems.
You can also ensure your VPS runs efficiently, providing a solid foundation for your server’s ongoing operations.