Server Configuration
Configure your cPanel/WHM server to work with cPanel Premium for WHMCS.
WHM API Setup
Generate API Token
- Login to WHM as root
- Navigate to Development → Manage API Tokens
- Click Generate Token
- Enter a name (e.g., "WHMCS Integration")
- Click Generate
- Copy the token immediately - it won't be shown again
API Token Permissions
The API token should have access to:
- Account Functions
- DNS Functions
- Email Functions
- Package Functions
- SSL Functions
- Backup Functions
Add Server in WHMCS
- Go to WHMCS Admin → Setup → Servers
- Click Add New Server
- Configure:
| Field | Value |
|---|---|
| Name | Descriptive name |
| Hostname | server.example.com |
| IP Address | Server primary IP |
| Username | root |
| Password | Leave empty |
| Access Hash | Paste API token |
| Type | cPanel Premium |
| Secure | ✓ Enabled |
- Click Save Changes
Test Connection
- After saving, click Test Connection
- Verify successful connection
- Check error logs if connection fails
Firewall Configuration
Ensure these ports are open:
| Port | Protocol | Purpose |
|---|---|---|
| 2086 | TCP | WHM (HTTP) |
| 2087 | TCP | WHM (HTTPS) |
| 2082 | TCP | cPanel (HTTP) |
| 2083 | TCP | cPanel (HTTPS) |
| 2095 | TCP | Webmail (HTTP) |
| 2096 | TCP | Webmail (HTTPS) |
CSF Firewall
If using ConfigServer Firewall:
# Add WHMCS server IP to whitelist
csf -a YOUR_WHMCS_IP
iptables
# Allow WHMCS server
iptables -A INPUT -s YOUR_WHMCS_IP -p tcp --dport 2087 -j ACCEPT
SSL Configuration
Enable SSL for API
Always use secure connections:
- In WHMCS server settings, check Secure
- Ensure WHM has valid SSL certificate
- Verify port 2087 is accessible via HTTPS
Self-Signed Certificates
If using self-signed SSL:
- WHMCS may require certificate verification disabled
- Add to WHMCS configuration.php:
$WHMCSDisableSSLVerify = true;
warning
Only use this in development. Production should use valid SSL.
Reseller Configuration
Create Reseller Account
For reseller products:
- Create cPanel account in WHM
- Assign reseller privileges
- Configure ACL list
- Set resource limits
ACL Configuration
Create ACL for resellers:
- WHM → Resellers → Edit Reseller Nameservers and Privileges
- Or create ACL: Resellers → Manage Reseller ACL Lists
- Enable required features
Recommended ACL permissions:
- create-acct (Create accounts)
- suspend-acct (Suspend accounts)
- list-accts (List accounts)
- passwd (Change passwords)
- quota (Modify quotas)
Performance Optimization
API Rate Limiting
WHM has API rate limits. For high-volume operations:
- WHM → Server Configuration → Tweak Settings
- Adjust API rate limits if needed
Caching
cPanel Premium caches certain data to improve performance:
- Domain lists
- Package information
- Server statistics
Cache is automatically cleared when changes occur.
Troubleshooting
Connection Refused
- Verify firewall allows WHMCS IP
- Check WHM is running:
service cpanel status - Verify port 2087 is open
Authentication Failed
- Verify API token is correct
- Check token hasn't expired
- Ensure username is "root" for full access
SSL Errors
- Verify SSL certificate is valid
- Check hostname matches certificate
- Try disabling SSL verification temporarily
Timeout Errors
- Check server load
- Verify network connectivity
- Increase PHP timeout in WHMCS