Knowledgebase

Guide to Install cPanel in a Linux Server

Managing a Linux server without a control panel can be confusing for beginners. Tasks like creating websites, managing email accounts, setting up databases, or configuring DNS often require complex command-line commands. Many beginners get stuck because they don’t know how to handle these server operations efficiently.

Installing cPanel solves these problems by providing a graphical interface that simplifies server management. With cPanel, you can:

  • Create and manage websites in a few clicks
  • Set up email accounts without command-line knowledge
  • Manage databases like MySQL easily
  • Secure your server and monitor resources conveniently

In this guide, we will walk you through the step-by-step installation of cPanel on a Linux server, so even if you are new to server management, you can have a fully functional hosting environment ready in under an hour.


Also Read: How to Configure DNS on Linux?


What are the Prerequisites?

Before installing cPanel, ensure your server meets the following requirements:

➔ Supported OS: CentOS 7/8, AlmaLinux 8, or Rocky Linux 8 (64-bit recommended).

➔ Server Resources:

  • Minimum 2GB RAM or more recommended
  • Minimum 20 GB disk space

➔ Root Access: You must have root or sudo privileges to install cPanel.

➔ Fresh Server: cPanel must be installed on a fresh server. Existing software or packages may cause conflicts.

➔ Static IP: Ensure your server has a static IP address.

➔ Minimal Installation: Use a minimal or base Linux installation without a GUI for best performance.


Also Read: How to Check Whether Port is Open or Not in Linux?


Steps to Install cPanel in a Linux Server

➔ Log in to your server using SSH as the root user. You can do this using a terminal

ssh root@your-server-ip

Replace your-server-ip with your server’s IP address. Enter your root password when prompted.

➔ Set a fully qualified domain name (FQDN) as your server hostname.

For example:

hostnamectl set-hostname server.yourdomain.com

Verify the hostname:

hostname

➔ You have to make sure your server is updated with the latest packages:

yum update -y

This ensures smooth installation and prevents conflicts.

➔ The next step is optional but recommended: disabling Network Manager and Firewalld to prevent installation issues.

systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl stop firewalld
systemctl disable firewalld

➔ Enable iptables if required:

systemctl start iptables
systemctl enable iptables

➔ It’s time to install ‘Perl’ ‘curl’ as cPanel requires it to run properly

yum install perl curl -y

To download & run the cPanel installation script, cPanel provides an automated installation script. Use the following commands:

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

The installation process typically takes 30–60 minutes, depending on your server’s resources. Also, during installation, your server may reboot or services may restart.

➔ Once installation is complete, access WHM using your browser:

https://your-server-ip:2087

  • Use root as the username.
  • Enter your server root password.
  • You will see the WHM setup wizard.

➔ To complete the initial WHM setup, do the following:

  • Accept the License Agreement.
  • Enter your contact email.
  • Configure nameservers (e.g., ns1.yourdomain.com and ns2.yourdomain.com).
  • Complete basic security and settings.

Once done, your cPanel server is ready to host websites. Now, you can create your first cPanel account.


Also Read: How to Install RPM files on Different Linux Distributions?


Tips for Beginners

  • Always keep your server up to date to avoid vulnerabilities.
  • Regularly take backups using cPanel’s backup tools.
  • Use strong passwords for all cPanel accounts.
  • Monitor server resources to avoid downtime.

Conclusion

Installing cPanel on a Linux server transforms a standard server into a fully functional web hosting platform, making website, email, and database management easier, even for beginners. 

By following the steps outlined in this guide, you ensure a secure, optimized, and properly configured server environment.

Remember, the key to a smooth experience is using a fresh, minimal Linux installation, keeping your system up to date, and following best practices for security. Once cPanel is installed, your server is ready to host websites reliably, whether for personal projects, business, or clients.