Storage

By default, self-hosted AFFiNE uses file system(fs) to storage user uploaded or AI generated blobs. The storage directory would be UPLOAD_LOCATION you specified by environment variables.

As you might want to use a cloud-base object storage to store all the blobs, we provide the out-of-box support of aws s3 compatible storage or cloudflare r2 storage.

Admin Panel

go /admin -> Settings -> Storage to configure it.

AWS s3 compatible

Select aws-s3 in provider dropdown and update the bucket and sdk config accordingly.

asw-s3 config
config
{
  "region": "",
  "endpoint": "https://...",
  "credentials": {
    "accessKeyId": "...",
    "secretAccessKey": "...",
  }
}
format

The config body should be valid JSON object.

Cloudflare R2

Select cloudflare-r2 in provider dropdown and update the bucket and sdk config accordingly.

cloudflare r2 config
config
{
  "accountId": "",
  "credentials": {
    "accessKeyId": "...",
    "secretAccessKey": "...",
  }
}
format

The config body should be valid JSON object.