n8n should be configured with strict credential handling, queue execution policy, and predictable workflow retention settings.
N8N_HOST=n8n.example.com
N8N_PROTOCOL=https
N8N_PORT=5678
N8N_ENCRYPTION_KEY=replace-with-long-random-secret
N8N_SECURE_COOKIE=true
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=127.0.0.1
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_PASSWORD=replace-with-strong-password
TZ=Europe/Berlin
GENERIC_TIMEZONE=Europe/Berlin
¶ Execution and queue policy
- Use queue mode for production scale and worker separation.
- Set workflow concurrency limits to protect external APIs.
- Define execution data retention and prune policy.
¶ Credentials and secret controls
- Keep credential encryption key stable and backed up.
- Store external secrets in vault systems where possible.
- Restrict who can view and edit credentials.
¶ Backup and recovery
Back up:
- PostgreSQL DB
- encryption key and env config
Recovery test:
- Restore DB and encryption key.
- Validate credential decryption.
- Execute one scheduled workflow end-to-end.
- Failed execution alerts configured.
- Queue depth and worker health monitored.
- Webhook endpoint TLS validated.
- Restore procedure tested.
Squeezing every bit of performance from your N8N installation? Our experts help with:
- Memory and resource tuning
- Connection pool optimization
- Caching strategies
- Load balancing and clustering
Optimize your setup: office@linux-server-admin.com | Contact Us