Basic configuration
You can change n8n's settings using environment variables. For a full list of available configurations see Environment variables.
Set environment variables by command line
npm
For npm, set your desired environment variables in terminal. The command depends on your command line.
Bash CLIs:
export <variable>=<value>In cmd.exe:
set <variable>=<value>In PowerShell:
$env:<variable>=<value>Docker
In Docker you can use the -e flag from the command line:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e N8N_TEMPLATES_ENABLED="false" \
n8nio/n8nDocker Compose file
In Docker, you can set your environment variables in the n8n: environment: element of your docker-compose.yaml file.
For example:
Keeping sensitive data in separate files
You can append _FILE to individual environment variables to provide their configuration in a separate file, enabling you to avoid passing sensitive details using environment variables. n8n loads the data from the file with the given name, making it possible to load data from Docker secrets and Kubernetes secrets.
Refer to Environment variables for details on each variable.
While most environment variables can use the _FILE suffix, it's more beneficial for sensitive data such as credentials and database configuration. Here are some examples:
See Configure n8n for other configuration topics.
Last updated
Was this helpful?