This article provides a guide for how to link your reseller server to WHMCS for automated provisioning of services.
Linking your reseller server to WHMCS enables automated provisioning, simplifying the management of hosting accounts. This guide outlines the steps to integrate a WHM/cPanel server module into WHMCS, ensuring seamless account creation, suspension, termination, and more.
Prerequisites
Before you begin, ensure you have:
- WHMCS Installed: A fully configured WHMCS installation.
- Reseller Access: WHM/cPanel reseller access with API permissions.
- Server Details: Hostname or IP address of the server and WHM reseller username.
- SSL Certificate: An SSL-secured WHMCS installation for secure data transfer.
How to Link Your Reseller Server to WHMCS for Automated Provisioning
-
Generate API Token in WHM
WHMCS uses an API token to communicate with your WHM server.
- Log in to your WHM account.
- Navigate to Development → Manage API Tokens.
- Click Generate Token.
- Enter a token name (e.g., “WHMCS Integration”) and configure optional expiration and IP restrictions.
- Set the token’s permissions (e.g., full reseller privileges).
- Click Create and copy the API token. Store it securely as it won’t be shown again.
-
Add the Server in WHMCS
Now, configure your WHMCS installation to recognize your WHM server.
- Log in to your WHMCS Admin Dashboard.
- Navigate to Configuration → System Settings → Servers (or Setup → Products/Services → Servers in older WHMCS versions).
- Click Add New Server.
- Fill in the required details:
- Name: Enter a name for the server (e.g., “Reseller Server”).
- Hostname: Enter the server hostname or IP address.
- IP Address: Enter the server’s primary IP.
- Type: Select cPanel from the dropdown.
- In the Server Details section:
- Username: Enter your WHM username (usually your reseller username).
- Password/Token: Paste the API token you generated.
- Secure: Check this box to enable SSL.
- Click Test Connection to verify the server credentials. If successful, proceed to the next step.
-
Configure the Server Group (Optional)
If you have multiple servers, you can organize them into a server group.
- Go to Configuration → System Settings → Servers.
- Click Create New Group.
- Assign a name to the group and add your server(s) to it.
- Configure the Fill Type:
- Fill: WHMCS fills one server before moving to the next.
- Load Balance: WHMCS distributes accounts across servers evenly.
-
Set Up a cPanel Product in WHMCS
To enable automated provisioning, create a hosting product linked to your server.
- Navigate to Configuration → System Settings → Products/Services.
- Click Create a New Product.
- Choose the following:
- Product Type: Hosting Account.
- Product Group: Select or create a product group.
- Product Name: Name your hosting product.
- Go to the Module Settings tab:
- Module Name: Select cPanel.
- Server Group: Choose the server or group you configured earlier.
- Configure additional settings such as:
- Package Name: Enter the WHM package name. (See guide: Add A Hosting Package in WHM)
- Account Creation Options: Set options for username, domain, and password generation.
- Save changes.
-
Test the Configuration
Ensure everything is working correctly by placing a test order.
- Create a test client in WHMCS.
- Order the product you just configured.
- Check the following:
- WHMCS creates the account in WHM.
- The account is visible in WHM → List Accounts.
- WHMCS sends an automated welcome email to the client.
-
Automate Account Management
WHMCS can automate other account management tasks.
- Navigate to Configuration → System Settings → Automation Settings.
- Set up automation for:
- Account Suspension: WHMCS suspends overdue accounts.
- Account Termination: WHMCS terminates long overdue accounts.
- Cron Job: Configure the WHMCS cron job to run daily to manage tasks.
Troubleshooting
If you encounter issues:
- Connection Error: Verify the hostname/IP, username, and API token.
- Provisioning Failure: Ensure the WHM package name matches the product settings in WHMCS.
- SSL Issues: Confirm both WHM and WHMCS installations are using valid SSL certificates.
Best Practices
- Regularly rotate your API tokens for security.
- Monitor server resource usage to avoid overloading.
- Keep your WHMCS and WHM installations updated.
By following this guide, you can seamlessly integrate your WHM/cPanel reseller hosting account with WHMCS, enabling efficient and automated hosting account management.