If you run a server and want an easy way to manage websites, emails, and domains, cPanel/WHM is a good option. In this guide, I’ll show you how to install cPanel/WHM on a CentOS server. I’ll keep things simple and explain each step so you can follow along, even if you’re new to this.
cPanel is a web-based control panel that helps you manage websites. It has a simple interface, so you don’t need to use the command line for everything. You can create email accounts, manage files, add domains, and more.
WHM stands for Web Host Manager. It’s the admin side of cPanel. If you’re hosting multiple websites, WHM gives you tools to manage users, monitor the server, and control resources.
I’ve used cPanel/WHM for years, especially when helping friends and small businesses. It saves time and makes server management less stressful.
What You Need Before You Start
Let’s make sure you have everything ready:
- A fresh CentOS 7 or CentOS 8 server (minimal install is best).
- At least 2 GB of RAM (4 GB is better).
- A valid hostname (not just an IP address).
- Root access (or a user with sudo).
- A static IP address.
cPanel works best on a clean system. If you already installed Apache, Nginx, or MySQL, it might cause problems.
Step 1: Set the Hostname
Your server needs a valid fully qualified domain name (FQDN). That means something like server.example.com
.
Run this command to set it:
hostnamectl set-hostname server.example.com
Replace server.example.com
with your own domain.
To make sure it worked:
hostname
If your domain doesn’t point to your server yet, you can update your DNS settings with your provider. Some hosting companies do this for you.
Step 2: Update Your Server
It’s always a good idea to update your system before installing new software.
yum update -y
This makes sure all packages are current. It also avoids conflicts later.
Step 3: Disable SELinux and NetworkManager
cPanel doesn’t work well with SELinux or NetworkManager. You can turn them off like this:
Edit the SELinux config file:
nano /etc/selinux/config
Change this line:
SELINUX=enforcing
To:
SELINUX=disabled
Save and exit. You’ll need to reboot later.
Then disable NetworkManager:
systemctl stop NetworkManager
systemctl disable NetworkManager
And enable network
service instead:
systemctl enable network
systemctl start network
Step 4: Install Perl and Curl
You’ll need Perl and Curl before you can install cPanel.
yum install perl curl -y
Perl is a scripting language that cPanel uses. Curl helps download files from the internet.
Step 5: Download and Run the cPanel Installer
Now we’re ready to download the cPanel installer script. It’s an automatic installer — just run it and it does most of the work for you.
Move to the home directory:
cd /home
Download the script:
curl -o latest -L https://securedownloads.cpanel.net/latest
Then run it:
sh latest
This step takes a while — usually 30 to 60 minutes. Grab some coffee or check your email while you wait.
When it’s done, cPanel/WHM will be installed and ready to set up.
Step 6: Access WHM in Your Browser
Once the install finishes, open your browser and go to:
https://your-server-ip:2087
You’ll see a login page. Use:
- Username:
root
- Password: your root password
If your browser shows a warning about the certificate, it’s okay — just click “Advanced” and continue.
You’ll go through a short setup wizard. It will ask you for:
- Contact email
- Hostname (again)
- DNS resolvers
- IP address setup
Just follow the steps. Most of it can be left with default settings if you’re not sure.
Step 7: License and Activation
cPanel is not free, but you get a 15-day trial when you first install it.
The installer should activate the trial automatically. If not, run this command:
/usr/local/cpanel/cpkeyclt
After that, WHM should say your license is active.
Step 8: Create a cPanel Account
In WHM, search for “Create a New Account”.
This is where you’ll set up your first website. It asks for:
- Domain name
- Username
- Password
- Package (leave default if unsure)
Click “Create” and you’re done.
Now go to:
https://your-server-ip:2083
This is the cPanel login page. Use the username and password you just created.
You can now manage your website, upload files, set up email, and more.
Three Lists to Help You Along the Way
Tools and Commands You’ll Use
yum
— to install and update packagescurl
— to download the cPanel scripthostnamectl
— to set your server’s hostnamesystemctl
— to manage services like NetworkManagernano
— to edit config files
Common Problems (And Fixes)
- Can’t access WHM in browser? Check if port 2087 is open in your firewall.
- Hostname error? Make sure it’s a valid domain and not just
localhost
. - License not working? Try running
/usr/local/cpanel/cpkeyclt
again.
Benefits of Using cPanel/WHM
- You don’t need to remember long terminal commands.
- You can manage multiple websites from one dashboard.
- It’s easier to set up SSL, emails, and backups.
My Thoughts
When I first started managing servers, I used only the command line. It worked, but it was slow and sometimes frustrating. Once I tried cPanel, things got easier. I could give other people access without worrying they’d break something. It’s a good tool, especially if you manage websites for clients.
That said, cPanel can be a bit heavy. It uses more RAM than a basic LAMP stack. So, I only use it when I really need a full control panel — not on small personal projects.
What about you? Are you managing a few websites or running a hosting business? cPanel might save you time.
Summary
Installing cPanel/WHM on CentOS is pretty simple if you follow the steps. You start by prepping your server, then run the auto-installer, and finish setup through your browser. It gives you a user-friendly way to manage your web server without diving into the terminal every time.
Let’s recap what you learned:
- How to set a valid hostname.
- How to disable things that conflict with cPanel.
- How to install and run the cPanel script.
- How to access WHM and create your first cPanel account.
I hope this guide helps you get started. If you hit any bumps, let me know — I’ve probably run into them too.