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