Cloudfare R2
Cloudflare R2 Object Storage is S3-compatible
Cloudfare R2 gives you the freedom to create the multi-cloud architectures you desire with an S3-compatible global object storage.
**⚠️ This provider doesn’t currently support object lifecycles so if you don’t handle the deletion of unused objects yourself you’ll be paying for more storage than necessary.**
Pricing
R2 provides zero-cost egress for stored objects — no matter your request rate
Here’s a snapshot of usage and pricing for Cloudflare R2:

Create an R2 Bucket
Before creating a bucket, you have to purchase the R2 plan in the Cloudflare dahboard Purchase R2
Click on R2 in the dashboard or go to https://dash.cloudflare.com/{ACCOUNT_ID}/r2
Enter your preferred unique bucket name > Click “Create bucket”
Generate an S3 Auth Token
In Account Home, select R2
Select Manage R2 API Tokens on the right side of the dashboard
Select Create API token
Select the pencil icon or R2 Token text to edit your API token name.
Under Permissions, select Edit: Allow edit access of all objects and List, Write, and Delete operations of all buckets
Select Create API Token.
After your token has been successfully created, review your Secret Access Key and Access Key ID values. ⚠️ You will not be able to access your Secret Access Key again after this step. Copy and record both values to avoid losing them.
The S3 endpoint is available via
https://{account_id}.r2.cloudflarestorage.com
endpoint
Add CORS Policy
R2’s CORS implementation currently takes the form of AWS S3’s CORSRule.
R2 allows you to directly apply CORS policy in the Cloudflare dashboard.
Go to Settings in your preferred R2 bucket
Click Edit CORS Policy in the CORS Policy section
Copy the JSON template below into the textbox
{ "AllowedOrigins": [ "*" ], "AllowedMethods": [ "GET" ], "AllowedHeaders": [], "ExposeHeaders": [] }
You can also configure your AWS SDK for R2 in your favorite language here
Enable Public Access
Cloudflare does not support public access to R2 buckets using the S3 api.
Public buckets can be set up in either one of two ways:
The first exposes your bucket as a custom domain under your control.
The second exposes your bucket as a Cloudflare-managed subdomain under https://r2.dev.
The easiest to use for testing purposes is a managed subdomain which can be setup as follows:
Log in to the Cloudflare dashboard > select your account > R2
In R2, select the bucket you want to use for streaming
Go to Settings.
In Settings, go to Bucket Accesss.
Under Bucket Access, select Allow Access
After confirming your choice in the prompt, you can now access the bucket the bucket using the Public Bucket URL.
https://pub-<HASH-KEY>.r2.dev
Configure Owncast
Navigate to the “Storage” tab in the owncast admin dashboard.
- Endpoint:
https://{account_id}.r2.cloudflarestorage.com
- Access Key: The access key you created earlier
- Secret Key: The secret key you created earlier
- Bucket: The name of the R2 bucket you created, e.g. “owncast-stream-1”
- Region:
auto
When using the S3 API, the region for an R2 bucket is auto - Serving Endpoint: URL you created when enabling public access to your R2 bucket, e.g.
"https://pub-<Hash-Key>.r2.dev"
if you are using managed subdomain. ⚠️ Must not end with slash