部署与运维
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" \
docker.n8n.io/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:
n8n:
environment:
- N8N_TEMPLATES_ENABLED=falseKeeping 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 credentials1 and database configuration. Here are some examples:
CREDENTIALS_OVERWRITE_DATA_FILE=/path/to/credentials_data
DB_TYPE_FILE=/path/to/db_type
DB_POSTGRESDB_DATABASE_FILE=/path/to/database_name
DB_POSTGRESDB_HOST_FILE=/path/to/database_host
DB_POSTGRESDB_PORT_FILE=/path/to/database_port
DB_POSTGRESDB_USER_FILE=/path/to/database_user
DB_POSTGRESDB_PASSWORD_FILE=/path/to/database_password
DB_POSTGRESDB_SCHEMA_FILE=/path/to/database_schema
DB_POSTGRESDB_SSL_CA_FILE=/path/to/ssl_ca
DB_POSTGRESDB_SSL_CERT_FILE=/path/to/ssl_cert
DB_POSTGRESDB_SSL_KEY_FILE=/path/to/ssl_key
DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED_FILE=/path/to/ssl_reject_unauthFootnotes
- Back
In n8n, credentials store authentication information to connect with specific apps and services. After creating credentials with your authentication information (username and password, API key, OAuth secrets, etc.), you can use the associated app node to interact with the service.
官方原文和授权
本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。