PUQ Mautic

Docker modules

This section contains instructions related to Docker modules, including setup, configuration, and integration with various services.

Technical Disclaimer & Limitation of Liability

By using any PUQ Docker modules, you acknowledge and agree that you are solely responsible for the deployment, administration, maintenance, and security of your infrastructure. PUQcloud assumes no liability for any issues arising from the use, misconfiguration, or failure of any PUQ Docker module.

Required Knowledge & Responsibilities

To use PUQ Docker modules, you must have the necessary expertise in system administration, troubleshooting, and configuration, including but not limited to:

  1. Linux Server Administration

    • You must have experience managing servers running Linux-based operating systems.
  2. Web Protocols & Proxy Management

    • Understanding web proxies, specifically Nginx proxy.
    • Knowledge of SSL certificate management and HTTP/HTTPS protocols.
  3. Networking & Security

    • A solid understanding of networking protocols: TCP, UDP, DNS, HTTPS, and any others relevant to your infrastructure.
    • You are responsible for implementing firewall rules, DDoS protection, access control, and security hardening for all components of your system.
  4. Containerization & Docker Management

    • Proficiency in Docker, including networking, container communication, and orchestration.
    • You are responsible for securing your containers, including protection from unauthorized access, vulnerabilities, and data leaks.
  5. Bash Scripting & Automation

    • Experience with Bash scripting and Linux automation is required.
    • You must know how to create, mount, and unmount virtual disks.
  6. Server & Infrastructure Management

    • You are fully responsible for managing your Docker server, including:
      • Performing regular backups and disaster recovery planning.
      • Monitoring server load and performance.
      • Troubleshooting and resolving any infrastructure-related issues.
    • You must develop your own automation scripts for migrations, system recovery, and other administrative tasks.
  7. Software Maintenance & Updates

    • You are responsible for administering, restoring, and updating software running within your Docker containers.
    • You must understand the responsibility boundaries between you, PUQcloud, and third-party container providers.
    • If an update to our module or a third-party software breaks your configuration, you are responsible for troubleshooting and resolving the issue.

Scope of PUQcloud's Responsibility

PUQcloud only provides:

PUQcloud does NOT provide:

n8n Server Requirement

Limitation of Liability

Final Acknowledgment

By using PUQ Docker modules, you confirm that:

  1. You understand and accept full responsibility for the operation, maintenance, and security of your infrastructure.
  2. You have the necessary technical knowledge to manage Linux, networking, Docker, and automation.
  3. You will not hold PUQcloud liable for any technical failures, security breaches, data loss, or business disruptions.

Installing Docker for PUQcloud modules

Installing Docker on Debian 12

The WHMCS Docker n8n module requires a Debian 12 server with Docker installed to function properly. This guide provides step-by-step instructions for setting up Docker and configuring the necessary environment.


πŸ“Œ Prerequisites

βœ”οΈ A physical or virtual machine running Debian 12
βœ”οΈ A public IP address for the server
βœ”οΈ A domain for web applications managed by the module
βœ”οΈ DNS Configuration: Create an A record pointing all subdomains to the server's IP:

*.your_domain A server_ip

πŸš€ Installation Steps

1️⃣ Install Required Utilities

Before installing Docker, update the system and install essential tools:

sudo apt-get update  
sudo apt-get install sudo sqlite3 apache2-utils jq -y  

2️⃣ Configure Sudo Access

Allow passwordless sudo access for the user connecting to the Docker server:

Edit the sudoers file:

sudo nano /etc/sudoers

Add the following line (replace your_username with your actual username):

your_username ALL=(ALL:ALL) NOPASSWD: ALL

3️⃣ Install Docker

# Update package index
sudo apt update  

# Install dependencies
sudo apt install apt-transport-https ca-certificates curl software-properties-common  

# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg  

# Add Docker repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null  

# Update package list
sudo apt update  

# Install Docker
sudo apt install docker-ce  

# Verify Docker status
sudo systemctl status docker

# Install Docker compose
sudo apt install docker-compose-plugin

4️⃣ Deploy Required Containers

Create a Docker Compose file for nginx-proxy and Let's Encrypt companion:

sudo mkdir -p /opt/docker/nginx-proxy
sudo mkdir -p /opt/docker/nginx-proxy/certs
sudo mkdir -p /opt/docker/nginx-proxy/nginx
sudo mkdir -p /opt/docker/nginx-proxy/html
sudo mkdir -p /opt/docker/nginx-proxy/vhost.d
cd /opt/docker/nginx-proxy
nano docker-compose.yml

Paste the following content:

version: "3"

services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /opt/docker/nginx-proxy/certs:/etc/nginx/certs:ro
      - /opt/docker/nginx-proxy/nginx/vhost.d:/etc/nginx/vhost.d
      - /opt/docker/nginx-proxy/nginx/html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - web

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    restart: always
    container_name: letsencrypt-nginx-proxy-companion
    volumes:
      - /opt/docker/nginx-proxy/certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    volumes_from:
      - nginx-proxy
    networks:
      - web

networks:
  web:
    driver: bridge

Save and exit (CTRL + X, then Y, then ENTER).

Run the containers:

docker-compose up -d

This setup provides:
βœ”οΈ nginx-proxy – Automatic HTTP/HTTPS proxy for container web interfaces
βœ”οΈ Let's Encrypt Companion – Automatic SSL certificate generation for subdomains


βœ… Final Checks

  1. Confirm Docker is running:
    docker ps
    
  2. Verify nginx-proxy logs:
    docker logs nginx-proxy
    
  3. Ensure Let's Encrypt certificates are being generated correctly:
    docker logs letsencrypt-nginx-proxy-companion
    

Β 

Client Container Concept and Structure

Container Deployment

In our deployment scenarios, we use Docker Compose for managing client containers.

Important Directories

The nginx-proxy directory must remain unchanged. Its path is:
/opt/docker/nginx-proxy

This directory contains essential components:

List of required directories:

/opt/docker/nginx-proxy /opt/docker/nginx-proxy/certs /opt/docker/nginx-proxy/nginx /opt/docker/nginx-proxy/html /opt/docker/nginx-proxy/vhost.d

Client Container Data Directories

Each client container has its own data directory. The base path for storing user-related Docker files and disk images can be set individually for each n8n workflow involved in service management.

image-1741877612840.png

Within this directory, subdirectories are created based on the primary domain name of the service. The domain acts as a reference point for the entire service.

Each service directory contains:

image-1741877565421.png

Before a container starts, the data.img file is mounted into the system using n8n automation. The necessary entries are added to /etc/fstab, ensuring that containers automatically restart after a server reboot.

Β 

Why Does a Timeout Error Occur on the First SERVICE in WHMCS/WISECP?

Instructions for Preparing Docker Images Before First Service Deployment

Background

When ordering a service for the first time, Docker needs to download all the necessary containers for the service to run. This process may cause timeout issues with WHMCS or WISECP modules.

To avoid potential timeout problems, we recommend downloading all required container images before the first service deployment through the WHMCS or WISECP billing systems.

Steps to Follow:

  1. Identify all container images needed for the service.

  2. Open a terminal or command prompt on the server where Docker is installed.

  3. For each required image, run the following command:

    docker pull [image_name]:[tag]
  4. Verify that all images have been successfully downloaded by running:

    docker images
  5. Once all images are downloaded, proceed with the service deployment through WHMCS or WISECP.

Benefits

By following these instructions, you can preemptively address potential issues and ensure a more reliable service deployment process.