How to install cPanel on Ubuntu and AlmaLinux

Posted on

How to install cPanel on Ubuntu and AlmaLinux

How to install cPanel on Ubuntu and AlmaLinux

Introduction

cPanel is one of the most widely used and industry-leading web hosting control panels available today. With over 70,000 server installations powering over 11 million domains, cPanel provides an intuitive graphical interface and robust toolset to easily manage every aspect of a hosting environment. This makes How to install cPanel on Ubuntu and AlmaLinux a common question for new server administrators.

First launched in 1996, cPanel has been under continual enhancement ever since by CEO Nick Koston and web hosting provider cPanel Inc. The platform aims to provide system administrators, web hosts and other IT professionals with simplified server, site and account management capabilities through an easy-to-use click-based dashboard.

Some of the key features and benefits provided by cPanel include:

  • User-Friendly Interface: Simplifies server management tasks for users of all skill levels.
  • Automated Tasks: Streamlines common server operations like website creation, email setup, and database management.
  • Security Features: Includes tools to protect against common web threats, such as firewalls and intrusion detection systems.
  • Scalability: Adapts to growing website needs with support for multiple domains, subdomains, and user accounts.
  • Integration: Works seamlessly with other web technologies and services, such as PHP, MySQL, and Apache.

With integrated support for features like PHP, Perl, Apache, Exim, DNS and more – plus the ability to quickly add functionality through cPanel plugins – it’s a very full-featured hosting platform.

Now let’s jump in to the steps for getting cPanel fully installed and configured on your own Linux server! Let’s explore How to install cPanel on Ubuntu and AlmaLinux.

System Requirements and Prerequisites

Before proceeding with the installation, it’s crucial to ensure your server meets the necessary system requirements. This includes hardware specifications, operating system compatibility, and required software dependencies.

1. System Requirements for Ubuntu:

  • A clean installation of Ubuntu Server (versions 20.04 LTS, 22.04 LTS recommended).
  • Minimum 1 GB RAM (2 GB recommended for optimal performance).
  • Minimum 20 GB free disk space.
  • A registered domain name.
  • A static IP address.
  • Disable the default Ubuntu firewall (ufw) before installation. cPanel uses its own firewall.
$ iptables-save > ~/firewall.rules
$ systemctl stop ufw.service
$ systemctl disable ufw.service

After installation, you can configure a firewall using third-party clients like APF or CSF.

2. System Requirements for AlmaLinux OS:

  • A clean installation of AlmaLinux OS (version 8 or 9 recommended).
  • Minimum 1 GB RAM (2 GB recommended for optimal performance).
  • Minimum 20 GB free disk space.
  • A registered domain name.
  • A static IP address.
  • SELinux must be disabled.

Edit the /etc/selinux/config file:

SELINUX=disabled
SELINUXTYPE=targeted

Ensure that there’s no # preceding the SELINUX=disabled option.

Installing cPanel & WHM

The following steps outline the process of installing cPanel & WHM on both Ubuntu and AlmaLinux operating systems.

Step 1: Update and Prepare

It’s essential to update your server’s package repository and upgrade existing packages to their latest versions. This ensures that you have the most recent security patches and bug fixes.

For Ubuntu:

$ sudo apt update && sudo apt upgrade -y

For AlmaLinux:

$ sudo dnf update -y

Step 2: Set Hostname

A Fully Qualified Domain Name (FQDN) is required for cPanel to function correctly. Set your server’s hostname to an FQDN.

For both Ubuntu and AlmaLinux, set your server’s hostname to a Fully Qualified Domain Name (FQDN):

$ sudo hostnamectl set-hostname server.yourdomain.com

Replace server.yourdomain.com with your actual FQDN.

Step 3: Install cPanel Dependencies

Certain dependencies are required for cPanel to install successfully. The curl package is essential for downloading the installation script.

For Both:

$ sudo apt install -y curl  # For Ubuntu
# OR
$ sudo dnf install -y curl  # For AlmaLinux

Step 4: Fetch and Run the Installation Script

This step involves downloading the official cPanel & WHM installation script and executing it. This process will automatically install all the necessary components.

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

This command fetches the latest cPanel & WHM installation script and initiates the installation process. The installation may take some time, so be patient.

Customizing Your Installation

Overview:

Before initiating the installation, you can customize various aspects of cPanel & WHM.

