n8n
n8n is a workflow automation platform that allows you to automate tasks and integrate various services together.
Prepare
Pull the image
Create directories to store variables and persistent container data
Create files to store variables and persistent container data
Edit environment file
Edit the environment file and paste your default values for this service:
Save the result for N8N_ENCRYPTION_KEY
Example contents:
GENERIC_TIMEZONE=Europe/Athens
TZ=Europe/Athens
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_RUNNERS_ENABLED=true
DB_TYPE=postgresdb
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_HOST=10.0.0.77
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_PASSWORD=password
WEBHOOK_URL=http://n8n.skynet.lan/
N8N_HOST=n8n.skynet.lan
N8N_SECURE_COOKIE=false
N8N_ENCRYPTION_KEY=change_me_with_random_key
Installation
Create .container in home folder
Edit the file and paste this content
# n8n.container
[Unit]
Description=n8n
[Container]
ContainerName=n8n
HostName=n8n
AutoUpdate=registry
Image=docker.io/n8nio/n8n:latest
Network=skynet.network
EnvironmentFile=%h/apps/variables/n8n.env
Volume=%h/apps/container_data/n8n:/home/node/n8n
[Service]
Restart=always
TimeoutStartSec=300
[Install]
WantedBy=default.target
Configuration of Nginx (Reverse Proxy)
Create nginx conf.
Configuration for nginx conf for port 80.
server {
listen 80;
server_name n8n.skynet.lan;
location / {
proxy_pass http://n8n:5678/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
client_max_body_size 50M;
}
}
Future Enhancement
SSL/HTTPS configuration should be added for production deployments.
Restart Nginx
Usage
Access with url in server_name of nginx configuration file.
e.g http://n8n.skynet.lan
Troubleshooting
Common issues and solutions.
Check Quadlet syntax.
Check service status & logs