Skip to content

Configuration environment variables#

File-based configuration

You can provide a configuration file for n8n. You can also append _FILE to certain variables to provide their configuration in a separate file. Variables that support this have the "/_FILE" option listed below.


Enabling overwrites for credentials allows you to set default values for credentials which get automatically populated. The user can't see or change these credentials. The format is { CREDENTIAL_NAME: { PARAMETER: VALUE }}.

Variable Type Default Description
* - Overwrites for credentials.
CREDENTIALS_OVERWRITE_ENDPOINT String - The API endpoint to fetch credentials.
CREDENTIALS_DEFAULT_NAME String My credentials The default name for credentials.


Variable Type Default Description
Enum string:
sqlite, mariadb (deprecated), mysqldb (deprecated), postgresdb
sqlite The database to use.
DB_TABLE_PREFIX * - Prefix to use for table names.



n8n deprecated MySQL and MariaDB as backend databases in version 0.227.0.

n8n recommends using PostgreSQL.

Refer to how to export and import workflows and credentials for instructions.

Variable Type Default Description
String n8n The name of the MySQL database. Default value is n8n.
String localhost The MySQL host. Default value is localhost.
Number 3306 The MySQL port. Default value is 3306.
String root The MySQL user. Default value is root.
String - The MySQL password.


Variable Type Default Description
String n8n The name of the PostgreSQL database. Default value is n8n.
String localhost The PostgreSQL host. Default value is localhost.
Number 5432 The PostgreSQL port. Default value is 5432.
String root The PostgreSQL user. Default value is root.
String - The PostgreSQL password.
String public The PostgreSQL schema. Default value is public.
String - The PostgreSQL SSL certificate authority.
String - The PostgreSQL SSL certificate.
String - The PostgreSQL SSL key.
Boolean true If n8n should reject unauthorized SSL connections (true) or not (false).


Variable Type Default Description
DB_SQLITE_VACUUM_ON_STARTUP Boolean false Runs VACUUM operation on startup to rebuild the database. Reduces file size and optimizes indexes. This is a long running blocking operation and increases start-up time.


Variable Type Default Description
N8N_EDITOR_BASE_URL String - Public URL where users can access the editor. Also used for emails sent from n8n.
N8N_CONFIG_FILES String - Use to provide the path to any JSON configuration file.
N8N_DISABLE_UI Boolean false Disable the UI (true) or not (false).
N8N_TEMPLATES_ENABLED Boolean true Enable workflow templates (true) or disable (false).
N8N_TEMPLATES_HOST String Change this if creating your own workflow template library. Note that to use your own workflow templates library, your API must provide the same endpoints and response structure as n8n's. Refer to Workflow templates for more information.
N8N_ENCRYPTION_KEY String Random key generated by n8n Provide a custom key used to encrypt credentials in the n8n database. By default n8n generates a random key on first launch.
N8N_USER_FOLDER String user-folder Provide the path where n8n will create the .n8n folder. This directory stores user-specific data, such as database file and encryption key.
N8N_PATH String / The path n8n deploys to.
N8N_HOST String localhost Host name n8n runs on.
N8N_PORT Number 5678 The HTTP port n8n runs on.
N8N_LISTEN_ADDRESS String The IP address n8n should listen on.
N8N_PROTOCOL Enum string: http, https http The protocol used to reach n8n.
N8N_SSL_KEY String - The SSL key for HTTPS protocol.
N8N_SSL_CERT String - The SSL certificate for HTTPS protocol.
N8N_PERSONALIZATION_ENABLED Boolean true Whether to ask users personalisation questions and then customise n8n accordingly.
N8N_VERSION_NOTIFICATIONS_ENABLED Boolean true When enabled, n8n sends notifications of new versions and security updates.
N8N_VERSION_NOTIFICATIONS_ENDPOINT String The endpoint to retrieve where version information.
N8N_VERSION_NOTIFICATIONS_INFO_URL String The URL displayed in the New Versions panel for additional information.
N8N_DIAGNOSTICS_ENABLED Boolean true Whether to share selected, anonymous telemetry with n8n
N8N_DIAGNOSTICS_CONFIG_FRONTEND String 1zPn9bgWPzlQc0p8Gj1uiK6DOTn; Telemetry configuration for the frontend.
N8N_DIAGNOSTICS_CONFIG_BACKEND String 1zPn7YoGC3ZXE9zLeTKLuQCB4F6; Telemetry configuration for the backend.
N8N_PUSH_BACKEND String websocket Choose whether the n8n backend uses server-sent events (sse) or WebSockets (websocket) to send changes to the UI.
VUE_APP_URL_BASE_API String http://localhost:5678/ Used when building the n8n-editor-ui package manually to set how the frontend can reach the backend API.
N8N_HIRING_BANNER_ENABLED Boolean true Whether to show the n8n hiring banner in the console (true) or not (false).
N8N_PUBLIC_API_SWAGGERUI_DISABLED Boolean false Whether the Swagger UI (API playground) is disabled (true) or not (false).

