Skip to content

Cloudflare R2

Store backups in Cloudflare R2 - S3-compatible object storage with zero egress fees.

Configuration

FieldDescriptionDefaultRequired
NameFriendly name for this destination-
Account IDCloudflare Account ID-
BucketR2 bucket name-
Access Key IDR2 API token Access Key ID-
Secret Access KeyR2 API token Secret Access Key-
Path PrefixFolder path within the bucket-

Setup Guide

  1. Create an R2 bucket in the Cloudflare DashboardR2Create bucket
  2. Create an API token: Go to R2Manage R2 API TokensCreate API token
    • Select Object Read & Write permission
    • Scope to your specific bucket (recommended)
    • Copy the Access Key ID and Secret Access Key
  3. Copy your Account ID from the Cloudflare Dashboard sidebar (top-right of any page)
  4. Go to DestinationsAdd DestinationCloudflare R2
  5. Enter Account ID, Bucket, Access Key ID, and Secret Access Key
  6. (Optional) Set a Path Prefix for organizing backups
  7. Click Test to verify the connection

Zero Egress Fees

R2 has no egress fees, making it ideal for backups you may need to restore frequently. Unlike AWS S3, downloading your backups is always free.

How It Works

  • DBackup connects to the R2 endpoint https://<accountId>.r2.cloudflarestorage.com automatically
  • Uses S3-compatible API - uploads via multipart for large files
  • All credentials are stored AES-256-GCM encrypted in the database

Troubleshooting

AccessDenied

Access Denied (403)

Solution: Verify the API token has Object Read & Write permission and is scoped to the correct bucket.

InvalidAccessKeyId

The AWS Access Key Id you provided does not exist

Solution: Ensure you're using the R2 API token credentials (not your Cloudflare Global API Key). Regenerate the token if needed.

Wrong Account ID

Could not connect to endpoint

Solution: The Account ID is visible in the Cloudflare Dashboard sidebar. Don't confuse it with the Zone ID.

Next Steps

Released under the GNU General Public License. | Privacy · Legal Notice