Skip to main content

Server Configuration

Configure your cPanel/WHM server to work with cPanel Premium for WHMCS.

WHM API Setup

Generate API Token

  1. Login to WHM as root
  2. Navigate to Development → Manage API Tokens
  3. Click Generate Token
  4. Enter a name (e.g., "WHMCS Integration")
  5. Click Generate
  6. 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

  1. Go to WHMCS Admin → Setup → Servers
  2. Click Add New Server
  3. Configure:
FieldValue
NameDescriptive name
Hostnameserver.example.com
IP AddressServer primary IP
Usernameroot
PasswordLeave empty
Access HashPaste API token
TypecPanel Premium
Secure✓ Enabled
  1. Click Save Changes

Test Connection

  1. After saving, click Test Connection
  2. Verify successful connection
  3. Check error logs if connection fails

Firewall Configuration

Ensure these ports are open:

PortProtocolPurpose
2086TCPWHM (HTTP)
2087TCPWHM (HTTPS)
2082TCPcPanel (HTTP)
2083TCPcPanel (HTTPS)
2095TCPWebmail (HTTP)
2096TCPWebmail (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:

  1. In WHMCS server settings, check Secure
  2. Ensure WHM has valid SSL certificate
  3. Verify port 2087 is accessible via HTTPS

Self-Signed Certificates

If using self-signed SSL:

  1. WHMCS may require certificate verification disabled
  2. 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:

  1. Create cPanel account in WHM
  2. Assign reseller privileges
  3. Configure ACL list
  4. Set resource limits

ACL Configuration

Create ACL for resellers:

  1. WHM → Resellers → Edit Reseller Nameservers and Privileges
  2. Or create ACL: Resellers → Manage Reseller ACL Lists
  3. 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:

  1. WHM → Server Configuration → Tweak Settings
  2. 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