Skip to content
Shahid Malla

WHMCS cPanel Integration: Setup, API Token and Common Errors

Connect WHMCS to a cPanel and WHM server and keep it working: ports, a scoped API token, package mapping, server groups, single sign-on, Sync Accounts, and a table of the errors the module returns.

· Published · Updated · 11 min read · 11 steps
WHMCS cPanel Integration: Setup, API Token and Common Errors

WHMCS cPanel integration means adding your cPanel & WHM server at Configuration > System Settings > Servers with the built-in cPanel module, a WHM username and an API token, then pointing each hosting product at one WHM package. WHMCS can then create, suspend, unsuspend, terminate, change the package and reset the password. Almost every failure traces to a port, a token privilege or a package name.

The cPanel module ships with WHMCS and talks to WHM's remote API, on port 2087 when the server's Secure setting is on and 2086 when it is off. It turns a paid order into a real hosting account, then keeps both systems in step: package changes, password resets, usage figures, suspension and termination. The same module serves a root login and a rented reseller account.

Every menu path, privilege name and error string below is checked against the WHMCS and cPanel & WHM documentation on 30 November 2026. The WHMCS documentation index, read the same day, lists 9.1 as General Availability, with an anticipated end-of-life date of 30 September 2027. Long-Term Support 9.0 ends 31 December 2026 and 8.13 ends 31 January 2027.

Five-step workflow for WHMCS cPanel integration: check WHM, create a scoped API token, add the server, map each product to a WHM package, then test one order end to end
The order I work in when I connect WHMCS to a cPanel server. Source: shahidmalla.com.

In words: check WHM, scope a token to one IP address, add the server, map each product to one package, then run one account through its whole life before customers can order.

This is the server-side guide. WHMCS reseller hosting covers licenses and branding, how to set up WHMCS covers a first configuration, and VPS provisioning covers virtual servers.

What does the built-in WHMCS cPanel module actually do?

It supports eight actions, and the WHMCS cPanel module documentation names them: create, suspend, unsuspend, terminate, change package, change password, usage updates and a client area link. The server needs a valid cPanel & WHM license.

Two neighbors in the same module menu get confused with it. WP Squared has its own module; aim this one at a WP Squared server and you get This module requires a cPanel & WHM server with a valid license and the 'Standard' server profile. Nova Experience on cPanel is a separate entry too, so read the menu before you pick.

What do you check in WHM before you connect anything?

Three settings, then one question that changes the rest of the job: does your WHM login hold root?

  • Ports 2086 and 2087 open outbound from the WHMCS server: 2086 without SSL, 2087 with it.
  • At least one package, created at Home > Packages > Add a Package.
  • Two-factor authentication off for API calls. In WHM as root, open Security Center > Configure Security Policies and untick API requests. The module cannot answer a 2FA prompt.
Comparison of a root WHM login and a rented reseller WHM account in WHMCS: product types, token privileges, package naming, hidden packages, per-account quotas and overselling
What changes between a root WHM login and a rented reseller account. Source: docs.whmcs.com, read 30 November 2026.
What changesRoot WHMReseller WHM account
Product typesShared and Reseller HostingShared Hosting only
Extra token privilegeviewglobalpackagesOnly privileges you hold
Package name to enterThe name shown in WHMThe username_packagename form
Packages missing from the menuRareHidden once they exceed your quota
Per-account quotas, oversellingYours to setNeed root

How do you create the WHM API token WHMCS needs?

In WHM at Development > Manage API Tokens, with Generate Token. WHMCS accepts a password or a token, and I use a token.

  1. Name it. Up to 50 characters, letters, numbers, dashes and underscores.
  2. Choose whether it expires. An expiry date defaults to one year ahead and fires at 11:59:59 PM server time. Expired tokens stop working but are not deleted.
  3. In the IPs box, enter the WHMCS server's IP address. CIDR ranges work, up to 100 entries. A blank box lets any address use it.
  4. Untick every privilege outside the list below. One has to stay ticked.
  5. Click Generate and copy the token. WHM never shows it again.
SituationPrivileges WHMCS asks for
Every cPanel serverbasic-whm-functions, basic-system-info, cpanel-api, create-acct, create-user-session, suspend-acct, upgrade-account, kill-acct, passwd, acct-summary, list-accts, show-bandwidth, cpanel-integration, list-pkgs, ns-config, edit-mx, manage-api-tokens, ssl-gencrt
The token belongs to rootAdd viewglobalpackages
Configurable Package Addon in useAdd edit-account
You sell Reseller HostingEverything, because reseller API functions need root

