> 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/external-data-storage.md).

# External data storage

{% 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 %}

Refer to [External storage](/deploy/host-n8n/configure-n8n/scaling/use-external-storage.md) 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, `s3.us-east-1.amazonaws.com`                                                                                                                                                                                             |
| `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.                                                                                                                                                                                                                                                |
| `N8N_EXTERNAL_STORAGE_S3_AUTH_AUTO_DETECT` | Boolean | -       | Use automatic credential detection to authenticate S3 calls for external storage. This will ignore the access key and access secret and use the default [credential provider chain](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html#credchain). |

## Azure Blob Storage <a href="#azure-blob-storage" id="azure-blob-storage"></a>

{% hint style="info" %}
**Enterprise-tier feature**

You need an [Enterprise license key](/deploy/host-n8n/configure-n8n/manage-your-license.md) to store execution data in Azure Blob Storage.
{% endhint %}

To store execution data in Azure Blob Storage, set `N8N_EXECUTION_DATA_STORAGE_MODE` to `azure` and configure the variables below. `N8N_EXTERNAL_STORAGE_AZURE_CONTAINER_NAME` is always required.

For authentication, choose one of these three options. n8n checks them in this order:

1. **Connection string**: set `N8N_EXTERNAL_STORAGE_AZURE_CONNECTION_STRING`. This takes precedence over the other options, so n8n ignores the account name, key, and auto-detect when you set it. It's the simplest option and works well for local testing with Azurite.
2. **Auto-detect**: set `N8N_EXTERNAL_STORAGE_AZURE_ACCOUNT_NAME` and set `N8N_EXTERNAL_STORAGE_AZURE_AUTH_AUTO_DETECT` to `true`. n8n authenticates through Azure's `DefaultAzureCredential` chain (managed identity, environment, or Azure CLI), so no key lives in your n8n configuration. Best for production on Azure.
3. **Account name and key**: set `N8N_EXTERNAL_STORAGE_AZURE_ACCOUNT_NAME` and `N8N_EXTERNAL_STORAGE_AZURE_ACCOUNT_KEY`.

Set `N8N_EXTERNAL_STORAGE_AZURE_ENDPOINT` only if you use a custom endpoint, such as Azurite or a sovereign cloud.

| Variable                                       | Type    | Default | Description                                                                                                                                              |
| ---------------------------------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `N8N_EXTERNAL_STORAGE_AZURE_CONNECTION_STRING` | String  | -       | Connection string for Azure Blob Storage. Takes precedence over the account name and key when set.                                                       |
| `N8N_EXTERNAL_STORAGE_AZURE_ACCOUNT_NAME`      | String  | -       | Storage account name. Use with an account key or managed identity.                                                                                       |
| `N8N_EXTERNAL_STORAGE_AZURE_ACCOUNT_KEY`       | String  | -       | Storage account key. Use with the account name.                                                                                                          |
| `N8N_EXTERNAL_STORAGE_AZURE_CONTAINER_NAME`    | String  | -       | Name of the blob container to store execution data in. Required for Azure Blob Storage.                                                                  |
| `N8N_EXTERNAL_STORAGE_AZURE_ENDPOINT`          | String  | -       | Custom blob endpoint, for example for Azurite or sovereign clouds.                                                                                       |
| `N8N_EXTERNAL_STORAGE_AZURE_AUTH_AUTO_DETECT`  | Boolean | `false` | Authenticate via `DefaultAzureCredential` (managed identity, environment, or Azure CLI) instead of an account key. Ignores the account key when enabled. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.n8n.io/deploy/host-n8n/configure-n8n/basic-configuration/use-environment-variables/external-data-storage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
