Getting Started with cPanel & WHM: Installation, First Login and Common Tasks
First steps with cPanel & WHM on your own server: requirements, installation, first login, hostname change, license refresh, accounts and common paths.
This guide covers the first steps with cPanel & WHM on your own VPS or dedicated server: what the server needs, how to install the software, the first login to WHM, and the tasks new administrators run into most often, such as changing the hostname, refreshing the license, creating an account and finding log files. It applies to current cPanel & WHM releases on AlmaLinux, Rocky Linux, CloudLinux and Ubuntu.
WHM and cPanel: who uses what
WHM (WebHost Manager) is the administrator's interface. You log in as root or as a reseller to manage the server, create hosting accounts and set limits. cPanel is the interface for the owner of a single hosting account, used to manage that account's domains, files, mailboxes and databases. If your provider delivered the server with cPanel & WHM already installed, skip to the first login.
Requirements
- Operating system: a freshly installed, supported system. The cPanel documentation lists AlmaLinux 8, 9 and 10 (AlmaLinux 10 needs cPanel & WHM version 132 or later), Rocky Linux, CloudLinux and Ubuntu 24.04 LTS. CentOS 7 reached end of life in June 2024 and is not a platform for new installations.
- Hardware: a 64-bit x86 processor (ARM is not supported), at least 2 GB of RAM (4 GB recommended) and 20 GB of disk space (40 GB recommended).
- Network: a static public IPv4 address. IPv6-only servers are not supported.
- Hostname: a fully qualified domain name that resolves to the server, for example
server1.example.com. - License: one license per server, tied to its IP address. New installations can use a free 15-day trial.
Two points from the official installation notes matter before you start: there is no uninstaller, so removing cPanel & WHM means reinstalling the operating system, and no other services should be installed on the server before or during the installation.
Install cPanel & WHM
Log in over SSH as root and run the official installer:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
The command downloads the installer for the latest version and runs it. It checks the server's memory first and stops with an error if the minimum is not met. The installation takes a while; run it inside tmux or screen so that a dropped SSH connection does not interrupt it.
First login to WHM
WHM listens on port 2087 over HTTPS. Open it with the server's IP address or hostname:
https://203.0.113.10:2087
Log in as root with the server's root password. Until the hostname has a trusted certificate the browser shows a certificate warning. On the first login WHM asks you to accept the license agreement, enter a contact e-mail address and set the nameservers that new accounts will use. Nameservers must be set, in Basic WebHost Manager Setup, before WHM lets you create accounts. A trial license is activated at this stage through a cPanel Store account with a verified e-mail address.
The account-level cPanel interface listens on port 2083 and webmail on port 2096.
Change the server hostname
Do not change the hostname with the operating system's own tools, because cPanel & WHM stores it in several service configurations. Use one of the supported methods so that all of them are updated.
In WHM, go to Networking Setup » Change Hostname, enter the new name and click Change. Afterwards open DNS Functions » Add an A Entry for Your Hostname to create the matching DNS record.
From the command line, as root:
/usr/local/cpanel/bin/set_hostname server1.example.com
The same change is available through the API:
whmapi1 sethostname hostname=server1.example.com
The hostname must:
- be a fully qualified domain name of 60 characters or fewer that resolves to the server's main IP address;
- use only lowercase letters, not begin with
wwwor a number, and not end with a hyphen; - not be a domain that a cPanel account on the server uses, and not a service subdomain such as
cpanel.example.comorwhm.example.com.
The change takes effect immediately and services that depend on the name, such as the database server, are restarted. Choose the name with care: it appears in the headers of mail sent by the server.
Refresh the license
If WHM reports an invalid license, for example after you bought a license for a server that was running on a trial or after the server's IP address changed, ask the server to fetch its license again. As root:
/usr/local/cpanel/cpkeyclt
The script contacts the cPanel license servers and reports whether the update succeeded. If it fails, check that the license is active for the server's public IP address at verify.cpanel.net and that the server can resolve DNS names and make outbound connections.
Create your first hosting account
In WHM, open Account Functions » Create a New Account and fill in:
- Domain: the account's main domain;
- Username: lowercase letters and numbers, at most 16 characters, not starting with a number;
- Password and a contact Email address;
- Package: an existing package, or select the options manually to set disk, bandwidth and other limits.
Click Create. The account owner can then log in to cPanel at https://server1.example.com:2083. Packages are worth defining early under Packages » Add a Package, so that every account of the same type gets the same limits.
Themes and branding
Current versions use the Jupiter theme for the cPanel interface. The look of cPanel, the login page and webmail is adjusted in cPanel » Customization, where you set logos and colours. Complete custom themes are handled in Themes » Theme Manager, which can install, preview, clone, download and delete custom themes for the cPanel, login and webmail interfaces. The WHM interface itself cannot be themed.
Common paths
| What | Path |
|---|---|
| Account home directory | /home/USERNAME |
| Web root of the main domain | /home/USERNAME/public_html |
| cPanel & WHM installation | /usr/local/cpanel |
| Apache error log | /var/log/apache2/error_log |
| Per-domain Apache access logs | /etc/apache2/logs/domlogs/ |
| cPanel & WHM error log | /usr/local/cpanel/logs/error_log |
| cPanel & WHM access and login logs | /usr/local/cpanel/logs/access_log, /usr/local/cpanel/logs/login_log |
| Exim mail log | /var/log/exim_mainlog |
| MySQL or MariaDB log | /var/log/mysqld.log |
| Update logs | /var/cpanel/updatelogs/ |
Frequently asked questions
Can I move a cPanel license to another server?
A license is valid for one server and is bound to its IP address. When you migrate, the license has to be reassigned to the new IP address by whoever sold it to you; afterwards run /usr/local/cpanel/cpkeyclt on the new server.
Why does WHM refuse the hostname I entered?
The most common reasons are that the name is not fully qualified, does not resolve to the server's IP address, or is already the domain of a cPanel account on the same server.
Should I install a firewall before cPanel?
No. The installation documentation recommends disabling the operating system's firewall before installing and configuring a firewall afterwards. The installer opens the ports the product needs.
Can I install cPanel & WHM on a server that already hosts sites?
No. It must be installed on a fresh operating system, and it takes over the web, mail, DNS and database services. Set up a new server and migrate the sites into cPanel accounts.