How to connect WHMCS to the control panel (provisioning module)
On this page
With the WHMCS module, WHMCS creates accounts when an order is paid, suspends and unsuspends them, changes packages and passwords, terminates cancelled services, and gives customers a Log in to Control Panel button. Disk and bandwidth usage show in WHMCS.
Before you start
- The server's hostname needs a valid SSL certificate: the module checks it. See Server Settings → Issue hostname certificate.
- An API token. As administrator, create one in API Tokens (section Account). A reseller can use their own token; WHMCS then manages only the reseller's accounts. See create an API token. Limit it to the WHMCS server's IP address.
- Add the WHMCS server's IP address to the Whitelisted IPs of Brute Force Protection: a wrong token can otherwise get its address blocked.
Install the module
- In the admin panel, open API Tokens and click Download the WHMCS module. You get
whmcs-hostpanel-module.zip. - Unpack it in your WHMCS folder. It creates
modules/servers/hostpanel/hostpanel.php.
Add the server in WHMCS
- In WHMCS, add a new server (System Settings → Servers).
- Hostname: the server's hostname, for example
server1.example.com. - Module: Hosting Panel.
- Access Hash: the API token.
- Tick Secure and use port
2087. - Click Test Connection. It reads the package list; a success means the token works.
Set up your products
In each hosting product, open Module Settings, choose Hosting Panel and pick the Package. The list comes from the server; it is the package name exactly as in the panel.
What WHMCS does
| In WHMCS | On the server |
|---|---|
| Create | Creates the account with the service's username, domain, password and the client's email |
| Suspend / Unsuspend | Suspends with the WHMCS reason / unsuspends |
| Terminate | Deletes the account for good |
| Change Password | Sets the new password |
| Upgrade / Downgrade | Moves the account to the product's package |
| Log in to Control Panel | Opens a one-time sign-in link, valid 60 seconds |
| Usage update (daily cron) | Copies disk and bandwidth used and their limits |
Every call is logged in WHMCS's module log, without passwords or the token.
Common questions
Account creation fails with "Username must be 2-16 characters…"
The username WHMCS generated does not fit the server's rule: 2–16 lowercase letters and digits, starting with a letter. Change it on the service and click Create again.
Account creation fails with "Package not found."
The product's package does not exist under that exact name for the token's owner. An administrator's token creates accounts only on the administrator's own packages. Pick the package again in Module Settings.
Test Connection fails with a certificate error
WHMCS connects to the hostname over HTTPS and verifies the certificate. Use the hostname, not the IP address, and make sure its certificate is valid.
Test Connection answers "Unauthorized" or "IP blocked"
See API errors.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- How to create an API token for scripts and billing
Create an API token in the admin panel or the control panel for the REST API or a billing system, copy it once, see when it was last used, and revoke it.
- How to restrict an API token (IP addresses, expiry, read only)
Limit an API token to your billing server's IP addresses, let it expire after 7 to 365 days, or make it read only, and the errors you get when a limit applies.
- Connect Blesta, HostBill and other billing systems (json-api)
Use the /json-api interface on port 2087 to provision hosting from Blesta, HostBill and other billing systems: functions, parameters and examples.
- API returns 401 Unauthorized, 403 or IP blocked
Fix API errors: 401 Unauthorized, expired token, address not allowed, IP blocked after failed attempts, read-only token, missing privilege and 422.