BACK UP SQL SERVER TO CLOUDFLARE R2
Cloudflare R2 pairs S3-compatible object storage with a pricing model that's ideal for backups: you pay for storage, but egress is free – so restoring a large database in an emergency costs nothing extra. SQL Backup Master includes a dedicated Cloudflare R2 destination template; this tutorial covers the R2-specific setup: creating a bucket, generating an R2 API token, and finding your account endpoint.
Step 1: Create an R2 bucket
Sign in to the Cloudflare dashboard and open R2 Object Storage. Create a bucket for your database backups. R2 stores data in Cloudflare's distributed infrastructure automatically; if you have data-residency requirements, you can optionally choose a location hint or a jurisdiction (such as the EU) when creating the bucket. The bucket must exist before configuring SQL Backup Master – the application will not create it for you.
Step 2: Create an R2 API token
In the R2 section of the dashboard, open Manage R2 API Tokens and create a new token with Object Read & Write permission – ideally scoped to just your backup bucket. When the token is created, Cloudflare shows an Access Key ID and Secret Access Key for S3-compatible clients: record both, as the secret is only displayed once.
Step 3: Find your account endpoint
R2's S3-compatible endpoint has the form https://<account-id>.r2.cloudflarestorage.com, where the account ID is shown on the R2 overview page (Cloudflare also displays the full endpoint alongside your bucket details). If your bucket was created in a specific jurisdiction, use the jurisdiction-specific form instead – for example https://<account-id>.eu.r2.cloudflarestorage.com for the EU.
Step 4: Create the backup job
In SQL Backup Master, create a new backup job, connect to your SQL Server instance, and select the databases to protect. These steps are common to all destinations and are covered in detail in our Amazon S3 tutorial (Steps 3–5) – the process is identical here.
Step 5: Add the Cloudflare R2 destination
In the Destinations section, click Add and double-click Cloudflare R2 (S3). In the destination settings window, enter:
- Access key – the Access Key ID from Step 2.
- Secret key – the matching Secret Access Key.
- Bucket – the name of the bucket you created in Step 1.
- Service address – your account endpoint from Step 3.
The template pre-configures the remaining S3 options with values appropriate for R2 (including disabling upload integrity checksums, which R2 handles differently than Amazon S3), so they can normally be left at their defaults. Note that R2 has no storage classes to choose from – there's a single storage tier. Click Test to verify the connection, then OK, and save the backup job.
Step 6: Schedule, run, and verify
Configure a recurring schedule if you'd like unattended backups, then run the job with Back up now. When it completes, review the job log and confirm the backup files appear in your bucket via the Cloudflare dashboard. Since R2 egress is free, it's a great destination for periodically testing your recovery path at no extra cost.
Related resources
- Visual tour: backing up SQL Server to Cloudflare R2
- Custom S3 Compatible destination help – reference for all settings in the R2 destination window.
- S3-compatible services overview