cPanel & WHM
Hosting and reseller accounts on cPanel & WHM: the WHM API token, the product fields, every module command, one-click sign-in, usage and troubleshooting.
The cPanel & WHM module builds hosting and reseller accounts on a cPanel server through WHM API 1. When an order is paid it creates the account, and later it suspends, unsuspends, changes the package, changes the password and removes it, reads disk and bandwidth use, and gives a one-click sign-in to cPanel. It is a free provisioning module for hosting companies whose servers run cPanel & WHM. How services, servers and the service page work in general is in Services and servers.
Switching it on
- Setup → Addon Modules: cPanel & WHM is built in. If it is off, press Activate.
- Setup → Servers → Add: make the server (below) and press Test Connection.
- Setup → Products / Services: open the product, tab Module Settings, choose cPanel & WHM, pick the server group and fill in the product settings.
The server
| Field | What to enter for cPanel |
|---|---|
| Name, Hostname, IP Address | The hostname is used first; the IP address when the hostname is empty. |
| Module | cPanel & WHM. Save once to load the module's own fields. |
| Username | root, or a reseller. Empty means root. |
| Access Hash / API Token | A WHM API token (or the old access hash). It is sent as Authorization: whm USER:TOKEN. Spaces and line breaks are removed. |
| Password | Used only when there is no access hash: the module then signs in with basic authentication. A token is the safer choice. |
| Secure and Port | Secure on. The port is empty or 2087, WHM's port. |
The token and the password are stored encrypted. The module does not check the server's certificate, because WHM often runs on a self-made one. Make the token in WHM under Development → Manage API Tokens (or as the reseller). If you restrict it by address, allow your billing server's IP address. A 403 answer means the token is wrong or this server's IP address is not allowed.
Product settings
On the product's Module Settings tab:
| Setting | Meaning |
|---|---|
| Package | The WHM package (plan) name, exactly as it is in WHM. |
| Feature list | Optional. A WHM feature list name; empty uses the package's own. |
| Dedicated IP | Yes: give each account its own IP address, taken from the free IPs of the server. The address is saved on the service as its Dedicated IP. |
| Reseller account | Yes: make the account a reseller that owns itself. |
| Reseller ACL list | The reseller privilege list name (WHM > Reseller ACL). Used only for resellers. |
What each command does
| Command | Effect on the server |
|---|---|
| Create | Creates the account with the service's username, domain, password and the client's e-mail, the package as plan, the feature list, a dedicated or shared IP, CGI on and shell access off. For a reseller it then sets up the reseller (owning itself) and applies the ACL list. |
| Suspend / Unsuspend | Suspends with the reason you gave, or switches back on. |
| Terminate | Removes the account. |
| Change Password | Sets a new password. |
| Change Package | Moves the account to the product's package. A product with no package gives The product has no WHM package set. |
| Login to Control Panel | A one-time cPanel session link; if none can be made, the link opens cPanel's sign-in page on port 2083. |
| Usage | Once a day the cron reads disk use and limit and bandwidth of every account. |
Typical workflow
- A client orders hosting and pays. With Automatic Setup on payment (the default) the module runs Create.
- The account exists, the service turns Active and the welcome e-mail with the username, password and domain goes out.
- An unpaid renewal suspends the service; payment unsuspends it. See Automation.
- The client reaches cPanel from their service page with Login to Control Panel.
- Terminate removes the account when you end the service.
Testing
Press Test Connection on the server form. A good answer reads Connected to WHM, version (number). Then create a cheap test package in WHM, a product that uses it, order it as a test client, pay the invoice by hand with Add Payment, and watch the account appear in WHM. Try Suspend, Unsuspend, Change Password and Terminate.
Troubleshooting
Every call is written to Utilities → Module Log (module cpanel); press View for the request and the answer. A failed create, suspend or unsuspend also e-mails the administrators.
| Message | Cure |
|---|---|
| The server has no access hash or password. | Fill Access Hash / API Token. |
| WHM could not be reached: ... | Wrong host or port, a firewall that blocks 2087 (also CSF or a host firewall), or no curl. |
| WHM answered with something that is not JSON (HTTP 403). Check the access hash and that this server's IP is allowed. | The token is wrong, or your billing server's IP address is not allowed on the WHM side. |
| WHM: ... with a reason | WHM refused: a package that does not exist, a user name that is taken or reserved, or a domain that already exists on the server. |
| The service has no domain name. / no user name. | Fill the fields on the service page and retry. |
More in Troubleshooting.
Was this helpful?
Updated 2026-11-03