Binary data#

By default, n8n uses memory to store binary data. Enterprise users can choose to use an external service instead. Refer to External storage for more information on using external storage for binary data.

Variable Type Default Description
N8N_AVAILABLE_BINARY_DATA_MODES String filesystem A comma separated list of available binary data modes.
N8N_BINARY_DATA_STORAGE_PATH String N8N_USE_FOLDER/binaryData The path where n8n stores binary data.
N8N_DEFAULT_BINARY_DATA_MODE String default The default binary data mode. default keeps binary data in memory. Set to filesystem to use the filesystem, or s3 to AWS S3.

User management SMTP, and two-factor authentication#

Refer to User management for more information on setting up user management and emails.

Variable Type Default Description
N8N_EMAIL_MODE String smtp Enable emails.
N8N_SMTP_HOST String - your_SMTP_server_name
N8N_SMTP_PORT Number - your_SMTP_server_port
N8N_SMTP_USER String - your_SMTP_username
N8N_SMTP_PASS String - your_SMTP_password
N8N_SMTP_OAUTH_SERVICE_CLIENT String - If using 2LO with a service account this is your client ID
N8N_SMTP_OAUTH_PRIVATE_KEY String - If using 2LO with a service account this is your private key
N8N_SMTP_SENDER String - Sender email address. You can optionally include the sender name. Example with name: N8N <>
N8N_SMTP_SSL Boolean true Whether to use SSL for SMTP (true) or not (false).
N8N_UM_EMAIL_TEMPLATES_INVITE String - Full path to your HTML email template. This overrides the default template for invite emails.
N8N_UM_EMAIL_TEMPLATES_PWRESET String - Full path to your HTML email template. This overrides the default template for password reset emails.
N8N_USER_MANAGEMENT_JWT_SECRET String - Set a specific JWT secret. By default, n8n generates one on start.
N8N_MFA_ENABLED Boolean true Whether to enable two-factor authentication (true) or disable (false). n8n ignores this if existing users have 2FA enabled.


