Add a server to WHMCS
Connect your WHMCS installation to a WebGee reseller or VPS server using a WHM API token, so it can create and manage cPanel accounts automatically.
Connect WHMCS to your hosting server so it can create, suspend and terminate cPanel accounts automatically when customers order. Applies to reseller accounts and to VPS or dedicated servers with WHM.
Use an API token, not your WHM password. A token can be revoked on its own and restricted to specific IP addresses, and it does not change when you rotate your password.
1. Generate an API token in WHM
- Sign in to WHM.
- Go to Development → Manage API Tokens.
- Select Generate Token.
- Name it something identifiable —
whmcs— and select the privileges it needs. - Copy the token.
The token is shown once. If you navigate away without copying it, you must generate a new one.
Restrict the token to your WHMCS server's IP address while you are here — see Restrict WHM API tokens by IP. A token that works from anywhere is a standing key to your whole server.
2. Add the server in WHMCS
-
In the WHMCS admin area, go to Setup → Products/Services → Servers.
-
Select Add New Server.
-
Fill in:
Field Value Name Anything identifiable, e.g. webgee-uk-1Hostname The server's hostname IP Address The server's main IP Assigned IP Addresses The IPs available to accounts on it Type cPanel Username Your WHM username — rooton a VPS, your reseller username otherwiseAccess Hash / API Token The token from step 1 -
Leave Password empty. It is not used when a token is supplied.
-
Tick Secure to connect over SSL, and set the port to
2087.
3. Test the connection
Select Test Connection before saving. WHMCS reports success or the exact error.
Save only once the test passes — saving a server that cannot connect means orders fail at provisioning time, after the customer has paid.
If the test fails
Invalid username or token— the username must match the account the token was generated under. A token made underrootdoes not work with a reseller username.- Connection refused or timeout — port
2087is blocked between your WHMCS server and the hosting server, or the token is IP-restricted to a different address. Access denied— the token lacks a required privilege. Regenerate it with account creation and management permissions.
Related
Enable SSH for a customer's account
Grant SSH access to a cPanel account from WHM, either for one account or for every account on a package.
Fix the "please wait while your request is being verified" loop
WHMCS hangs verifying a request because a Cloudflare page rule strips the cookie Imunify360's captcha needs. Fix the page rule, not WHMCS.