Portainer Docker Containers For WHMCS
Contents
|
About Portainer Docker Containers For WHMCS
Portainer Docker Containers For WHMCS is a module that connects your WHMCS system with Portainer, allowing you to sell and manage Docker containers just like traditional hosting products. It automates the deployment process, so containers are created, configured, and assigned to clients instantly upon purchase. |
- Admi Area Features:
✔ Create/Suspend/Unsuspend/Terminate Container Or Stack-Based Service |
✔ Change Package |
✔ Start/Stop/Restart Service |
✔ View Service Status And Details |
✔ View Containers Assigned To Stack |
✔ View Published Ports |
✔ View Environment Variables |
✔ View Container Logs |
✔ View, Manage And Show Details Of Action Logs |
✔ View Statistic Graphs: |
✔ Memory |
✔ CPU Usage |
✔ Network Usage |
✔ Disk I/O Usage |
✔ Configure Product Details: |
✔ Provide Product General Configuration: |
✔ Define Default Instance Name |
✔ Define Default Username |
✔ Toggle Opening Container Console In New Window |
✔ Provide App Templates Configuration |
✔ Select Default Application Group |
✔ Select Default Application |
✔ Define Container Limits |
✔ Memory Reservation [MB] |
✔ Memory Limit [MB] |
✔ CPU Limit [Cores] |
✔ Choose Features Available In Client Area: |
✔ Select Available Container Details |
✔ Select Available Stack Details |
✔ Start/Stop/Restart Service |
✔ Reinstallation |
✔ Environment Variables |
✔ Published Ports |
✔ Container Logs |
✔ Console |
✔ Graphs |
✔ Assigned Containers |
✔ Action Logs |
✔ Choose Features Available In Admin Area: |
✔ Service Actions |
✔ Stack Details |
✔ Assigned Containers |
✔ Container Details |
✔ Published Ports |
✔ Environment Variables |
✔ Container Logs |
✔ Graphs |
✔ Action Logs |
✔ Generate Configurable Options |
✔ Configure WHMCS Server Details For Selected Environment |
- Addon Module Features:
✔ View Dashboard With List Of Launched Services |
✔ Configure App Templates: |
✔ Container Applications |
✔ Stack Applications |
✔ Customize Application Details And Logo Images |
✔ Create Application Groups And Assign App Templates |
✔ Manage Media Library With Logotypes For App Templates |
✔ Customize Module Language Files With "Translations" Tool |
✔ View And Manage Logs |
- Client Area Features:
✔ View Container/Stack Status And Details |
✔ Start/Stop/Restart Service |
✔ View Containers Assigned To Stack |
✔ View Published Ports |
✔ View Environment Variables |
✔ View Action Logs |
✔ Reinstall Service With Predefined Templates: |
✔ Container Applications |
✔ Stack Applications |
✔ View Container Logs |
✔ Access Console |
✔ View Container Graphs: |
✔ Memory Usage |
✔ CPU Usage |
✔ Network Usage |
✔ Disk I/O Usage |
- Configurable Options:
✔ Application |
✔ Memory Reservation |
✔ Memory Limit |
✔ CPU Limit |
- General Info:
✔ Supports Docker Lables For Domain Routing Via Traefik |
✔ Multi-Language Support With Custom Translations Tool |
✔ Supports PHP 8.3 Back To PHP 8.1 |
✔ Supports WHMCS V8.13 Back To WHMCS V8.10 |
✔ Requires ionCube Loader V14 Or Later |
✔ Easy Module Upgrade To Open Source Version |
Installation And Confiuration
This tutorial will show you how to successfully install and configure Portainer Docker Containers For WHMCS. We will guide you step by step through the whole installation and configuration process. |
1. Log in to our client area and download the module. |
![]() |
2. Extract the package and upload its content into the main WHMCS directory. The content of the package to upload should look like this. |
![]() |
3. When you install Portainer Docker Containers For WHMCS for the first time you have to rename 'license_RENAME.php' file. The file is located in 'modules/servers/PortainerDockerContainers/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'. |
![]() |
4. In order to configure your license key, you have to edit the previously renamed 'license.php' file. Enter your license key between quotation marks as presented on the following screen. You can find your license key in our client area → 'My Products'. |
![]() |
5. Now, set up the 'storage' folder as recursively writable. This folder is available at '/yourWHMCS/modules/addons/PortainerDockerContainers/'. |
![]() |
Addon Activation
6. Now you have to activate the module in your WHMCS system. Log in to your WHMCS admin area. Go to 'System Settings' → 'Addon Modules'. Afterwards, find 'Portainer Docker Containers' and press the 'Activate' button. |
![]() |
7. In the next step, you need to permit access to this module. To do so, click on the 'Configure' button, tick 'Full Administrator' and press 'Save Changes'. |
![]() |
8. You have just successfully installed Portainer Docker Containers For WHMCS! You can access your module under 'Addons' → 'Portainer Docker Containers'. |
![]() |
Configuration of Server
9. Now, log in to your WHMCS and proceed to 'System Settings' → 'Servers' and press 'Add New Server'. |
![]() |
10. Fill in the Name, provide the Hostname or IP Address in both fields at the top (filling in both Hostname and IP Address fields is required to proceed). In the Server Details section:
|
![]() |
![]() |
11. It is time to create a server group. To do so, click on 'Create Server Group'. |
![]() |
12. Enter a name, click on your previously created server, press 'Add' and afterward 'Save Changes'. |
![]() |
Configuration of Product
13. In order to create and configure a product, go to 'System Settings' → 'Products/Services'. Click on 'Create a New Group' . |
![]() |
14. Enter a product group name and press 'Save Changes'. |
![]() |
15. When you have a product group, you can create your product. To create a product click on 'Create a New Product' . |
![]() |
16. Afterward, choose your product group, module and type from the dropdown menus, enter your product name and press 'Continue'. 'Product Type' should be set to 'Shared Hosting'. |
![]() |
App Templates
Before continuing to the product's settings, you must ensure you have at least one application or group of applications ready to use. Proceed to the addon module → App Templates section and follow below instruction to create a ready application that will be installed by default on the server. The App Templates section allows you to manage Docker-based applications that clients can deploy to their containers or stacks directly from the client area. |
Applications
This section allows you to load available templates from your connected Portainer environment and manage them within WHMCS.
|
![]() |
Once templates are imported, you can use action buttons to edit, duplicate, or delete them. Mass actions are also available for bulk management. |
![]() |
Groups
With the templates ready, all that is left is to gather them into groups and include said groups into products. Navigate to 'App Templates' → 'Groups' and click on the 'Create' button. |
![]() |
Read the information, then provide the group with:
|
![]() |
You can use the action button and the mass action function to edit and delete template groups. |
![]() |
Your basic configuration of App Templates is now ready. For more advanced configuration, manual creation guides please refer to App Templates Advanced Configuration section in this documentation. For now, go back to your product's module settings and complete the configuration there. |
Module Settings
17. Now, go to the 'Module Settings' section, choose your previously created server group from the dropdown menu. The module should automatically save and reload settings. If not, click on 'Save Changes' manually. |
![]() |
18. Proceed to 'Configuration' section and adjust the following:
|
![]() |
19. Proceed with 'App Template Configuration'.
App Templates Configuration - To create instances based on stack or container applications, you must first configure the App Templates in the module's addon.
|
![]() |
20. Set up 'Container Limits':
Alternatively, you can use configurable options to allow clients to define these limits at checkout. |
![]() |
21. Next, select the features that will be available in the client area:
|
![]() |
22. Select the features that will be available in the admin area. These options define what information and controls admins will see within the WHMCS service management page:
|
![]() |
23. At the end of the configuration process, you can decide whether to generate configurable options for the product. Configurable options allow clients to customize container parameters individually during the order process. If no configurable options are defined, the fixed values set in the product configuration will be used instead. Available Configurable Options:
|
![]() |
![]() |
Your product configuration is now complete. Do not forget to save the changes once ready. Before adding it to your offer, make sure to set appropriate pricing. Create as many products as needed, each with different applications or feature sets, to tailor your offer perfectly. |
![]() |
Management
Portainer Docker Containers For WHMCS allows your clients to manage and monitor their Docker containers directly from the WHMCS client area. In this short guide, you'll learn about the module's key features and how to configure them for both client and admin use. |
Module Addon
The module addon is the central place for all administrative setup and management.
Here, you can register products supported by the module, manage Docker templates, and access various utilities such as the media library, translation manager, and module logs. |
App Templates Advanced Configuration
Please see the App Templates for basic configuration, here you will find instructions for advanced users on how to manually manage existing container and stack application templates. Admins can manually edit applications, define their runtime behavior, set default values, and customize input fields in the "Setting Details" section. |
Default Stack Configuration
When a stack application is created without a custom Docker Compose configuration (template_stack_file is left empty), the module uses the default templates from Portainer's official repository.This behavior relies on two built-in variables:
These two values are automatically combined to form the full link to the stack definition: https://github.com/portainer/templates/blob/master/stacks/wordpress/docker-compose.yml |
![]() |
You can preview all default stack templates directly here. To customize the default stack, simply copy the Docker Compose content from the original URL and paste it into the |
Using Environment Variables in Custom Templates
If you're using a custom Docker Compose config in the template_stack_file field, you can introduce dynamic environment variables.These are made available to the client so they can enter values during deployment. To ensure these are parsed correctly:
|
![]() |
{literal}MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}{/literal} Important: Skipping the |
![]() |
Setting a Default Terminal Command
In both stack and container application templates, you can configure a terminal_command value.This determines the default command executed when the client accesses the container’s console. Available values (based on Portainer console options):
If the default command is not compatible with the container image, you can override it by editing the |
![]() |
Traefik Labels in Container Applications
Portainer Docker Containers For WHMCS supports the Traefik reverse proxy to automatically expose deployed containers and stacks via domain-based routing. This is achieved using dynamic Docker labels set in the application template (Container Applications) or docker-compose.yml files (Stack Applications).
|
To configure Traefik for a container-based application, go to the App Templates → Applications tab in the addon module, edit your container application, and navigate to the labels setting details. |
![]() |
Add the following labels as individual settings. You can use Smarty variables like {$hosting.id} or {$hosting.domain} for dynamic route generation:
traefik.enable=1 traefik.docker.network=bridge traefik.http.routers.service-{$hosting.id}.entrypoints=web traefik.http.routers.service-{$hosting.id}.rule=Host(`{$hosting.domain}`) traefik.http.routers.service-{$hosting.id}.service=service-{$hosting.id} traefik.http.services.service-{$hosting.id}.loadbalancer.server.port=80 The application will be deployed with these labels automatically. The placeholder variables will be parsed at runtime, ensuring correct values for each service. Important: Make sure that both the Traefik container and the newly created service are attached to the same Docker network (e.g., |
![]() |
Traefik with Stack Applications
Stack-based applications can also be configured with Traefik by modifying the template_stack_file field in the App Template form.
|
![]() |
You must supply a full and valid docker-compose.yml script with the required Traefik labels.
Below is an example that exposes a WordPress stack through Traefik: version: '2' services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always network_mode: bridge environment: MYSQL_ROOT_PASSWORD: {literal}${MYSQL_DATABASE_PASSWORD}{/literal} MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: strongpassword ports: - "{$hosting.id}6:3306" wordpress: image: wordpress:latest network_mode: bridge ports: - "8{$hosting.id}:80" restart: always environment: WORDPRESS_DB_HOST: {$params.serverip}:{$hosting.id}6 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: strongpassword labels: traefik.enable: "true" traefik.docker.network: "bridge" traefik.http.routers.service-{$hosting.id}.entrypoints: "web" traefik.http.routers.service-{$hosting.id}.rule: "Host(`{$hosting.domain}`)" traefik.http.routers.service-{$hosting.id}.service: "service-{$hosting.id}" traefik.http.services.service-{$hosting.id}.loadbalancer.server.port: "80" volumes: db_data: |
![]() |
Media Library
The media library allows you to upload images for use elsewhere in the module by admins and clients. To upload a new picture, click on the 'Upload Image' button. |
![]() |
You can delete images one by one by clicking on them. To delete all images at once, use the additional action button. |
![]() |
Translations
Customizing language files is now extremely easy with the "Translations" tool that is now available directly in the addon. Its user-friendly design makes managing various language file tweaks a smooth and efficient process. Prepare translations for the original English files with this handy built-in tool. For specific instructions on how to use this tool please refer to its dedicated article, you will find it here. |
![]() |
Logs
The 'Logs' tab is where the module logs are stored. You can filter the module logs by type with the 'Show' buttons:
All information on Logs can be found in the dedicated Logs article. |
![]() |
Dashboard
The 'Dashboard' provides information and statistics related to the functions of the module.
Press "i" to see service details. |
![]() |
Admin Area
Stack-based product type view:
|
![]() |
Container-based product type view:
|
![]() |
Ordering
Owing to configurable options, you are able to offer a product that your clients can tailor according to their needs. Additionally, you are able to set up pricing for each configurable option, which makes your offer even more competitive. |
![]() |
Client Area
With Portainer Docker Containers For WHMCS, clients can fully manage their Docker containers and stacks directly from the WHMCS client area. They can view service information, monitor performance, execute key actions, and deploy applications, all without needing direct access to Portainer. Service Actions that can be performed on either Stack or Container based product type: start, stop, and restart |
Stack View
Below, you can see what the product might look like for the client "Stack" type with assigned Containers. Service Actions that can be performed on Stack-based product: start, stop, and restart. |
![]() |
"Assigned Container" to Stack view. Clicking on a container from the stack view opens a dedicated detail panel with full technical insight.
|
![]() |
Container View
Users can effortlessly start, stop, or restart their containers using intuitive action buttons (Start, Stop, and Restart).
|
![]() |
Action Logs
The Action Logs section tracks all actions performed on the container or stack, such as starting, stopping, reinstallation, and template deployments. This information provides clients with a history of operations for their services. |
![]() |
Console
An integrated console available for clients to execute commands directly within their container's environment. The console can be opened directly in the WHMCS client area or in a separate tab. |
![]() |
Container Logs
Clients have access to detailed container logs. |
![]() |
Graphs
Real-time graphs display vital metrics such as CPU usage, memory consumption, disk I/O, and network activity, allowing clients to monitor their container's performance. |
![]() |
Reinstallation
Clients can reinstall their container or stack using predefined application templates, enhancing the process of resetting or changing their environment.
Important: Reinstalling an application will permanently remove any existing container data. |
![]() |
If required, fill in any fields related to the selected application. Some templates may ask for additional parameters (e.g. database password), while others may not require any input. Once you're ready, confirm the action to proceed with reinstallation. Important: Reinstalling an application will permanently delete all existing container or stack data. |
![]() |
Tips
1. If you |
Update Instructions
An essential guidance through the process of updating the module is offered here. Ensure successful completion of the module update by carefully following each step, thereby preventing data loss or any unforeseen issues. |
Upgrade Guide
Seeking a solution that offers greater flexibility, customization tailored to your precise needs, and unrestricted availability? There is an option that not only proves to be cost-effective in the long run but also includes prioritized support services, making it a truly valuable investment. Opt for the Open Source version of your Portainer Docker Containers For WHMCS module to unlock these benefits. Follow a comprehensive guide covering the transition process, the advantages it brings, and step-by-step instructions on what to do next after the order has been successfully finalized. |
Common Problems
1. When you have problems with connection, check whether your SELinux or firewall does not block ports. |