Variable Type Default Description
N8N_PAYLOAD_SIZE_MAX Number 16 The maximum payload size in MB.
N8N_METRICS Boolean false Whether to enable the /metrics endpoint.
N8N_METRICS_PREFIX String n8n_ Optional prefix for n8n specific metrics names.
N8N_METRICS_INCLUDE_DEFAULT_METRICS Boolean true Whether to expose default system and node.js metrics.
N8N_METRICS_INCLUDE_CACHE_METRICS Boolean false Whether to include metrics (true) for cache hits and misses, or not include them (false).
N8N_METRICS_INCLUDE_MESSAGE_EVENT_BUS_METRICS Boolean false Whether to include metrics (true) for events, or not include them (false).
N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL Boolean false Whether to include a label for the workflow ID on workflow metrics.
N8N_METRICS_INCLUDE_NODE_TYPE_LABEL Boolean false Whether to include a label for the node type on node metrics.
N8N_METRICS_INCLUDE_CREDENTIAL_TYPE_LABEL Boolean false Whether to include a label for the credential type on credential metrics.
N8N_METRICS_INCLUDE_API_ENDPOINTS Boolean false Whether to expose metrics for API endpoints.
N8N_METRICS_INCLUDE_API_PATH_LABEL Boolean false Whether to include a label for the path of API invocations.
N8N_METRICS_INCLUDE_API_METHOD_LABEL Boolean false Whether to include a label for the HTTP method (GET, POST, ...) of API invocations.
N8N_METRICS_INCLUDE_API_STATUS_CODE_LABEL Boolean false Whether to include a label for the HTTP status code (200, 404, ...) of API invocations.
N8N_ENDPOINT_REST String rest The path used for REST endpoint.
N8N_ENDPOINT_WEBHOOK String webhook The path used for webhook endpoint.
N8N_ENDPOINT_WEBHOOK_TEST String webhook-test The path used for test-webhook endpoint.
N8N_ENDPOINT_WEBHOOK_WAIT String webhook-waiting The path used for waiting-webhook endpoint.
WEBHOOK_URL String - Used to manually provide the Webhook URL when running n8n behind a reverse proxy. See here for more details.
N8N_DISABLE_PRODUCTION_MAIN_PROCESS Boolean false Disable production webhooks from main process. This helps ensure no HTTP traffic load to main process when using webhook-specific processes.

External hooks#

Variable Type Description
EXTERNAL_HOOK_FILES String Files containing external hooks. Provide multiple files as a colon-separated list (":").


Variable Type Default Description
EXECUTIONS_PROCESS (deprecated) Enum string: main, own main Deprecated. Whether n8n executions run in their own process or the main process.

Refer to Execution modes and processes for more details.
EXECUTIONS_MODE Enum string: regular, queue regular Whether executions should run directly or using queue.

Refer to Execution modes and processes for more details.
EXECUTIONS_TIMEOUT Number -1 Sets a default timeout (in seconds) to all workflows after which n8n stops their execution. Users can override this for individual workflows up to the duration set in EXECUTIONS_TIMEOUT_MAX. Set EXECUTIONS_TIMEOUT to -1 to disable.
EXECUTIONS_TIMEOUT_MAX Number 3600 The maximum execution time (in seconds) that users can set for an individual workflow.
EXECUTIONS_DATA_SAVE_ON_ERROR Enum string: all, none all Whether n8n saves execution data on error.
EXECUTIONS_DATA_SAVE_ON_SUCCESS Enum string: all, none all Whether n8n saves execution data on success.
EXECUTIONS_DATA_SAVE_ON_PROGRESS Boolean false Whether to save progress for each node executed (true) or not (false).
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS Boolean true Whether to save data of executions when started manually.
EXECUTIONS_DATA_PRUNE Boolean true Whether to delete data of past executions on a rolling basis.
EXECUTIONS_DATA_MAX_AGE Number 336 The execution age (in hours) before it's deleted.
EXECUTIONS_DATA_PRUNE_MAX_COUNT Number 10000 Maximum number of executions to keep in the database. 0 = no limit
EXECUTIONS_DATA_HARD_DELETE_BUFFER Number 1 How old (hours) the finished execution data has to be to get hard-deleted. By default, this buffer excludes recent executions as the user may need them while building a workflow.
EXECUTIONS_DATA_PRUNE_HARD_DELETE_INTERVAL Number 15 How often (minutes) execution data should be hard-deleted.
EXECUTIONS_DATA_PRUNE_SOFT_DELETE_INTERVAL Number 60 How often (minutes) execution data should be soft-deleted.


n8n logs#

