Want to learn how to install cPanel on Ubuntu Server 20.04?
You’re in the right place!
In this article, we’ll walk you through the process.
cPanel is a popular web hosting control panel that makes managing websites easy with its user-friendly interface and automation tools.
Ubuntu Server 20.04 LTS (Long Term Support) is a great pick for this because it’s stable, secure, and gets long-term support from Canonical.
It works perfectly with cPanel and gives you a strong, reliable base for hosting your websites and web apps.
By the end of this guide, you’ll know everything you need to get cPanel up and running on your Ubuntu Server 20.04.
Prerequisites
Before we dive into installing cPanel on your Ubuntu Server 20.04, let’s make sure everything is ready.
Don’t worry; I’ll walk you through the basic requirements and things to keep in mind.
Server Requirements
First off, your server needs to meet some basic system requirements to run cPanel smoothly:
Processor: At least 1.1 GHz, but 2 GHz is recommended for better performance.
RAM: You’ll need a minimum of 1 GB, though 4 GB is ideal.
Disk Space: Your server should have at least 20 GB of space, but 40 GB is recommended.
Architecture: Make sure your server is 64-bit.
Also, it’s important to start with a clean installation of Ubuntu Server 20.04 LTS, meaning there shouldn’t be any other software pre-installed.
Access Requirements
To install cPanel, you’ll need to have root or sudo user access to your server.
License Information
cPanel isn’t free forever. It requires a license for each server IP address.
However, when you first install it, you get a 15-day free trial.
After that, you’ll need to purchase a license from the cPanel Store.
Get the Server Ready
First, let’s make sure your server is up to date.
This step is super important because it ensures that your server is running the latest and most secure software.
Update and Upgrade Packages
First, you need to update and upgrade your server’s packages.
Don’t worry; this is simpler than it sounds! Just run the following commands:
sudo apt update
sudo apt upgrade -y
What this does is refresh the list of packages and install any updates that are available.
It’s a quick and easy way to make sure your server is in top shape.
Set the Hostname
Next up is setting the hostname, which is basically giving your server a unique name that cPanel can use.
This is important because cPanel relies on this name (called a fully qualified domain name, or FQDN) for things like email and DNS services.
To set your hostname, just run this command (replace yourhostname.example.com with the name you want to use):
sudo hostnamectl set-hostname yourhostname.example.com
After that, you can verify that the hostname is set correctly by running:
hostname -f
If everything’s done right, this command will show you the FQDN you just set.
Disable Network Manager (Optional)
In some situations, you might want to disable Network Manager to avoid any network issues with cPanel.
This is especially useful if your server uses a static IP address or doesn’t have a graphical interface.
To disable Network Manager, just run these commands:
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
This will stop the Network Manager service and make sure it doesn’t start up again when you reboot your server.
If you go this route, just remember to manually configure your network settings afterward.
How to Install cPanel on Ubuntu Server 20.04
Let’s walk through the process of getting cPanel up and running on your Ubuntu Server 20.04.
Don’t worry, it’s easier than it sounds.
Step 1: Download the cPanel Installation Script
First things first, you need to grab the latest cPanel installation script. Open your terminal and enter the following command:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest
This command will download the script to your server. Easy, right?
Step 2: Run the Installation Script
Once the download is complete, it’s time to install cPanel. Run this command:
sh latest
Now, sit back and relax for about 15 to 30 minutes while your server does its thing.
The installation time depends on your server’s specs and internet speed, so grab a coffee while you wait.
Step 3: Access the cPanel Web Interface
After the installation finishes, you’re ready to log in to cPanel.
Open your web browser and type in the following:
Replace your_server_ip with your actual server’s IP address.
This will take you to the WHM (Web Host Manager) login page.
Step 4: Complete the Initial Setup Wizard
Almost done! Now, let’s wrap things up with the initial setup wizard:
Login: Use the root username and the password you created during the installation.
Setup Wizard: Follow the on-screen steps to configure essential settings like:
Contact Information: Enter an email address to receive system notifications.
Nameserver Configuration: Set up your nameservers (like ns1.yourdomain.com and ns2.yourdomain.com).
IP Address Configuration: Confirm your server’s IP address.
Finalize Configuration: Review everything and click “Finish” to complete the setup.
Post-Installation Configuration
Now that you’ve finished setting up cPanel, there are a few more steps to make sure everything runs smoothly.
Let’s dive into the basics:
Basic Configuration
After you complete the initial setup, it’s a good idea to adjust some basic server settings in cPanel:
Set the Correct Time Zone: Head over to the “Server Time Zone” in the WHM interface and make sure it’s set to your local time.
Check Essential Services: Ensure that key services like Apache, MySQL, and cPanel are up and running properly.
Security Configuration
Keeping your server secure is crucial. Here are some things you should do:
Enable the CSF (ConfigServer Security & Firewall): You can install this from the “Plugins” section in WHM. It helps manage security settings.
Configure CSF Settings: Adjust the CSF to allow or block specific IP addresses and ports based on what you need.
Set Up SSL/TLS Certificates: This secures connections to your websites and the cPanel interface.
Enable Two-Factor Authentication (2FA): Adding 2FA for cPanel accounts gives you an extra layer of security.
Email Configuration
cPanel makes managing emails easy. Here’s what you can do:
Set Up Email Accounts: Create and manage email accounts for your domain.
Configure Email Forwarding: Forward emails to another address easily.
Manage Email Filters and Autoresponders: Control which emails get through and set up automatic responses.
Enable Spam Protection and Virus Scanning: Keep your inbox clean and secure.
All these email settings can be found in the “Email” section of cPanel.
Troubleshooting Common Issues with cPanel Installation
When installing cPanel, things might not always go smoothly. But don’t worry!
Here’s how you can tackle some common problems and get things running smoothly.
Installation Errors
If you run into trouble during the cPanel installation, like dependency issues, here’s what you can do:
First, check the installation logs located at /var/log/cpanel to see if there are any error messages or clues that can help you understand what went wrong.
Make sure your server meets all the minimum requirements needed to install cPanel.
If you’re dealing with missing packages, you can try to fix this by running the command:
sudo apt install -f
If the problem doesn’t go away, you might need to try reinstalling cPanel by running the installation script again.
Access Issues
Sometimes, even after a successful installation, you might have trouble accessing the cPanel interface. Here’s what to check:
Double-check that you’re using the correct URL. For WHM, it’s usually https://your_server_ip:2087, and for cPanel, it’s https://your_server_ip:2083.
Make sure that all the necessary services, like Apache and MySQL, are up and running properly.
Look at your firewall settings to ensure that the ports required for cPanel (2083) and WHM (2087) are open and accessible.
If you’ve gone through these steps and still can’t access cPanel, it might be time to consult the cPanel documentation or get in touch with cPanel support for further help.
Conclusion
Congratulations! You’ve just installed cPanel on your Ubuntu Server 20.04 and set up everything you need to manage your web hosting services.
Now, remember to keep your cPanel updated and regularly check your server’s security and performance.
This way, you’ll ensure everything runs smoothly and your hosting experience stays reliable.