n8n allows you to build flexible workflows focused on deep data integration. This NS8 module provides a complete containerized deployment with PostgreSQL, Redis, and Traefik integration.
The module consists of multiple services orchestrated by systemd:
- n8n.service: Main pod service that manages network connectivity
- n8n-pgsql.service: PostgreSQL database (v15.5-bookworm)
- n8n-redis.service: Redis cache (v7.2.3-bookworm)
- n8n-server.service: n8n application server (v2.1.1)
The build process uses the following container images:
docker.io/library/redis:7.2.3-bookworm- Redis databasedocker.io/library/postgres:15.5-bookworm- PostgreSQL databasedocker.io/n8nio/n8n:2.1.1- n8n workflow automationdocker.io/library/node:lts- Node.js build environment
The build-images.sh script creates the module image using Buildah:
- UI Compilation: Builds the Vue.js frontend with Node.js
- Image Assembly: Adds imageroot directory and compiled UI
- Configuration: Sets up entrypoint, labels, and container requirements
- Publishing: Pushes to GitHub Container Registry
Key build features:
- Reuses
nodebuilder-ns8-n8ncontainer for faster builds - Configures Traefik integration with route authorization
- Sets rootless container with TCP port requirements
- Supports CI/CD with GitHub Actions
Instantiate the module with:
add-module ghcr.io/geniusdynamics/n8n:latest 1The output will return the instance name:
{"module_id": "n8n", "image_name": "n8n", "image_url": "ghcr.io/geniusdynamics/n8n:latest"}Assuming the n8n instance is named n8n1, configure with:
api-cli run module/n8n1/configure-module --data '{
"host": "n8n.domain.com",
"lets_encrypt": false,
"http2https": true
}'host: Traefik host URL for the projectlets_encrypt: Enable/disable Let's Encrypt (default: false)http2https: Enable HTTP to HTTPS redirect (default: true)
All services are managed by systemd with the following characteristics:
- Restart Policy:
alwaysfor high availability - Timeout: 70 seconds for graceful shutdown
- Dependencies: Proper service ordering (PostgreSQL β Redis β n8n)
- Health Checks: Built-in container health monitoring
n8n.service (pod)
βββ n8n-pgsql.service (database)
βββ n8n-redis.service (cache)
βββ n8n-server.service (application)
The module publishes the n8n web interface on:
- Internal: Port 5678 within the pod
- External:
127.0.0.1:${TCP_PORT}via Traefik
Test the service:
curl http://127.0.0.1/n8n/The module automatically discovers smarthost settings from Redis:
bin/discover-smarthostrefreshesstate/smarthost.envevents/smarthost-changed/10reload_serviceshandles configuration updates- Ensures email settings stay synchronized with NS8 core
Test the module using the provided test script:
./test-module.sh <NODE_ADDR> ghcr.io/geniusdynamics/n8n:latestTests are implemented using Robot Framework.
The UI supports multiple languages through Weblate:
- Supported Languages: English, German, Spanish, Basque, Italian
- Translation Platform: Weblate
To enable translation updates:
- Add GitHub Weblate app
- Request addition to NS8 Weblate project
Update the module to the latest version:
api-cli run update-module --data '{
"module_url": "ghcr.io/geniusdynamics/n8n:latest",
"instances": ["n8n1"],
"force": true
}'Remove the instance (data will be preserved unless --no-preserve is used):
remove-module --no-preserve n8n1The module uses persistent volumes for:
db_storage: PostgreSQL data directoryn8n-redis-data: Redis data with AOF enabledn8n_data: n8n user data and workflows
- Rootless Containers: All services run without root privileges
- Network Isolation: Services communicate within a private pod
- Traefik Integration: Secure HTTPS termination and routing
- Environment Files: Sensitive configuration stored separately
This module is licensed under GPL-3.0-or-later. See LICENSE for details.
Contributions are welcome! Please ensure all changes:
- Follow the existing code style
- Include appropriate tests
- Update documentation as needed