This document provides a quick reference for deploying and managing n8n using this Docker deployment solution.
| Deployment Type | Command | Description |
|---|---|---|
| Local | sudo ./setup.sh --type local |
Basic deployment with local storage |
| S3 Backup | sudo ./setup.sh --type s3 --s3-bucket BUCKET --aws-key KEY --aws-secret SECRET |
Adds S3 backups |
| Traefik HTTPS | sudo ./setup.sh --type traefik --domain DOMAIN --email EMAIL |
Adds HTTPS with automatic SSL |
| Production | sudo ./setup.sh --type production --domain DOMAIN --email EMAIL --s3-bucket BUCKET --aws-key KEY --aws-secret SECRET |
Complete production setup with HTTPS and S3 backups |
For a guided setup experience:
sudo ./setup.sh| Variable | Description | Default | Required For |
|---|---|---|---|
| DEPLOYMENT_TYPE | Deployment type | local | All |
| POSTGRES_USER | PostgreSQL username | n8n | All |
| POSTGRES_PASSWORD | PostgreSQL password | auto-generated | All |
| POSTGRES_DB | PostgreSQL database name | n8n | All |
| N8N_ENCRYPTION_KEY | Encryption key for n8n | auto-generated | All |
| N8N_USER_MANAGEMENT_JWT_SECRET | JWT secret for n8n | auto-generated | All |
| BACKUP_RETENTION_DAYS | Days to keep backups | 7 | All |
| S3_BUCKET_NAME | S3 bucket name | - | S3, Production |
| AWS_ACCESS_KEY_ID | AWS access key | - | S3, Production |
| AWS_SECRET_ACCESS_KEY | AWS secret key | - | S3, Production |
| AWS_REGION | AWS region | us-east-1 | S3, Production |
| DOMAIN_NAME | Domain name for n8n | - | Traefik, Production |
| ACME_EMAIL | Email for Let's Encrypt | - | Traefik, Production |
# Start services
cd /path/to/n8n-deployment-docker
docker-compose up -d
# Stop services
docker-compose down
# Restart services
docker-compose restart# View n8n logs
docker logs n8n
# View PostgreSQL logs
docker logs n8n-postgres
# View Traefik logs
docker logs n8n-traefik
# Follow logs (add -f flag)
docker logs -f n8n# Manual backup (local deployment)
sudo /opt/n8n-data/backup.sh
# Manual backup (S3 deployment)
sudo /opt/n8n-data/backup-s3.sh
# Restore from local backup
sudo /opt/n8n-data/restore.sh --backup-id YYYYMMDD_HHMMSS
# Restore from S3 backup
sudo /opt/n8n-data/restore-s3.sh --backup-id YYYYMMDD_HHMMSS# Pull the latest n8n image
docker pull n8nio/n8n:latest
# Restart the services
docker-compose down
docker-compose up -d# Check all containers
docker ps
# Check container health
docker inspect --format='{{.State.Health.Status}}' n8n- Local/S3 Deployment: http://your-server-ip:5678
- Traefik/Production Deployment: https://your-domain.com
For Traefik and Production deployments:
- URL: https://traefik.your-domain.com
- Username: admin
- Password: (Generated during setup - check console output)
-
n8n fails to start:
- Check logs:
docker logs n8n - Verify PostgreSQL is running:
docker ps | grep postgres - Check environment variables in
.env
- Check logs:
-
Backup fails:
- Check disk space:
df -h /opt/n8n-data - For S3 backups, verify AWS credentials and bucket permissions
- Check backup logs:
cat /opt/n8n-data/backup.log
- Check disk space:
-
Traefik SSL certificate issues:
- Ensure your domain points to the server's IP
- Check Traefik logs:
docker logs n8n-traefik - Verify that ports 80 and 443 are open in your firewall
-
Database connection issues:
- Check PostgreSQL logs:
docker logs n8n-postgres - Verify database credentials in
.env - Check if PostgreSQL container is running:
docker ps | grep postgres
- Check PostgreSQL logs:
# View deployment log
cat /opt/n8n-data/deployment.log
# View backup log
cat /opt/n8n-data/backup.log# Interactive removal
sudo ./utils/remove-n8n.sh
# Remove everything
sudo ./utils/remove-n8n.sh --all
# Remove only containers
sudo ./utils/remove-n8n.sh --containers- Deployment Diagrams - Visual explanation of deployment options
- Troubleshooting Guide - Detailed troubleshooting information
- n8n Documentation - Official n8n documentation