# Backup Configuration

Configure backup paths and S3 settings for Blnk backups.

This page covers the settings Blnk uses for backup storage, including the local backup path and the credentials needed for S3-compatible object storage.

## Backup settings

Use these settings to choose where backup files are written and how Blnk connects to S3 or another S3-compatible service.

<CodeGroup>
```bash blnk.env
BLNK_BACKUP_DIR=
BLNK_AWS_ACCESS_KEY_ID=
BLNK_AWS_SECRET_ACCESS_KEY=
BLNK_S3_ENDPOINT=
BLNK_S3_BUCKET_NAME=
BLNK_S3_REGION=
```

```json blnk.json
{
  "backup_dir": "",
  "aws_access_key_id": "",
  "aws_secret_access_key": "",
  "s3_endpoint": "",
  "s3_bucket_name": "",
  "s3_region": ""
}
```
</CodeGroup>

<ParamField name="BLNK_BACKUP_DIR">
Local directory path Blnk uses when writing backup files.
</ParamField>
<ParamField name="BLNK_AWS_ACCESS_KEY_ID">
Access key ID used to authenticate with S3.
</ParamField>
<ParamField name="BLNK_AWS_SECRET_ACCESS_KEY">
Secret access key used to authenticate with S3.
</ParamField>
<ParamField name="BLNK_S3_ENDPOINT">
Custom S3 endpoint, usually used for S3-compatible storage providers.
</ParamField>
<ParamField name="BLNK_S3_BUCKET_NAME">
Bucket name where backup files are stored.
</ParamField>
<ParamField name="BLNK_S3_REGION">
Region for the S3 bucket.
</ParamField>

<Warning>
**Important:** Store `BLNK_AWS_ACCESS_KEY_ID` and `BLNK_AWS_SECRET_ACCESS_KEY` as secrets. Do not commit them to version control.
</Warning>

### `BLNK_BACKUP_DIR`

Use this to tell Blnk where backup files should be written before they are stored or uploaded.

Set a path that your Blnk process can read from and write to. If you are running Blnk in containers, make sure the directory is backed by a mounted volume instead of short-lived container storage.

<RelatedTopics
  items={[
    { title: "Backup to disk", href: "/operating/backup-disk" },
    { title: "Backup to S3", href: "/operating/backup-s3" },
    { title: "Data stores", href: "/operating/configuration/data-stores" },
  ]}
/>