Cloudflare R2 Setup

Connect Cloudflare R2 to Fileflare — the cheapest S3-compatible option, with free unlimited egress for Shopify digital downloads.

Beka Rice Avatar

Written by

Last updated


Cloudflare R2 is the cheapest S3-compatible storage option that works with Fileflare. Free up to 10 GB, around $15/TB after that, and — unlike AWS — no bandwidth charges, ever. For most stores, R2 is the right “bring your own storage” choice.

Available on the Growth plan and higher. R2 connects via Fileflare’s custom-S3 settings since it’s S3-compatible. Files on R2 don’t count toward your Fileflare storage quota.

When you’d use this

  • You sell large digital files and want to control storage costs.
  • You want unlimited download bandwidth without worrying about egress fees.
  • You’re already on Cloudflare and want files alongside Workers, Pages, etc.

Set up R2

1. Sign up and add billing

  1. Sign in to Cloudflare.
  2. Click R2 in the left navigation.
  3. Add billing details (free tier exists, but billing is required to enable).

2. Create a bucket

  1. Click Create bucket.
  2. Pick a name (lowercase, no spaces).
  3. Choose a jurisdiction — note this for the Fileflare region setting.
  4. Save.

3. Configure bucket access

In your bucket → Settings:

  • Domain: enable access via the r2.dev subdomain. Don’t add a custom domain — Cloudflare doesn’t pass the filename header through custom domains, breaking Fileflare delivery.
  • Endpoint URL: copy the bucket URL without the bucket name at the end. You’ll paste this into Fileflare’s Endpoint box.

4. Set CORS

In Fileflare → SettingsConfigure custom S3, copy the CORS config text. In Cloudflare, scroll to CORS policy on the bucket settings, click Add CORS policy, paste, save.

5. Create an API token

  1. R2 → Manage R2 API TokensCreate API token.
  2. Choose Admin Read & Write permissions.
  3. Click Create.
  4. Copy the Access Key ID and Secret Access Key.

Connect Fileflare to R2

In Fileflare → SettingsConfigure custom S3:

  • Access Key: paste the R2 Access Key ID.
  • Secret Key: paste the R2 Secret Access Key.
  • Endpoint: paste the bucket URL (without bucket name).
  • Bucket: your R2 bucket name.
  • Region: jurisdiction code from the table below.
  • Leave Folder empty.

Region codes

wnam → Western North America
enam → Eastern North America
weur → Western Europe
eeur → Eastern Europe
apac → Asia-Pacific

Save. Test by uploading a file from the Assets page.

Connection options

Same options apply as on AWS S3 — see the S3 doc for path-style endpoint, delete sync, and rename-on-upload details.

Common issues

  • Upload fails with CORS error — re-paste CORS from Fileflare into Cloudflare’s bucket settings.
  • Files upload but customers can’t download — confirm r2.dev subdomain access is enabled. Without it, Cloudflare won’t serve the file.
  • Wrong / missing filename in download — you’ve configured a custom domain on the bucket. Custom domains don’t pass the Content-Disposition header. Switch back to r2.dev.
  • API token won’t authenticate — token must be Admin Read & Write; read-only tokens can’t upload.

Keep learning