Variable Type Default Description
N8N_LOG_LEVEL Enum string: info, warn, error, verbose, debug info Log output level.
N8N_LOG_OUTPUT Enum string: console, file console Where to output logs. Provide multiple values as a comma-seperated list.
N8N_LOG_FILE_COUNT_MAX Number 100 Max number of log files to keep.
N8N_LOG_FILE_SIZE_MAX Number 16 Max size of each log file in MB.
N8N_LOG_FILE_LOCATION String file Log file location. Requires N8N_LOG_OUTPUT set to file.
DB_LOGGING_ENABLED Boolean false Whether to enable database-specific logging.
DB_LOGGING_OPTIONS Enum string: query, error, schema, warn, info, log error Database log output level. To enable all logging, specify all.
DB_LOGGING_MAX_EXECUTION_TIME Number 1000 Maximum execution time (in milliseconds) before n8n logs a warning. Set to 0 to disable long running query warning.

Log streaming#

Refer to Log streaming for more information on this feature.

Variable Type Default Description
N8N_EVENTBUS_CHECKUNSENTINTERVAL Number 0 How often (in milliseconds) to check for unsent event messages. Can in rare cases cause a message to be sent twice. Set to 0 to disable it.
N8N_EVENTBUS_LOGWRITER_SYNCFILEACCESS Boolean false Whether all file access happens synchronously within the thread (true) or not (false).
N8N_EVENTBUS_LOGWRITER_KEEPLOGCOUNT Number 3 How many event log files to keep.
N8N_EVENTBUS_LOGWRITER_MAXFILESIZEINKB Number 10240 Maximum size (in kilo-bytes) of an event log file before a new one is started.
N8N_EVENTBUS_LOGWRITER_LOGBASENAME String n8nEventLog Basename of the event log file.

External data storage#

Refer to External storage for more information on using external storage for binary data.

Variable Type Default Description
N8N_EXTERNAL_STORAGE_S3_HOST String - Host of the n8n bucket in S3-compatible external storage. For example,
N8N_EXTERNAL_STORAGE_S3_BUCKET_NAME String - Name of the n8n bucket in S3-compatible external storage.
N8N_EXTERNAL_STORAGE_S3_BUCKET_REGION String - Region of the n8n bucket in S3-compatible external storage. For example, us-east-1
N8N_EXTERNAL_STORAGE_S3_ACCESS_KEY String - Access key in S3-compatible external storage
N8N_EXTERNAL_STORAGE_S3_ACCESS_SECRET String - Access secret in S3-compatible external storage.


Variable Type Default Description
NODES_INCLUDE Array of strings - Specify which nodes to load.
NODES_EXCLUDE Array of strings - Specify which nodes not to load. For example, to block nodes that can be a security risk if users aren't trustworthy: NODES_EXCLUDE: "[\"n8n-nodes-base.executeCommand\", \"n8n-nodes-base.readBinaryFile\", \"n8n-nodes-base.readBinaryFiles\", \"n8n-nodes-base.writeBinaryFile\"]"
NODE_FUNCTION_ALLOW_BUILTIN String - Permit users to import specific built-in modules in the Code node. Use * to allow all. n8n disables importing modules by default.
NODE_FUNCTION_ALLOW_EXTERNAL String - Permit users to import specific external modules (from n8n/node_modules) in the Code node. n8n disables importing modules by default.
NODES_ERROR_TRIGGER_TYPE String n8n-nodes-base.errorTrigger Specify which node type to use as Error Trigger.
N8N_CUSTOM_EXTENSIONS String - Specify the path to additional directories containing your custom nodes.
N8N_COMMUNITY_PACKAGES_ENABLED Boolean true Whether community nodes are enabled (true) or not (false).


