Skip to main content

n8n configuration

Configuration is primarily environment variables and optional files. The authoritative list is Environment variables; deployment-focused entries are under deployment variables.

Encryption key​

N8N_ENCRYPTION_KEY encrypts stored credentials in the database. By default n8n generates a key on first launch; for repeatable deployments, set an explicit key from a secret manager and back it up, losing it can make credentials undecryptable (deployment variables).

In queue mode, workers must share the same key (encryption key guide).

Database​

  • SQLite: Default; fine for small setups; persist /home/node/.n8n.
  • PostgreSQL: Use DB_TYPE=postgresdb and DB_POSTGRESDB_* variables (Docker install).

Tune pool sizes and timeouts for your load; watch connection counts under burst workflow execution.

Reverse proxy and paths​

  • Prefer https on a dedicated hostname (e.g. n8n.example.com) over path-prefix deployments, combining N8N_PATH with reverse proxies can cause navigation issues (deployment variables).
  • Set N8N_PROXY_HOPS appropriately when behind one or more proxies.

Scaling​

n8n documents queue mode for heavier workloads (scaling overview). Queue mode typically involves Redis and worker processes, plan infrastructure before you need it.

Execution data growth can stress the DB; n8n documents execution data pruning options (execution data).

Telemetry​

N8N_DIAGNOSTICS_ENABLED controls telemetry (deployment variables). Set according to your policy; note product notes about features tied to telemetry settings in docs.

Secrets in files​

n8n supports VARIABLE_FILE patterns for sensitive values, see configuration methods.