✳️Replace the highlighted information with your own
### .env
POSTGRES_DB=n8n_db
POSTGRES_USER=n8n_db_user
POSTGRES_PASSWORD=n8n_db_PWD
N8N_PORT=5678
N8N_PROTOCOL=http
N8N_HOST=0.0.0.0
GENERIC_TIMEZONE=Asia/Ho_Chi_Minh
TZ=Asia/Ho_Chi_Minh
N8N_ENCRYPTION_KEY=your_secret_key_here
N8N_EDITOR_BASE_URL=http://IP-WSL:5678
WEBHOOK_URL=http://IP-WSL:5678
N8N_SECURE_COOKIE=false
### docker-compose.yml
services:
postgres:
image: postgres:16
container_name: n8n_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
TZ: ${TZ}
volumes:
- ./postgres_data:/var/lib/postgresql/data
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
ports:
- "${N8N_PORT}:5678"
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_PORT: 5432
DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}
DB_POSTGRESDB_USER: ${POSTGRES_USER}
DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
N8N_HOST: ${N8N_HOST}
N8N_PORT: ${N8N_PORT}
N8N_PROTOCOL: ${N8N_PROTOCOL}
N8N_SECURE_COOKIE: ${N8N_SECURE_COOKIE}
WEBHOOK_URL: ${WEBHOOK_URL}
N8N_EDITOR_BASE_URL: ${N8N_EDITOR_BASE_URL}
GENERIC_TIMEZONE: ${GENERIC_TIMEZONE}
TZ: ${TZ}
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
depends_on:
- postgres
Read more
- Understanding AI Training: What It Is and Why It Matters
- Important Updates Coming in n8n Version 3.0
- Top 10 AI Technologies to Watch in 2026
- Understanding Hiberfil.sys and Pagefile.sys: Essential Windows Components
- Top 5 Open Source NAS Software for 2026
- The Best AI Orchestration Tools of 2026
- What is TrueNAS ? Choosing the Right Version in 2026
- How to Install a LEMP Stack on RHEL, Rocky, AlmaLinux and CentOS Stream
- OpenAI integrations | Workflow automation with n8n: A Step-by-Step Guide
- n8n vs Zapier: Choosing the Right Automation Tool