env var

N8N Environment Variables Overview

Environment variables are the main way to configure self-hosted n8n for Docker, hosting, databases, queue mode, nodes, and security behavior.

Independent third-party notes. n8n is a trademark of its owner and is referenced only for compatibility and troubleshooting context.

Quick Answer

Environment variables are the main way to configure self-hosted n8n for Docker, hosting, databases, queue mode, nodes, and security behavior.

Key Facts

Primary use
Configure runtime behavior without editing application code.
Sensitive values
Some variables can use file-based configuration with the _FILE suffix.
Common groups
Database, queue, nodes, security, execution, and endpoint settings.

Recommended Steps

  1. Identify the setup area you are changing, such as database, nodes, queue mode, or security.
  2. Find the official variable name and expected type.
  3. Set the variable in your container, Compose environment, system service, or hosting dashboard.
  4. Restart n8n after changing environment variables.
  5. Check logs for validation errors or ignored settings.

Verification

  • The instance starts without configuration warnings.
  • The target behavior changes after restart.
  • Sensitive variables are not visible in committed files.

Warnings

  • Do not paste secrets into public Compose files or Git repositories.
  • Version-specific variables can change, so verify against the docs for your n8n version.

Sources