Environment Variables in n8n

From the n8n cheat sheet ยท Self-Hosting ยท verified Jul 2026

Environment Variables

Essential configuration for self-hosted n8n

bash
# Core Settings
N8N_HOST=n8n.yourcompany.com
N8N_PORT=5678
N8N_PROTOCOL=https
WEBHOOK_URL=https://n8n.yourcompany.com/

# Timezone
TZ=America/New_York
GENERIC_TIMEZONE=America/New_York

## Security
# Basic auth (N8N_BASIC_AUTH_*) is removed in v2. Create an owner
# account on first launch (user management) and run behind HTTPS.
N8N_ENCRYPTION_KEY=your-random-32-char-key
# Generate with: openssl rand -hex 32
๐Ÿ” N8N_ENCRYPTION_KEY is critical - back it up!
๐Ÿ’ก Use PostgreSQL for production, not SQLite
โš ๏ธ WEBHOOK_URL must match your actual public URL
๐Ÿ“Œ Set both TZ and GENERIC_TIMEZONE to same value

More n8n tasks

Back to the full n8n cheat sheet