Installing cPanel on an Ubuntu server requires some specific configurations, as cPanel officially supports CentOS, CloudLinux, and AlmaLinux. However, you can use a workaround to install cPanel on Ubuntu by converting the OS to AlmaLinux first. Here's how to do it step by step:
Step 1: Update and Prepare the Server
-
Update the system packages:
sudo apt update && sudo apt upgrade -y -
Install necessary dependencies:
sudo apt install curl wget -y -
Set a hostname (if not already set):
sudo hostnamectl set-hostname your.hostname.comReplace
your.hostname.comwith your desired fully qualified domain name (FQDN). -
Ensure root access: Switch to the root user if you aren't already:
sudo su
Step 2: Convert Ubuntu to AlmaLinux
Since cPanel doesn’t directly support Ubuntu, you’ll need to convert your server to AlmaLinux:
- Download the AlmaLinux conversion script:
curl -o almalinux-deploy.sh https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/main/almalinux-deploy.sh - Run the script to convert your OS:
bash almalinux-deploy.sh - Reboot the server:
reboot
Step 3: Install cPanel on AlmaLinux
-
Download the cPanel installation script:
curl -o latest -L https://securedownloads.cpanel.net/latest -
Run the installation script:
sh latestThis process may take some time depending on your server's resources.
-
During installation, follow the on-screen instructions. Once complete, cPanel and WHM (Web Host Manager) will be installed.
Step 4: Access WHM (Web Host Manager)
-
After installation, WHM will be accessible via:
https://your.server.ip:2087Replace
your.server.ipwith your server's IP address. -
Log in with the root username and password.
Step 5: Activate and Configure cPanel
- Once logged in, you’ll be prompted to activate your cPanel license. You can purchase a license or use a trial license for testing.
- Follow the WHM setup wizard to configure DNS, mail, and other server settings.
Important Notes:
- Ensure that your server meets cPanel's minimum requirements.
- For production environments, use a fresh server installation to avoid conflicts.
- If you need assistance with licensing or additional configurations, you can contact cPanel support or consult their documentation.
Let me know if you encounter any issues during the process!