The cPanel documentation on API tokens adds three cautions the WHMCS page does not. Privilege restrictions are still described as experimental. Create User Session and Manage API Tokens each let a holder work around the restrictions you set, and WHMCS asks for both. And no token can be created for a suspended account, the quiet reason this step fails on a reseller plan behind on payment.

How do you add the cPanel server in WHMCS?

At Configuration > System Settings > Servers with Add New Server, or on a fresh install at Configuration > Getting Started Wizard. Choose cPanel, enter the hostname or IP address, the WHM username and the token, then click Test Connection. Save Changes from there, or Go to Advanced Mode for the remaining fields.

The Servers documentation lists every field. These four change behavior:

SettingWhat it controls
Maximum No. of AccountsThe only capacity figure WHMCS knows. It sets the use percentage and decides when a server is full.
SecureTurns on SSL, which moves the connection from 2086 to 2087.
NameserversUsed in welcome emails and domain registration. Up to five, with IP addresses.
Server Status AddressThe URL of the status folder from the WHMCS ZIP. Blank disables monitoring.

Two habits save trouble. On your only cPanel server, click its name and check an asterisk appears, marking it the default. And disable any server you take offline: one left enabled but unreachable can make the daily usage statistics update fail.

How do you map WHM packages to WHMCS products?

Each product names exactly one WHM package in its Module Settings tab, at Configuration > System Settings > Products/Services. Set Product Type to Shared Hosting, Module Name to cPanel, then pick the plan in WHM Package Name. The name must match WHM character for character, so a rename in WHM produces You do not have permission to use Selected Package. On a reseller account, use the username_packagename form.

  • No WHM package. Leave WHM Package Name empty, click Switch to Advanced Mode and type the limits. A blank setting means unlimited.
  • Reseller Hosting. Enter limits in advanced mode and name an existing WHM ACL for Reseller ACL List. Set the reseller limits, overselling toggles and Reseller Ownership too, or the product ships with no ceiling.
  • Charging resellers per account. Toggle Sub-Accounts to On under Metric Billing. Bill Resellers Per Account allows a flat price per account, tiered volume pricing, or a quantity included free. The count is a snapshot taken on the next due date, so the documentation recommends monthly cycles.

The bottom of the same tab decides when WHMCS actually creates the account. I set mine to wait for the first payment, because creating it the moment an order arrives hands a live account to anyone who abandons checkout.

How do server groups decide which server gets the order?

A server group is a set of servers a product provisions onto, created with Create New Group on the Servers page and assigned in the product's Module Settings tab. The server groups documentation gives two fill types: least full server, by percentage of Maximum No. of Accounts in use, or fill the default until it hits that limit. Both count accounts and ignore disk, load and memory, so a wrong account limit quietly overloads a box. A group of one should use the least-full type.

How do you test one order before real customers arrive?

Run one account through its whole life on a test client, in this order, before automatic suspension goes on.

  • Add an order from the admin area and accept it.
  • Click Create under Module Commands, then check the account in WHM for the right package and owner.
  • Log in to cPanel from the service page, proving single sign-on before a client tries it.
  • Change the package, then the password, and confirm both in WHM.
  • Suspend, unsuspend, then terminate with Keep DNS Zone unticked.
  • Check that Utilities > Module Queue is empty.
  • Wait for one daily cron run and confirm usage figures arrived.

That last step depends on the cron, not cPanel: figures arrive on the daily run when Update Usage Statistics is ticked under Miscellaneous in Automation Settings. My WHMCS cron jobs guide covers that side.

How do you give clients and staff one-click access to cPanel?

Clients get it from Services > My Services, and staff from the server list or WHMCS Connect. The single sign-on documentation explains most failures with three rules: a client user needs the View Products & Services and Perform Single Sign-On permissions; an admin can sign in to any account owned by the WHM user saved on that server, narrowed by setting Access Control to Restricted under SSO Access Control; and on a reseller account you must own the account, or you get Action Failed Unable to auto-login. Please contact support. An empty username on the service gives the same message.

WHMCS Connect, at Utilities > WHMCS Connect, loads each panel in a frame so staff move between servers without logging in again. Access needs the WHMCS Connect admin role group permission, which by default only Full Administrator admins hold. Two further constraints, the browser and a blocking WHM header, explain nearly every blank frame; both are in the questions below.

How do you import cPanel accounts that already exist?

With the Sync Accounts button on the Servers page. WHMCS fetches the account list and shows server data on the left and its own matches on the right, differences in red. Ticking Import/Sync does one of three things, according to the Sync Accounts documentation: an account only on the server becomes a new service; a service only in WHMCS is set to Terminated; and a record in both with different details is rewritten in WHMCS to match the server, across the domain, IP address, username, product, status and creation date.

