WHMCS

Connect WHMCS to cPanel/WHM with the server module

Add a WHM server in WHMCS with an API token, create a server group, test the connection and enable automatic account creation, suspension and termination.

IntermediateWHMCS3 min read

The cPanel module lets WHMCS create, suspend, unsuspend, upgrade and terminate hosting accounts on your WHM server automatically. This works with a root WHM server and with a WHM reseller account, which is what most resellers use. Once connected, a paid order turns into a live cPanel account without any manual work.

Before you start

  • WHMCS installed and configured.
  • WHM access: root, or a reseller or master reseller account such as an MdmHost reseller plan.
  • The WHM server hostname, for example server1.example.net, with a valid SSL certificate.

Create an API token in WHM

  1. Log in to WHM.
  2. Go to Development → Manage API Tokens.
  3. Click Generate Token.
  4. Enter a name such as whmcs.
  5. Leave Expiration empty or set a long date, and grant only the ACLs WHMCS needs (account creation, suspension, package listing, password change) – or all ACLs your reseller account has.
  6. Click Save and copy the token. WHM shows it only once.

Add the server in WHMCS

  1. Go to Configuration → System Settings → Servers.
  2. Click Add New Server.
  3. Choose the Module: cPanel.
  4. Enter the Hostname or IP Address of the WHM server.
  5. Enter the Username (root or your reseller user) and paste the token into API Token.
  6. Click Test Connection. A success message confirms WHMCS can talk to WHM.
  7. Click Continue and complete the details:
    • Name – a label for you.
    • Nameservers – the nameservers customers should use (your private nameservers if you have them).
    • Maximum No. of Accounts – how many accounts WHMCS should place on this server.
    • Secure – tick to use SSL on port 2087.
  8. Click Save Changes.

Create a server group

  1. On the Servers page, click Create New Group.
  2. Name it, for example cPanel Germany, and add the server.
  3. Set Fill Type to Add to the least full server or Fill active server until full.
  4. Save.

Select this group in each product's Module Settings tab; see create hosting products.

Import existing accounts

If accounts already exist on the server, go to Utilities → Tools → Server Sync Tool (or Import Accounts), select the server and import them as services linked to clients. This lets WHMCS bill and manage them from now on.

Test automation

  • Create a test order, mark it paid and confirm the account appears in WHM.
  • On the service page in WHMCS, try Suspend, Unsuspend and Change Password.
  • Use Login to cPanel on the service page to confirm single sign-on works.

Troubleshooting

  • Connection failed / 401: the token is wrong or expired, or the user name does not match the token's owner.
  • SSL certificate verification failed: use the server's hostname (which has a valid certificate) rather than its IP.
  • Access denied for createacct: your reseller account lacks the privilege or is at its account limit.
  • Firewall blocks: the WHMCS server IP must be allowed to reach port 2087. Provide the IP to your host if needed.
  • Always check Utilities → Logs → Module Log for the exact API response.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.