Installation Methods:

  • Express Installation: Installs cPanel & WHM with default settings, suitable for most users.
  • Custom Installation: Allows you to select specific components and configure settings according to your needs.

Installation Options:

You can customize the installation using various options:

  • --force: Forces the installation even if potential issues are detected.
  • --skip-cloudlinux: Skips the automatic conversion to CloudLinux if you have a CloudLinux license.
  • --no-restart: Prevents the server from restarting automatically after the installation.

Important:

If you have a CloudLinux license and don’t want automatic conversion, use the --skip-cloudlinux option.

Alternative Solutions for Web Hosting Management

While cPanel is a popular choice, several alternative solutions offer similar functionality, sometimes with different approaches or pricing models. Here are two alternatives to consider:

1. Plesk

Plesk is another leading web hosting control panel that provides a comprehensive set of tools for managing websites, domains, and servers. It’s known for its user-friendly interface and robust feature set.

Explanation:

Plesk offers a similar feature set to cPanel, including website management, email hosting, database administration, and security tools. However, Plesk distinguishes itself with its focus on simplicity and ease of use, particularly for managing WordPress websites. Plesk also supports a wider range of operating systems, including Windows Server.

Key Features:

  • WordPress Toolkit: Simplifies WordPress installation, management, and security.
  • Security Core: Provides advanced security features, including malware scanning and intrusion detection.
  • Docker Support: Enables easy deployment and management of containerized applications.
  • Multi-Server Management: Allows managing multiple servers from a single interface.
  • Extensibility: Supports extensions and plugins to add additional functionality.

Code Example (using Plesk’s CLI to create a website):

While Plesk primarily relies on a GUI, its command-line interface (CLI) offers powerful automation capabilities.

# Create a new website (domain)
plesk site create example.com -hosting true -hst_type physWebHosting -ip 203.0.113.2 -login example -passwd password

This command creates a new website with the domain example.com, enables hosting, sets the IP address, and creates a system user with a specified username and password. This is just one example of how Plesk’s CLI can be used for server management. Exploring the How to install cPanel on Ubuntu and AlmaLinux alternatives can lead to efficient server management.

2. CyberPanel

CyberPanel is a relatively new web hosting control panel that has gained popularity for its performance and features, particularly its integration with OpenLiteSpeed web server.

Explanation:

CyberPanel differentiates itself by using OpenLiteSpeed as its default web server. OpenLiteSpeed is known for its high performance and scalability, making CyberPanel an excellent choice for websites that require speed and efficiency. CyberPanel also offers a free and open-source version, making it an attractive option for budget-conscious users.

Key Features:

  • OpenLiteSpeed Web Server: Provides high performance and scalability.
  • LiteSpeed Cache: Optimizes website performance with advanced caching capabilities.
  • One-Click SSL: Simplifies the process of installing and managing SSL certificates.
  • Email Hosting: Offers built-in email hosting with support for multiple domains and accounts.
  • DNS Management: Allows managing DNS records directly from the control panel.

Code Example (using CyberPanel’s CLI to create a website):

CyberPanel utilizes a CLI to manage various aspects of the server.

# Create a new website (virtual host)
python /usr/local/CyberCP/bin/createWebsite.py --domainName=example.com --package=default --owner=admin --ipAddress=203.0.113.2 --php=7.4 --ssl=y

This command creates a new website with the domain example.com, using the "default" package, assigns it to the "admin" user, sets the IP address, uses PHP version 7.4, and enables SSL. This highlights the CLI capabilities of CyberPanel. Considering How to install cPanel on Ubuntu and AlmaLinux alternatives provides a comprehensive approach to web hosting management.

These alternative solutions offer different strengths and cater to various needs. When choosing a control panel, consider your specific requirements, budget, and technical expertise.

Conclusion

Installing cPanel & WHM on Ubuntu and AlmaLinux involves a structured approach, addressing specific system requirements and customization options. By carefully following this guide, you’ll successfully set up a cPanel & WHM environment tailored to your preferences. Remember always to prioritize security, keep your systems updated, and periodically review configurations for optimal performance. Knowing How to install cPanel on Ubuntu and AlmaLinux is a valuable skill for any server administrator. Furthermore, exploring alternatives like Plesk and CyberPanel can provide additional options to consider.

Leave a Reply

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