Client matching is the part that bites. An imported service joins the client with a matching email address, or a new client when there is none. With no email address at all, WHMCS generates a placeholder from the domain name. Find those before any billing email goes out.

Which errors does the cPanel module return, and what causes each?

The module page and Troubleshooting Server Issues each keep a table of them. These are the ones I actually meet, with the documented cause.

MessageDocumented cause
Curl Error - Couldn't connect to host (7)A firewall is blocking a necessary port, or the calling IP address is not whitelisted.
Login FailedWrong login details, or brute force protection.
Access Denied or Permission DeniedThe server refused the action. Check the token privileges.
You do not have permission to use Selected PackageThe package name does not exactly match WHM.
Product attribute Package Name XXX not found on serverToo few resources, a mistyped name, or missing privileges.
Package Not Allowed or Exceeded Resource/Account AllocationReseller access only, with no valid package name.
Sorry, a group for that username already existsThat username is already on the server.
Sorry, that username is reservedThe username contains a prohibited word.
No user name supplied: username is a required argumentThe username field on the service is empty.
Invalid value paper_lantern for the cpmod settingThe product names a theme the server does not have.
CURL Error: 56 - OpenSSL SSL_readEasyApache 4 updates running on the server.
Decision flow for a cPanel account WHMCS will not create: fix the connection first, then match package names, pick a free username, delete a kept DNS zone, or read the Module Queue
How I trace a cPanel account that WHMCS will not create. Source: shahidmalla.com, from my own routine.

In words: a failing Test Connection means ports, login or token first. A package name that differs has to be made identical, a taken or reserved username swapped, a kept DNS zone deleted. Otherwise read Utilities > Module Queue, which holds the error text for every failed action, then the Module Log at Configuration > System Logs, which records nothing until you enable it. My WHMCS troubleshooting guide covers the wider log layout.

What are the limits and risks of this integration?

Four things can hurt you, and none of them announces itself.

  • The token is close to a root password. Create User Session and Manage API Tokens are both required, and either lets the holder work around your restrictions. Lock it to one IP address.
  • Sync Accounts writes data. It can terminate services and create products and clients in one click. Back up the database and read every row first.
  • Nothing retries itself. A failed action sits in the Module Queue until someone clicks Retry. If nobody watches it, a paying customer waits.
  • A kept DNS zone blocks re-creation. No new account for that domain until the zone is deleted. Useful during a migration, a trap the rest of the time.

The honest limit: the module provisions and bills, and that is all. How the account behaves afterwards is custom work.

What else do people ask about WHMCS cPanel integration?

Does WHMCS need root access to create cPanel accounts?

Not for shared hosting. A reseller WHM account with a scoped token can create, suspend, unsuspend, terminate and upgrade the accounts it owns. Root is needed for Reseller Hosting products, per-account quotas and overselling.

Should WHMCS log in to WHM with a password or an API token?

Either works, and I use a token. It can be limited to a privilege list and to the WHMCS server's IP address, and revoking it does not touch the root password. The catch: no token can be created for a suspended cPanel account.

Why does a WHM package not appear in the WHMCS product menu?

Because the WHM API only returns packages you are allowed to provision, and one that would exceed your reseller quota is hidden. Missing WHM Packages gives the check: in WHM at Account Functions > Create a New Account, the package shows a Cannot use due to limits error.

Why does WHMCS Connect show an empty frame?

Usually the browser or the headers. It supports Firefox and Safari, not Chromium-based browsers such as Chrome. It also needs an iframe, so in WHM at Server Configuration > Tweak Settings set Use X-Frame-Options and X-Content-Type-Options headers with cpsrvd to Off.

I do this work inside larger projects rather than as an install service; see WHMCS development and hosting infrastructure consulting, with a free scoping call of about 30 minutes and a written quote within one business day.

Last reviewed 30 November 2026. Disclosure: I am a freelance WHMCS developer and I sell WHMCS and hosting automation work, so I am not neutral. I am CTO at ElySpace, a freelance developer for Marmaids LLC, and founder of WHMCSPilot and MagizAI.

Share this article

Shahid Malla

Written by

Shahid Malla

Freelance WHMCS developer and web designer with 13+ years of client work. CTO at ElySpace, freelance developer for Marmaids LLC, and founder of WHMCSPilot and MagizAI.

Got a project like this?

Tell me what you need and I will send a written quote within one business day.