Docker Portainer for WHMCS provisions and manages Docker stacks through an existing Portainer installation. It includes a server module for service lifecycle actions and an addon for global settings and backup history. It does not install Portainer or prepare the Docker host for you.
Before installing
- Have a working WHMCS installation and a module release compatible with its PHP environment. Install the required ionCube Loader if your delivered package is encoded.
- Prepare a Portainer CE or BE 2.x environment you administer and confirm that WHMCS can reach its API.
- Create a Portainer API token under My Account → Access Tokens. Keep the token private.
- Find the Docker environment's Endpoint ID. In a URL such as
https://portainer.example.com/#!/endpoints/3, the ID is3. - Prepare S3-compatible storage if you intend to offer backups, and Traefik if you intend to use the supplied web-facing templates with domain routing.
Install and connect
- Upload the release's module directories into the WHMCS root, preserving
modules/addons/portainer_for_whmcs_config/andmodules/servers/portainer_for_whmcs/. If the archive has afiles/wrapper, upload its contents, not that wrapper. - Open System Settings → Addon Modules, activate Docker Portainer, configure the license and assign administrator access.
- Open System Settings → Servers → Add New Server. Select
portainer_for_whmcsas the server module. - Enter the Portainer hostname without a URL path. Use port
9443for direct HTTPS or your configured API port; leave the port empty for a normal reverse-proxy URL. Enable Secure when using HTTPS. Port9000is for deployments intentionally using HTTP, not an HTTPS default. - Leave Username blank, place the Portainer API key in Password and the Environment/Endpoint ID in Access Hash.
- Use Test Connection. Fix certificate, hostname, port or reachability errors rather than bypassing TLS verification.
- For several environments, create a server record for each and place them in the appropriate WHMCS Server Groups.
Global configuration
Open the Portainer addon settings and enter the Traefik network name, S3 endpoint, bucket, access key and secret. Set backup retention and the available scheduling options. Keep the normal WHMCS cron running for scheduled backups, quota checks, health checks, cleanup, metrics and client cron jobs.
Backups run through temporary worker containers on the Docker host. They dump supported databases, archive configured volumes and upload to S3; WHMCS coordinates the work and stores metadata. Downloads use presigned S3 URLs. This avoids routing the archive through PHP, but host capacity, worker failures, network access and storage limits can still cause failures. Test both backup and restore.
Create a product
- Create the WHMCS product and choose Docker Portainer as its module.
- Assign the correct server or Server Group.
- Choose a supplied stack template, a Portainer app template or Custom Docker Image.
- For a custom image, supply the image name, port mappings, environment variables, restart policy and network mode.
- Enable Backups, Console and File Manager only where your product should expose them. Set backup paths and database options for the actual application.
- Configure resource options and test provisioning, suspension, unsuspension and termination on a disposable service before offering the product.
Environment variables use one KEY=VALUE per line and support {PASSWORD}, {SERVICE_ID} and {DOMAIN}. Stack templates also support {TRAEFIK_NETWORK} and named passwords such as {PASSWORD:database}. Reuse the same named password when two template values must match; separate plain {PASSWORD} occurrences generate separate values.
Backup Paths can be left blank for auto-detection. Database Dump Command can also use auto-detection for supported MySQL or PostgreSQL layouts; Database Container identifies the database service, commonly db. Verify the detected values for each template.
Traefik and domains
- Deploy Traefik according to its current documentation, with a shared Docker network and the entrypoints and certificate resolver expected by your templates.
- Use the same network name in the addon, the product override if set, and the Docker host. The supplied examples use
traefik-public. - Configure the certificate resolver and persistent certificate storage, and make the required public web ports reachable.
- Point each customer domain at the correct Docker host address and verify routing and certificate issuance after provisioning.
The module is not a replacement for host networking and proxy administration. Confirm compatibility between your Docker and Traefik releases. A socket proxy is an optional way to restrict Docker API access, not a universal fix tied to one Docker version.
Resource options
Create a Configurable Options group, assign it to the product and use Dropdown options named Memory (MB), CPU Cores and Disk (MB). The aliases memory_mb, cpu_cores and disk_mb are also accepted. Set numeric choices and your own WHMCS prices.
Without configured limits, the module does not impose those product resource limits. Disk is a monitored quota, not a hard filesystem allocation: the scheduled check can stop an over-quota stack and mark its WHMCS service Suspended after excess usage is detected. Monitor host capacity separately and do not promise that customers cannot exceed the threshold between checks.
Customer tools and access
The client interface includes stack status, resource usage, logs, a Compose view, environment editing, domains, database details, metrics and an audit log, with optional console, file manager and backups. Environment changes can redeploy a stack. Restore, reinstall and file deletion can replace or remove customer data, so back up first.
Allowed Commands accepts one console command per line; blank means unrestricted commands. With a whitelist set, the console rejects shell metacharacters. Treat this as a console control, not a complete isolation boundary: file editing and scheduled commands are separate capabilities. Only enable tools appropriate for the service and host design.
Templates, updates and troubleshooting
Add custom .yml stacks under modules/servers/portainer_for_whmcs/stacks/. For language changes, use lang/overrides/ or a translated language file. Back up all custom stacks, language files and Smarty templates before an update. Replacing files can overwrite same-named customizations; there is no blanket preservation guarantee.
- Back up the database and module directory.
- Compare the new package with your custom files and upload the replacement module files.
- Open the addon to complete any required updates. Clear the WHMCS template cache if changed templates remain stale.
- Retest API connection, a disposable service lifecycle, customer access and backup/restore.
- For connection failures, check the server fields, Endpoint ID, certificate trust and network access.
- For missing images or failed deployment, check the selected template, custom image field and Portainer stack error.
- For backup failures, check the worker status and logs on the Docker host, bucket access and configured paths.
- For missing HTTPS, verify public DNS, shared networks, Traefik labels and certificate resolver configuration.
Review WHMCS module logs without sharing API keys, S3 credentials or signed download URLs. Use Portainer documentation, Traefik documentation or ArkHost support for the relevant component.