Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ n8n Public
forked from n8n-io/n8n

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

Notifications You must be signed in to change notification settings

msasikumar/n8n

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n8n Deployment

This directory contains the configuration for deploying n8n with PostgreSQL using Docker Compose.

Prerequisites

  • Docker or Podman with docker-compose
  • Nginx configured as reverse proxy (see nginx-n8n.conf)
  • SSL certificates for n8n.sashi.online

Structure

.
├── docker-compose.yml          # Main deployment configuration
├── .env.example                # Environment variables template
├── nginx-n8n.conf              # Nginx reverse proxy configuration
├── volumes/
│   ├── data/                   # n8n data (workflows, credentials, etc.)
│   └── database/               # PostgreSQL data
├── ssl-certs/                  # SSL certificates
└── backups/                    # Database backups

Quick Start

Using Podman (Recommended)

  1. Deploy n8n with PostgreSQL:

    ./deploy-podman.sh
  2. Check the logs:

    podman logs -f n8n
    podman logs -f n8n-postgres
  3. Check status:

    podman pod ps
    podman ps --filter pod=n8n-pod
  4. Stop the deployment:

    ./stop-podman.sh

Using Docker Compose

  1. Stop any existing n8n containers:

    docker-compose down
  2. Start the services:

    docker compose up -d
  3. Check the logs:

    docker compose logs -f
  4. Check service health:

    docker compose ps

Configuration

Environment Variables

Copy .env.example to .env and modify as needed:

cp .env.example .env

Important Security Notes

  1. Change the encryption key in production!
  2. Change the admin password before exposing to the internet
  3. Update PostgreSQL password for production use

Accessing n8n

Database Management

Backup Database

docker-compose exec postgres pg_dump -U n8n n8n > backups/n8n-backup-$(date +%Y%m%d-%H%M%S).sql

Restore Database

docker-compose exec -T postgres psql -U n8n n8n < backups/your-backup-file.sql

Troubleshooting

Check if services are running

docker-compose ps

View logs

# All services
docker-compose logs -f

# Just n8n
docker-compose logs -f n8n

# Just postgres
docker-compose logs -f postgres

Check database connectivity

docker-compose exec postgres psql -U n8n -d n8n -c "SELECT version();"

Test n8n health endpoint

curl http://localhost:5678/healthz

Common Issues

  1. Database not ready error

    • Ensure PostgreSQL container is healthy
    • Check if database was properly initialized
    • Verify database credentials match
  2. Port already in use

    • Stop other services using port 5678
    • Check with: netstat -tlnp | grep 5678
  3. Permission issues with volumes

    • Ensure proper ownership: chown -R 100999:100999 volumes/

Maintenance

Update to latest version

docker-compose pull
docker-compose up -d

Clean up old images

docker image prune -a

Monitoring

nginx Configuration

The nginx reverse proxy configuration is in nginx-n8n.conf. Ensure:

  1. SSL certificates are valid
  2. Proxy passes to http://127.0.0.1:5678
  3. WebSocket support is enabled

To reload nginx:

sudo nginx -t
sudo systemctl reload nginx

About

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%