cPanel WHM License Changes and Recovery on Ubuntu 24.04

What this tutorial solves
This guide shows you how to handle cPanel WHM license changes on Ubuntu Server 24.04 when a server stops validating its license after a move, IP change, provider handoff, or billing update. On Hostperl-managed and self-managed VPS workflows, this is a common support case: the server is live, WHM is installed, but the license no longer matches the machine’s public IP or the local hostname state.
You will verify the OS, confirm the current license status, repair the hostname and resolver settings if needed, refresh the license safely, and confirm that WHM and cPanel services are healthy again. The same approach also helps after a clean handover from another provider or after a planned address change on a Hostperl VPS. If you are still deciding which platform fits your workload, the Hostperl VPS hosting page is the right place to compare launch-ready servers before you start.
This tutorial is intentionally specific to Ubuntu Server 24.04. cPanel supports Ubuntu on current production tracks, and the steps below use apt, systemd, UFW, and Ubuntu networking conventions. If your server is not running Ubuntu, stop here and follow the equivalent OS-specific process for that platform instead.
Before you change anything
Keep your original root session open until the final verification passes. If you are using a provider that gives you a default non-root account, use that account for day-to-day admin work, but keep a root console available for recovery. That matters here because license troubleshooting can affect hostname and network settings.
On your local computer, connect to the server with the documentation IP below. Replace 203.0.113.10 with the real public IP assigned to your Hostperl server.
ssh root@203.0.113.10If your setup uses a default non-root account, use the same IP with that username instead. Keep the root session open in another tab or terminal until the new login is verified.
ssh deploy@203.0.113.10Confirm Ubuntu and check the current license state
On the VPS as root, identify the operating system first. This keeps you from running the wrong package or firewall commands later.
cat /etc/os-releaseYou should see Ubuntu Server 24.04 details in the output. Then check the cPanel license status directly. cPanel provides a local checker that is the fastest way to tell whether the problem is a real license mismatch or just a temporary update delay.
/usr/local/cpanel/cpkeyclt --checkIf the license is healthy, the command finishes cleanly. If it reports a failure, note whether the problem is an IP mismatch, hostname issue, or network resolution problem. That clue will decide the next step.
You can also query the current WHM status page from the server. A healthy license usually means WHM responds normally on port 2087, while a broken one often returns a license error page instead of the login screen.
curl -kI https://127.0.0.1:2087/Expect HTTP headers, not a connection refusal. A 200 or 302 response is a good sign; a refusal means WHM is not listening or the service stack is down.
Fix hostname and DNS resolution first
cPanel licensing is sensitive to hostname and resolver problems. If the server’s hostname is missing, invalid, or points to a stale name, license refreshes can fail even when the billing side is correct.
Check the current hostname and set a proper fully qualified domain name if required. Use a hostname like server.example.com only as a documentation example; replace it with the real hostname you control.
hostnamectl statushostnamectl set-hostname server.example.comNow confirm the hostname resolves locally. If it does not, fix /etc/hosts so the server can resolve its own name without waiting on external DNS.
nano /etc/hostsAdd or adjust the local entry so it looks like this, replacing the example IP with your server’s real public or local management address as appropriate for your environment:
127.0.0.1 localhost
203.0.113.10 server.example.com serverSave and exit the editor with Ctrl+O, Enter, then Ctrl+X. Verify the change immediately.
getent hosts server.example.comSuccessful output should return the hostname you set. If this step fails, fix DNS or /etc/hosts before moving on. cPanel support cases often stall here because the server can reach the Internet but cannot reliably identify itself.
Refresh the license safely on Ubuntu
Once the hostname is correct, request a new local license lookup. On many servers this is enough to recover a mismatched or recently updated license.
/usr/local/cpanel/cpkeycltExpected result: cPanel should contact the license service and update the local key data. If you see success text, re-check the status right away.
/usr/local/cpanel/cpkeyclt --checkIf the license still fails, verify that the server can reach cPanel’s update services on the network. A DNS or routing issue can block the validation request even when WHM itself is installed correctly.
curl -4 https://httpupdate.cpanel.net/You should get an HTTP response, not a timeout. If the lookup hangs, inspect the server’s default route and DNS settings before retrying.
ip routeresolvectl statusIf the server lacks a default route or has no working DNS servers, restore those settings first. License refreshes will keep failing until the machine can reach the validation endpoint.
Check the WHM and cPanel services
A license problem sometimes hides a separate service issue. Confirm that the main cPanel daemons are running, then inspect logs if the system still refuses to load WHM.
systemctl status cpanel --no-pagerExpect the service to be active. If it is inactive or failed, restart it cleanly after checking logs.
journalctl -u cpanel -n 50 --no-pagersystemctl restart cpanelNow test again from the local host.
curl -kI https://127.0.0.1:2087/If the service is up, WHM should answer on port 2087. If it still fails, check whether the web server stack or firewall is blocking access.
Make sure Ubuntu firewall rules allow WHM
On fresh Ubuntu installs, UFW is often the first firewall you need to check. cPanel WHM uses 2087 for HTTPS administration and 2083 for user cPanel access. If either port is blocked, the service may be healthy but unreachable.
ufw status verboseIf UFW is enabled and the required ports are missing, add them before testing remotely. Do not remove any existing SSH rule until you have confirmed you can still log in on a second terminal.
ufw allow 2087/tcpufw allow 2083/tcpufw allow 22/tcpufw reloadVerify the rule set after reload. You should see 22, 2083, and 2087 open if you plan to use all three services.
ufw status numberedIf you manage servers through a more restrictive control plane, Hostperl’s dedicated server hosting and unmanaged dedicated server options are often a better fit for teams that want full control of firewall policy and remote recovery paths.
Validate access from a second terminal
Open a second terminal on your local computer so you can test real access without losing the first shell. This is the safest way to confirm that you did not lock yourself out while changing firewall or hostname settings.
ssh root@203.0.113.10Replace the documentation IP with the real server address again. Then test WHM from your local machine with a browser or curl. A browser login page is the easiest visual check, but curl is useful when troubleshooting certificates or redirects.
curl -kI https://203.0.113.10:2087/Successful output should show a WHM response or redirect headers. If you get a timeout, re-check UFW and any upstream provider firewall before touching cPanel again.
Rollback and recovery if the license still fails
If the license remains broken after hostname and network checks, roll back the last changes one at a time. Start with the hostname if you set the wrong value, then restore the previous entry in /etc/hosts, then retry the license lookup.
nano /etc/hostsRemove the incorrect hostname line, save the file, and re-run the refresh command.
/usr/local/cpanel/cpkeycltIf the problem only started after a provider migration or IP transfer, ask support to confirm that the license is bound to the current public address. That is a common operational handoff issue on hosted servers, especially when a move happens during a maintenance window. For account-level migrations that accompany license work, our internal guide cPanel account transfer to a new server with DNS cutover covers the clean sequence customers usually need after the base server is healthy again.
Final verification on the server and from your client
Finish with a server-side and client-side check. On the VPS, confirm the license checker now passes and the control panel service is active.
/usr/local/cpanel/cpkeyclt --check
systemctl is-active cpanelYou want a successful license check and the word active. Then confirm WHM responds from your local machine again.
curl -kI https://203.0.113.10:2087/If you can load the WHM login page in a browser and the service reports active, the recovery is complete. It is also worth checking logs once more so you know the fix did not create a hidden warning.
journalctl -u cpanel -n 20 --no-pagerNo new errors should appear after the successful license refresh. At this point you can safely close the original root session and return to normal admin access.
Hostperl supports customers who need reliable control panel operations, not just a one-time fix. If you want a server where panel work, migrations, and recovery are handled with clearer operational ownership, look at Hostperl VPS hosting and dedicated server hosting.
For teams that expect repeatable launches, supportable handovers, and fewer surprises when licenses or IPs change, that difference matters.
Common problems and fast diagnostics
Problem: WHM still shows a license error after cpkeyclt.
Run /usr/local/cpanel/cpkeyclt --check and curl -4 https://httpupdate.cpanel.net/. If the curl request times out, fix routing or DNS first. If curl works, ask your provider to confirm the license is attached to the correct public IP.
Problem: WHM will not load on port 2087.
Check systemctl status cpanel --no-pager and ufw status verbose. If the service is active but the port is blocked, add ufw allow 2087/tcp and reload. If the service is failed, inspect journalctl -u cpanel -n 50 --no-pager.
Problem: hostname checks fail after migration.
Run hostnamectl status and getent hosts server.example.com. If the hostname is wrong, reset it with hostnamectl set-hostname server.example.com and repair /etc/hosts.
Problem: you are locked out after firewall edits.
Use the open root console to run ufw status numbered, confirm SSH is allowed, and only then adjust any additional rules. Never remove port 22 until a second working login is confirmed.
Quick recovery checklist
- Confirm Ubuntu with
cat /etc/os-release. - Check license status with
/usr/local/cpanel/cpkeyclt --check. - Set a correct hostname and verify local resolution.
- Refresh the license with
/usr/local/cpanel/cpkeyclt. - Confirm WHM listens on 2087 and UFW allows it.
- Test from a second terminal before closing the original session.
FAQ
Does this fix work after a server IP change?
Yes, if the license was not updated for the new address and the hostname is valid. If the provider binding is wrong, you still need support to reattach the license to the current IP.
Can I do this without losing WHM access?
Yes. Keep the original root session open, open a second terminal, and confirm access after each change. That is the safest sequence.
Should I restart the whole server?
No. Start with the license checker, hostname, and service status. A reboot is rarely needed and can make recovery harder if the network is not yet fixed.
What if I also need to move accounts after the license is fixed?
Handle the license first, then account migration. For a clean account move and DNS cutover, use the existing Hostperl cPanel transfer guide linked above.
