Skip to content

metalkutz/n8n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n8n Docker Setup

This project provides a complete Docker Compose setup for running n8n with PostgreSQL and Redis.

Features

  • 🚀 n8n - Latest version with web interface
  • 🐘 PostgreSQL - Persistent database for workflows and data
  • 🔴 Redis - Caching and session storage
  • 📁 Persistent volumes - Data survives container restarts
  • 🔐 Basic authentication - Secure access to n8n
  • 🌐 Custom networking - Isolated container communication

Quick Start

  1. Clone and setup:

    cd c:\dev\n8n
    cp .env.example .env
  2. Edit the .env file with your preferred settings:

    • Change the default password
    • Set your timezone
    • Configure database credentials
    • Add email settings (optional)
  3. Start the services:

    docker-compose up -d
  4. Access n8n:

Commands

Start services

docker-compose up -d

Stop services

docker-compose down

View logs

docker-compose logs -f n8n

Update n8n

docker-compose pull
docker-compose up -d

Backup data

docker-compose exec postgres pg_dump -U n8n n8n > backup.sql

Restore data

docker-compose exec -T postgres psql -U n8n n8n < backup.sql

Project Structure

c:\dev\n8n\
├── docker-compose.yml    # Main Docker Compose configuration
├── .env.example         # Environment variables template
├── .env                 # Your environment variables (create from .env.example)
├── .gitignore          # Git ignore file
├── README.md           # This file
├── custom/             # Custom n8n nodes and configurations
├── backups/            # Database backups
└── logs/               # Application logs

Configuration

Environment Variables

Key variables you should customize in .env:

  • N8N_BASIC_AUTH_USER - Your admin username
  • N8N_BASIC_AUTH_PASSWORD - Your admin password
  • DB_POSTGRESDB_PASSWORD - Database password
  • N8N_ENCRYPTION_KEY - Encryption key for sensitive data
  • GENERIC_TIMEZONE - Your timezone

Custom Nodes

Place custom n8n nodes in the custom/ directory. They will be automatically loaded by n8n.

Troubleshooting

Port conflicts

If port 5678 is already in use, change it in docker-compose.yml:

ports:
  - "8080:5678"  # Use port 8080 instead

Database connection issues

Check if PostgreSQL is running:

docker-compose logs postgres

Reset everything

To start fresh (⚠️ this will delete all data):

docker-compose down -v
docker-compose up -d

Security Notes

  • Change default passwords before production use
  • Use HTTPS in production (consider adding a reverse proxy)
  • Regularly backup your database
  • Keep Docker images updated

Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published