How to Install CPanel on Ubuntu and CentOS
CPanel is a hosting control panel. It is extremely popular. For hosting related tasks it makes normal systems administration incredibly easy. It is a very popular tool. If you have ever bought a shared hosting account, you have probably used it. I would think of it as an industry standard. Personally, I don’t use it as I just run my own NGINX and Apache servers on private droplets. If you are looking to run a hosting company or provide hosting to other people, this is probably the way to go.
- You need a license for full functionality
- A free trail is available
WARNING - There is no uninstall script. The “uninstall method” is to reformat the server.
CPanel Ports
It is worth knowing what ports CPanel runs on. You will see different ports for cPanel and WHM. You will also see different ports for HTTPS ( SSL ) and regular HTTP. This results in 4 ports. This is just for basic CPanel stuff. Other services that end up being installed will have different ports for example if you add FTP, mail, and other things, these will all use different ports.
2082 | cPanel |
2083 | cPanel - SSL |
2086 | WHM |
2087 | WHM - SSL |
How To Install CPanel on CentOS
Before you get started, make sure that you have everything you need.
- A supported OS: CentOS 6/7, RHEL 6/7, and CloudLinux 6/7
- Root access
- A freshly installed server. Existing installed services can cause issues.
- A public IP. You can test it but won’t be able to license it without a public IP.
Installation is pretty easy. You just have to run a script. You can actually download and run this script in one command.
curl -o latest -L http://httpupdate.cpanel.net/latest && sh latest
Web UI Setup Steps
Assuming your server has an IP like 192.168.3.22 you can access cPanel/WHM by going to either of these in your browser:
OR
Use your root user and password to login. Once logged in it will lead you through the process.
From here on it is a pretty wild ride so get ready….
- Agreement
This is just the license agreement. Just accept and click next.
-
Setup Networking
-
You are going to need to provide it with the following information:
- Server Contact Email Address - This is where notifications will be sent.
- This Server’s Hostname - Just your server hostname.
- Primary Resolver - This will be your first DNS server. For example ns1.example.com.
- Secondary Resolver - This will be your second DNS server. For example ns1.example.com.
- Select the main network/Ethernet device - This is the network interface you want to use. It is set to eth0 by default.
-
‘Save and Go to Step 3’
-
- Setup IP Addresses
- Add additional IPs if you want or just skip this if you don’t.
- ‘Save and Go to Step 4’
- Name Server setup
- Fill in your name servers here. For example: ns1.example.com, ns2.example.com.
- ‘Save and Go to Step 5’
- Services
- FTP servers
- ProFTPD
- PureFTPD (default)
- Disabled
- Mail server
- Dovecot (default)
- Courier
- Configure cPHulk Brute Force Protection - enable this for extra protection if you like.
- Save and Go to Step 6
- FTP servers
- Quotas
- You can select to enable or disable quotas
- Finish Setup Wizard
How To Install CPanel on Ubuntu
OK, so you want to install CPanel on Ubuntu? Unfortunately it isn’t supported on Ubuntu. CPanel only supports CentOS, CloudLinux, RHEL, or an older version of Amazon Linux. That doesn’t mean that it can’t be done though. People report having done this and having success.
References