> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/deploy/host-n8n/configure-n8n/basic-configuration/use-environment-variables/deployment.md).

# Deployment

{% hint style="info" %}
**File-based configuration**

You can add `_FILE` to individual variables to provide their configuration in a separate file. Refer to [Keeping sensitive data in separate files](/deploy/host-n8n/configure-n8n/basic-configuration.md#keeping-sensitive-data-in-separate-files) for more details.
{% endhint %}

This page lists the deployment configuration options for your self-hosted n8n instance, including setting up access URLs, enabling templates, customizing encryption, and configuring server details.

{% hint style="info" %}
**Proxy variable priorities**

The [`proxy-from-env`](https://www.npmjs.com/package/proxy-from-env) package that n8n uses to handle proxy environment variables (those ending with `_PROXY`) imposes a certain variable precedence. Notably, for proxy variables, lowercase versions (like `http_proxy`) have precedence over uppercase variants (for example `HTTP_PROXY`) when both are present.

To learn more about proxy environment variables, check the [environment variables section of the package details](https://www.npmjs.com/package/proxy-from-env#environment-variables).
{% endhint %}

| Variable                                | Type                         | Default                                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------- | ---------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `HTTP_PROXY`                            | String                       | -                                                                | A URL to proxy unencrypted HTTP requests through. When set, n8n proxies all unencrypted HTTP traffic from nodes through the proxy URL.                                                                                                                                                                                                                                                                                                                                                          |
| `HTTPS_PROXY`                           | String                       | -                                                                | A URL to proxy TLS/SSL encrypted HTTP requests through. When set, n8n proxies all TLS/SSL encrypted HTTP traffic from nodes through the proxy URL.                                                                                                                                                                                                                                                                                                                                              |
| `ALL_PROXY`                             | String                       | -                                                                | A URL to proxy both unencrypted and encrypted HTTP requests through. When set, n8n uses this value when more specific variables (`HTTP_PROXY` or `HTTPS_PROXY`) aren't present.                                                                                                                                                                                                                                                                                                                 |
| `NO_PROXY`                              | String                       | -                                                                | A comma-separated list of hostnames or URLs that should bypass the proxy. When using `HTTP_PROXY`, `HTTPS_PROXY`, or `ALL_PROXY`, n8n will connect directly to the URLs or hostnames defined here instead of using the proxy.                                                                                                                                                                                                                                                                   |
| `N8N_ENFORCE_GLOBAL_USER_AGENT`         | Boolean                      | `false`                                                          | When set to `true`, n8n replaces the default bare `n8n` User-Agent string with an RFC-compliant value (`Mozilla/5.0 (compatible; n8n/<version>; +https://n8n.io/)`) on all outbound HTTP requests. Enable this to prevent web application firewalls from blocking n8n requests.                                                                                                                                                                                                                 |
| `N8N_GLOBAL_USER_AGENT_VALUE`           | String                       | -                                                                | A custom User-Agent string to use for all outbound HTTP requests. Overrides the RFC-compliant default set by `N8N_ENFORCE_GLOBAL_USER_AGENT`. Useful when you don't want to disclose the n8n version to upstream servers.                                                                                                                                                                                                                                                                       |
| `N8N_EDITOR_BASE_URL`                   | String                       | -                                                                | Public URL where users can access the editor. Also used for emails sent from n8n and the redirect URL for SAML based authentication.                                                                                                                                                                                                                                                                                                                                                            |
| `N8N_DISABLE_UI`                        | Boolean                      | `false`                                                          | Set to `true` to disable the UI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `N8N_PREVIEW_MODE`                      | Boolean                      | `false`                                                          | Set to `true` to run in preview mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `N8N_TEMPLATES_ENABLED`                 | Boolean                      | `true`                                                           | Enables [workflow templates](#user-content-fn-1)[^1] (true) or disable (false).                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `N8N_TEMPLATES_HOST`                    | String                       | `https://api.n8n.io`                                             | 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](/build/ways-of-building-workflows/use-templates.md) 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_ENV_FEAT_ENCRYPTION_KEY_ROTATION`  | Boolean                      | `false`                                                          | Set to `true` on all instances (main and workers) to enable [encryption key rotation](/deploy/host-n8n/configure-n8n/security/rotate-encryption-keys.md). One-way change: take a full database backup first.                                                                                                                                                                                                                                                                                    |
| `N8N_ENV_FEAT_OAUTH2_JWE`               | Boolean                      | `false`                                                          | Set to `true` on all instances (main and workers) to enable [JWE token decryption for OAuth 2.0 credentials](/deploy/host-n8n/configure-n8n/security/decrypt-oauth-20-tokens-with-jwe.md). Preview feature.                                                                                                                                                                                                                                                                                     |
| `N8N_ENV_FEAT_TOKEN_EXCHANGE`           | Boolean                      | `false`                                                          | Set to `true` to enable [token exchange for embedding partners](/deploy/host-n8n/deploy-as-an-oem-integration/set-up-token-exchange.md). Preview feature.                                                                                                                                                                                                                                                                                                                                       |
| `N8N_OAUTH_JWE_JWKS_PER_MINUTE`         | Number                       | `60`                                                             | Per-IP rate limit on the public JWKS endpoint (`/rest/.well-known/jwks.json`) used by [JWE token decryption for OAuth 2.0 credentials](/deploy/host-n8n/configure-n8n/security/decrypt-oauth-20-tokens-with-jwe.md).                                                                                                                                                                                                                                                                            |
| `N8N_MCP_BASE_URL`                      | String                       | -                                                                | Public base URL where MCP clients reach the instance-level MCP server, when it differs from the instance base URL. Useful for deployments that serve the MCP server on a dedicated hostname (for example, `https://n8n-mcp.example.com` in front of the same instance). When set, n8n advertises the MCP server at this URL and accepts it during OAuth authentication, alongside the URL derived from the instance base URL. Doesn't affect editor or webhook URLs. Available from n8n 2.31.0. |
| `N8N_MCP_SERVER_RATE_LIMIT`             | Number                       | `100`                                                            | Maximum number of requests per IP, per 5 minutes, to the MCP server endpoint (`/mcp-server/http`).                                                                                                                                                                                                                                                                                                                                                                                              |
| `N8N_OAUTH_SERVER_REGISTER_RATE_LIMIT`  | Number                       | `10`                                                             | Maximum number of requests per IP, per 5 minutes, to the OAuth server client registration endpoint (`/oauth/register` and `/mcp-oauth/register`).                                                                                                                                                                                                                                                                                                                                               |
| `N8N_OAUTH_SERVER_AUTHORIZE_RATE_LIMIT` | Number                       | `50`                                                             | Maximum number of requests per IP, per 5 minutes, to the OAuth server authorization endpoint (`/oauth/authorize` and `/mcp-oauth/authorize`).                                                                                                                                                                                                                                                                                                                                                   |
| `N8N_OAUTH_SERVER_TOKEN_RATE_LIMIT`     | Number                       | `20`                                                             | Maximum number of requests per IP, per 5 minutes, to the OAuth server token endpoint (`/oauth/token` and `/mcp-oauth/token`).                                                                                                                                                                                                                                                                                                                                                                   |
| `N8N_OAUTH_SERVER_REVOKE_RATE_LIMIT`    | Number                       | `30`                                                             | Maximum number of requests per IP, per 5 minutes, to the OAuth server token revocation endpoint (`/oauth/revoke` and `/mcp-oauth/revoke`).                                                                                                                                                                                                                                                                                                                                                      |
| `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. Combining `N8N_PATH` with reverse proxies can cause folder navigation issues. Use a subdomain (for example, `n8n.example.com`) or use `N8N_PATH` without reverse proxy.                                                                                                                                                                                                                                                                                                |
| `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                       | `https://api.n8n.io/versions/`                                   | The endpoint to retrieve where version information.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `N8N_VERSION_NOTIFICATIONS_INFO_URL`    | String                       | `https://docs.n8n.io/getting-started/installation/updating.html` | The URL displayed in the New Versions panel for more information.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `N8N_DIAGNOSTICS_ENABLED`               | Boolean                      | `true`                                                           | Whether to share selected, anonymous [telemetry](https://docs.n8n.io/privacy-and-security/) with n8n. Note that if you set this to `false`, you can't enable Ask AI in the Code node.                                                                                                                                                                                                                                                                                                           |
| `N8N_DIAGNOSTICS_CONFIG_FRONTEND`       | String                       | `1zPn9bgWPzlQc0p8Gj1uiK6DOTn;https://telemetry.n8n.io`           | Telemetry configuration for the frontend.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `N8N_DIAGNOSTICS_CONFIG_BACKEND`        | String                       | `1zPn7YoGC3ZXE9zLeTKLuQCB4F6;https://telemetry.n8n.io/v1/batch`  | 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. Refer to [Configure the Base URL](/deploy/host-n8n/configure-n8n/basic-configuration/configuration-examples/configure-the-base-url.md).                                                                                                                                                                                                                                              |
| `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).                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `N8N_PUBLIC_API_DISABLED`               | Boolean                      | `false`                                                          | Whether to disable the public API (true) or not (false).                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `N8N_PUBLIC_API_ENDPOINT`               | String                       | `api`                                                            | Path for the public API endpoints.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `N8N_GRACEFUL_SHUTDOWN_TIMEOUT`         | Number                       | `30`                                                             | How long should the n8n process wait (in seconds) for components to shut down before exiting the process.                                                                                                                                                                                                                                                                                                                                                                                       |
| `N8N_DEV_RELOAD`                        | Boolean                      | `false`                                                          | When working on the n8n source code, set this to `true` to automatically reload or restart the application when changes occur in the source code files.                                                                                                                                                                                                                                                                                                                                         |
| `N8N_REINSTALL_MISSING_PACKAGES`        | Boolean                      | `false`                                                          | If set to `true`, n8n will automatically attempt to reinstall any missing packages.                                                                                                                                                                                                                                                                                                                                                                                                             |
| `N8N_TUNNEL_SUBDOMAIN`                  | String                       | -                                                                | Specifies the subdomain for the n8n tunnel. If not set, n8n generates a random subdomain.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `N8N_PROXY_HOPS`                        | Number                       | 0                                                                | Number of reverse-proxies n8n is running behind.                                                                                                                                                                                                                                                                                                                                                                                                                                                |

[^1]: n8n templates are pre-built workflows designed by n8n and community members that you can import into your n8n instance. When using templates, you may need to fill in credentials and adjust the configuration to suit your needs.
