Complete S3 setup · Cloudflare R2
Cloudflare R2 Setup Guide
Configure an R2 bucket, API token, CORS policy, and ShrimpSend settings.
When to use R2
- S3-compatible storage with favorable egress pricing.
- You manage your own R2 bucket and keys on Cloudflare.
Get started
- Sign in to the Cloudflare Dashboard.
- Open Build → Storage & databases → R2 object storage → Overview.

S3 API endpoint
On the R2 Overview page, under Account details:
- Account ID — may appear in the endpoint URL.
- S3 API — this is your ShrimpSend Endpoint (
https://<accountid>.r2.cloudflarestorage.com). Use the copy button.
Click API token → Manage to create keys.

Create an API token
- Go to R2 object storage → Manage R2 API tokens (or API token → Manage from account details).
- For personal use, click Create User API token.
- Grant Object Read & Write scoped to your bucket.
- Save Access Key ID and Secret Access Key (secret shown once).

Create a bucket
- On R2 Overview, click + Create bucket.
- Enter a globally unique name.
- Keep Automatic location and Standard storage class unless you have other needs.
- Click Create bucket (buckets are private by default).


Configure CORS
Browser uploads require CORS:
- Open the bucket → Settings tab.
- Select CORS policy → Edit.
- Paste the JSON below and save.

[
{
"AllowedOrigins": [
"https://xiachuan.net",
"https://www.xiachuan.net"
],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"DELETE",
"HEAD"
],
"AllowedHeaders": [
"*"
],
"ExposeHeaders": [
"ETag",
"Content-Length"
],
"MaxAgeSeconds": 86400
}
]

ShrimpSend settings
Open S3 configuration from either entry point:
- Settings → S3 — global config for all devices on the account.
- S3 cloud relay session — use S3 settings inside the session.
| Field | Notes |
|---|---|
| Endpoint | S3 API from account details; must include https:// |
| Region | auto |
| Bucket | Your bucket name |
| Path-style access | On (usually required for R2 S3 API) |
| Access Key ID | R2 token access key |
| Secret Access Key | R2 token secret |

Test connection
Run Test connection, then send a file across networks. Check DevTools if uploads fail with CORS errors.
FAQ
Region? Use auto.
403 / signature errors? Verify token scope, endpoint, and Path-style.
Built-in S3 vs your R2? Built-in is platform-hosted; this guide is for your own R2 bucket.