Immich Docker Deployment and Management API for WHMCS/WISECP - n8n Workflow

Use this robust n8n workflow as an API backend to automate the deployment, monitoring, suspension, and termination of Immich Docker containers. Essential n8n templates for hosting providers using WHMCS or WISECP.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Hosting Providers offering containerized applications (like Immich).
System Administrators managing multi-tenant Docker environments.
Users of the PUQcloud WHMCS or WISECP modules requiring a functional backend API.
DevOps teams needing a customizable n8n workflow for infrastructure automation.

Overview

This specialized n8n workflow acts as the control panel backend API, designed to interface with billing systems like WHMCS or WISECP, typically using a dedicated module from PUQcloud. The core problem this n8n template solves is bridging the gap between customer billing actions (provisioning, changing packages, terminating service) and real-time operations on a remote Docker server.

Upon receiving a command through the n8n trigger (Webhook), the workflow dynamically generates complex BASH scripts. These scripts execute low-level system operations via the n8n SSH node, handling everything from creating disk image files (fallocate, mkfs.ext4), mounting them via /etc/fstab, deploying the Immich stack via docker compose, managing NGINX proxy settings (ACLs), and gathering detailed runtime statistics and logs. This comprehensive n8n solution ensures reliable, scalable hosting automation.

How it Works

This powerful n8n workflow starts with a secure Webhook API configured with Basic Authentication, acting as the primary n8n trigger. The process flows as follows:


  1. Trigger & Parameters: The process begins when the API node receives a POST request containing the desired action command (e.g., create, suspend, containerstart) and user/service details (domain, disk size, CPU, RAM).

  2. Validation: An initial If n8n node verifies the serverdomain against predefined parameters for security and correct routing.

  3. Command Routing: Multiple Switch n8n nodes (Service Actions, Container Actions, Container Stat, Immich) analyze the incoming command parameter to direct the flow to the specific logic branch.

  4. Script Generation: Dedicated Set n8n nodes (like Deploy, Suspend, ChangePackage) dynamically construct highly complex, parameterized BASH scripts. These scripts utilize data from the incoming request (e.g., {{ $('API').item.json.body.domain }}) and internal configuration settings defined in the Parametrs n8n node. The scripts handle tasks like generating the docker-compose.yml file and Nginx configuration snippets.

  5. Remote Execution: The generated script is passed to the SSH n8n node, which connects to the remote Docker server and executes the command with root privileges (sudo).

  6. Response Processing: The Code1 n8n node captures the standard output or error messages from the SSH session. It parses custom JSON or success/error flags returned by the BASH script, translating it into a standardized JSON response format.

  7. Final Output: The API answer n8n node sends the processed, structured JSON output back to the external system (WHMCS/WISECP), completing the requested operation.

Installation Guide

To deploy this comprehensive n8n workflow, follow these setup steps:


  1. Import Workflow: Import the provided n8n workflow JSON into your self-hosted or cloud n8n instance.

  2. API Credential Setup: Configure the API n8n trigger node. You must create a new Basic Auth Credential. This credential is vital for securing the API endpoint against unauthorized access. Record the Webhook URL and the Basic Auth details, as these will be used in your WHMCS/WISECP module configuration.

  3. SSH Credential Setup: Locate the SSH n8n node and create a new SSH Password or SSH Private Key Credential. This credential must allow access to the target Linux server running Docker where Immich will be deployed. Ensure the user associated with this credential has necessary sudo permissions to manage Docker and file system resources (mounts, directories, etc.).

  4. Parameter Configuration: Navigate to the Parametrs Set n8n node and update the default values:

serverdomain: Set this to the public domain name of your Docker server.
clients
dir: Define the path on the Docker server where client configuration directories will be created.
* mount_dir: Define the base path for disk image mounting (usually /mnt).

Node Details

This advanced n8n workflow utilizes several key nodes for its functionality:

API (Webhook Trigger) n8n node: The entry point for the entire n8n workflow. It listens for POST requests on a specific path (/docker-immich) and uses Basic Auth for security. This is the main n8n trigger.
Parametrs (Set) n8n node: Used for defining global configuration variables (like server paths and domain verification strings). This centralizes critical settings for the entire n8n workflow.
If n8n node: Used immediately after parameter setting to validate that the incoming request targets the correct server domain, ensuring the integrity of the n8n workflow execution.
Service Actions / Container Actions (Switch) n8n nodes: These nodes handle complex routing, inspecting the incoming command parameter to select the appropriate action (e.g., Deploy, Terminate, Start, Stop).
Deploy, Suspend, ChangePackage (Set) n8n nodes: These crucial n8n nodes are responsible for building the multi-line BASH scripts that perform the actual infrastructure work (disk management, file creation, Docker operations). They leverage n8n expressions heavily to inject dynamic parameters.
SSH n8n node: Executes the dynamically generated BASH commands on the remote server. This is where the core DevOps work of the n8n workflow happens.


  • Code1 (Code) n8n node: Processes and validates the output received from the remote SSH execution, converting raw text or custom output into a consistent JSON response structure before exiting the n8n workflow.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

We are a Poland-based IT company specializing in secure, high-performance infrastructure and outsourcing solutions. Our TIER 3 data center ensures reliability, and we prioritize data privacy over commercial indexing. We offer corporate email, encrypted collaboration tools, private web hosting, VPN security, and IT management for companies with 10+ employees. Our open-source approach guarantees flexibility without vendor lock-in.

Featured*