Skip to content

Cloudflare R2 Setup

Configure Mend to use Cloudflare R2 as an S3-compatible storage backend.

Cloudflare R2 is a cost-effective S3-compatible object storage service with zero egress fees.

  1. Create R2 Bucket

    • Log in to Cloudflare Dashboard
    • Navigate to R2
    • Create a new bucket
  2. Generate API Tokens

    • Go to R2 → Manage R2 API Tokens
    • Create API token with read/write permissions
    • Save Access Key ID and Secret Access Key
  3. Configure Mend

    config.yaml
    s3:
    region: auto
    endpoint: "https://<account-id>.r2.cloudflarestorage.com"
    access_key_id: "${R2_ACCESS_KEY_ID}"
    secret_access_key: "${R2_SECRET_ACCESS_KEY}"
    use_path_style: true
  4. Set Environment Variables

    .env
    R2_ACCESS_KEY_ID=your_access_key
    R2_SECRET_ACCESS_KEY=your_secret_key