B2 + Cloudflare: Free Unlimited Egress, Configured Right
$6.95/TB + $0 egress, unlimited the number that matters here
By Stan K.
Backblaze B2 costs $6.95/TB and, through the Cloudflare Bandwidth Alliance, egress is free with no cap. The recipe — CNAME, Transform Rule, cache headers — plus the one bypass that puts you back on the meter.
The cheapest legitimate way to serve files on the internet in 2026 is a combination, not a provider: Backblaze B2 storage + Cloudflare’s network, wired together by the Bandwidth Alliance. B2 stores at $6.95/TB/month; Cloudflare waives 100% of egress fees for B2 traffic routed through them — no cap, beyond even B2’s own generous 3× direct rule.
The configuration is ten minutes. Getting two details wrong is what makes people think it “doesn’t work.”
Step 1: the CNAME
Point a subdomain (e.g. files.yourdomain.com) as a CNAME to your B2 friendly URL, on Cloudflare DNS, with the orange-cloud proxy enabled. The proxy is the whole trick — unproxied (grey cloud) traffic goes direct to B2 and is invisible to the Alliance.
Step 2: the Transform Rule (the step everyone misses)
B2 endpoints share hostnames across customers. Without intervention, a visitor could walk other buckets. The fix is a Cloudflare Transform Rule that rewrites the URL path to /file/<your-bucket-name>/… on every request to your subdomain. Now your subdomain is effectively namespaced to your bucket, and B2 serves only your files.
Step 3: cache headers (the step that decides your real cost)
Cloudflare’s edge caches what B2 objects tell it to cache. Set Cache-Control headers on your bucket (or per-upload) so repeated fetches are served from Cloudflare’s edge instead of hitting B2 every time. B2 doesn’t bill for the reads (Class A/B/C operations are free), but the response speed of a cache-warm file versus a B2 round-trip is the difference users feel.
B2 storage $6.95/TB/month + B2 deletes at $0.004/10K + Cloudflare DNS/proxy on the free tier for most setups. Egress: $0.00, uncapped, Alliance-guaranteed — the waiver is documented in Backblaze’s own pricing FAQ.
The one bypass that puts you back on the meter
The Alliance waiver applies to traffic through Cloudflare. Tools that talk to B2 directly — rclone restores, server-to-server migrations, any API GET that resolves B2’s native hostname — bypass the waiver entirely and count against B2’s direct rule: free up to 3× your average stored volume per month, then $0.01/GB.
For a backup bucket that’s a non-issue: 3× a large archive is a lot of restore. But don’t architect a “free distribution” pipeline and then let your servers pull from the native endpoint — that’s the quiet leak. Rule of thumb: users’ browsers go through the subdomain; your infrastructure may use either, knowing the meter.
Why this beats the alternatives
The comparison for a served workload, all verified pricing:
| Setup | 2 TB stored, 8 TB served/month | Notes |
|---|---|---|
| B2 + Cloudflare | ~$14/month | storage only; egress $0 |
| Cloudflare R2 | ~$30/month | same zero-egress idea, one vendor |
| AWS S3 direct | ~$759/month | the egress tax in full |
| AWS S3 + CloudFront | ~$140–180/month | 1 TB free, then $0.085/GB |
B2+Cloudflare and R2 are the same economic species — pick by ecosystem preference (R2’s single-vendor simplicity vs B2’s lower $/TB at scale). The full provider table with operation fees is in the Cloud storage hub, and the underlying math is The Egress Tax.
One caveat before someone reads “unlimited free bandwidth” as a CDN strategy: Cloudflare’s free-tier terms have their own limits around streaming-heavy uses, and B2’s $6.95/TB is still real money at petabyte scale. This recipe is for teams who serve their own files to their own users at sane volumes — where it turns a variable, punishing cost into a fixed, boring one.