Automate Immich Docker Deployments with n8n
detail.loadingPreview
Streamline your Immich Docker deployment process with this n8n workflow. This template allows for remote control of container actions like starting, stopping, and disk mounting via a secure webhook.
About This Workflow
This n8n workflow provides a robust solution for managing Immich Docker deployments. It leverages a secure webhook to receive commands, validate server domain, and execute specific container actions. The workflow supports starting and stopping Immich containers, as well as mounting and unmounting disks, all triggered remotely. Error handling is built-in to provide informative feedback on invalid requests or execution failures. By automating these critical infrastructure tasks, you can significantly improve efficiency and reduce manual intervention in your Immich server management.
Key components include a webhook for receiving commands, an 'If' node for domain validation, a 'Switch' node to route commands, and an 'SSH' node for executing shell commands on your server. The 'Code' node processes the results from the SSH command, translating raw output into a clear status message.
Key Features
- Remote Container Control: Start, stop, mount, and unmount Immich Docker containers via a secure webhook.
- Domain Validation: Ensures commands are only accepted from authorized server domains.
- Secure Execution: Utilizes SSH with password authentication for command execution.
- Comprehensive Error Handling: Provides clear status and error messages for failed operations.
- Flexible Configuration: Easily customize server domains, directories, and SSH credentials.
How To Use
- Set up the Webhook: Configure the
APInode with your desired webhook path (e.g.,docker-immich) and selectPOSTas the HTTP method. SetresponseModetoresponseNodeandauthenticationtobasicAuth. - Configure Credentials: Create or select your
ImmichHTTP Basic Auth credentials for the webhook and your server's SSH credentials (e.g.,d01-test.uuq.pl-puq) for theSSHnode. - Define Parameters: In the
Parametrsnode, updateserver_domainto your Immich server's domain,clients_dirandmount_dirto your desired directory paths. - Configure 'If' Node: In the
Ifnode, ensure theleftValuefor the condition={{ $json.server_domain }}matches theserver_domainyou set in theParametrsnode. TherightValueshould dynamically pull the server domain from the incoming webhook request (e.g.,={{ $('API').item.json.body.server_domain }}). - Define Container Actions: In the
Container Actions(Switch) node, adjust theleftValuein each condition to dynamically capture thecommandfrom the incoming webhook request (e.g.,={{ $('API').item.json.body.command }}). Ensure therightValuefor each output key (start,stop,mount_disk,unmount_disk) matches the expected command strings. - Configure SSH Commands: For each branch of the
Container Actionsnode, ensure thecommandparameter in theSSHnode is correctly formatted to execute the desired Docker command (e.g.,docker start immichfor thestartoutput). - Process Results: The
Code1node is designed to parse thestdoutfrom theSSHcommand and return a structured JSON response indicating success or failure.
Apps Used
Workflow JSON
{
"id": "b22d5899-a2b3-4ebc-90ac-9aadab8761bf",
"name": "Automate Immich Docker Deployments with n8n",
"nodes": 13,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: b22d5899-a2b3...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.