Variable Type Default Description
QUEUE_BULL_PREFIX String - Prefix to use for all queue keys.
QUEUE_BULL_REDIS_DB Number 0 The Redis database used.
QUEUE_BULL_REDIS_HOST String localhost The Redis host.
QUEUE_BULL_REDIS_PORT Number 6379 The Redis port used.
QUEUE_BULL_REDIS_USERNAME String - The Redis username (needs Redis version 6 or above). Don't define it for Redis < 6 compatibility
QUEUE_BULL_REDIS_PASSWORD String - The Redis password.
QUEUE_BULL_REDIS_TIMEOUT_THRESHOLD Number 10000 The Redis timeout threshold (in seconds).
QUEUE_BULL_REDIS_CLUSTER_NODES String - Expects a comma-separated list of Redis Cluster nodes in the format host:port, for the Redis client to initially connect to. If running in queue mode (EXECUTIONS_MODE = queue), setting this variable will create a Redis Cluster client instead of a Redis client, and n8n will ignore QUEUE_BULL_REDIS_HOST and QUEUE_BULL_REDIS_PORT.
QUEUE_BULL_REDIS_TLS Boolean false Enable TLS on Redis connections.
QUEUE_RECOVERY_INTERVAL Number 60 Interval (in seconds) for active polling to the queue to recover from Redis crashes. 0 disables recovery. May increase Redis traffic significantly.
QUEUE_WORKER_TIMEOUT Number 30 How long should n8n wait (seconds) for running executions before exiting worker process on shutdown.
QUEUE_HEALTH_CHECK_ACTIVE Boolean false Whether to enable health checks (true) or disable (false).
QUEUE_HEALTH_CHECK_PORT Number - The port to serve health checks on.
QUEUE_WORKER_LOCK_DURATION Number 30000 How long (in ms) is the lease period for a worker to work on a message.
QUEUE_WORKER_LOCK_RENEW_TIME Number 15000 How frequently (in ms) should a worker renew the lease time.
QUEUE_WORKER_STALLED_INTERVAL Number 30000 How often should a worker check for stalled jobs (use 0 for never).
QUEUE_WORKER_MAX_STALLED_COUNT Number 1 Maximum amount of times a stalled job will be re-processed.


Variable Type Default Description
N8N_AUTH_EXCLUDE_ENDPOINTS String - Exclude endpoints from authentication checks. Provide multiple endpoints as a colon-seperated list (":"). The endpoints must not start with a forward slash ("/").
N8N_BLOCK_ENV_ACCESS_IN_NODE Boolean false Whether to allow users to access environment variables in expressions and the Code node (false) or not (true).

Source control#

Variable Type Default Description
N8N_SOURCECONTROL_DEFAULT_SSH_KEY_TYPE String ed25519 Set to rsa to make RSA the default SSH key type for Source control setup.

Timezone and localization#

Variable Type Default Description
GENERIC_TIMEZONE * America/New_York The n8n instance timezone. Important for schedule nodes (such as Cron).
N8N_DEFAULT_LOCALE String en A locale identifier, compatible with the Accept-Language header. n8n doesn't support regional identifiers, such as de-AT. When running in a locale other than the default, n8n displays UI strings in the selected locale, and falls back to en for any untranslated strings.


Variable Type Default Description
WORKFLOWS_DEFAULT_NAME String My workflow The default name used for new workflows.
N8N_ONBOARDING_FLOW_DISABLED Boolean false Whether to show onboarding tips when creating a new workflow (true) or not (false).
N8N_WORKFLOW_TAGS_DISABLED Boolean false Whether to disable workflow tags (true) or enable tags (false).
N8N_WORKFLOW_CALLER_POLICY_DEFAULT_OPTION String workflowsFromSameOwner Which workflows can call a workflow. Options are: any, none, workflowsFromAList, workflowsFromSameOwner. This feature requires Workflow sharing.


Variable Type Default Description
N8N_HIDE_USAGE_PAGE boolean false Hide the usage and plans page in the app.
N8N_LICENSE_ACTIVATION_KEY String '' Activation key to initialize license. Not applicable if the n8n instance was already activated.
N8N_LICENSE_AUTO_RENEW_ENABLED Boolean true Whether autorenew for licenses is enabled (true) or not (false).
N8N_LICENSE_AUTO_RENEW_OFFSET Number 60 * 60 * 72 (72 hours) How many seconds before expiry a license should automatically renew.
N8N_LICENSE_SERVER_URL String Server URL to retrieve license.