Skip to content

Cloudflare R2 Configuration

Cloudflare R2 is an S3-compatible object storage service. Its biggest advantage is zero egress fees, making it an ideal choice for Obsidian multi-device sync and cloud hyperlinks.

  1. Log in to the Cloudflare Dashboard.
  2. Select R2 from the left menu.
  3. First-time users may need to bind a credit card or PayPal for identity verification (R2 has a generous free tier: 10GB storage, 1M Class A operations, 10M Class B operations per month).
  1. Click Create bucket.
  2. Enter a bucket name (e.g., my-obsidian-vault).
  3. Choose a region close to you (or keep the default Automatic).
  4. Click Create bucket.
  1. Return to the R2 home page and click Manage R2 API Tokens on the right.
  2. Click Create API token.
  3. Set permissions to Edit (read and write).
  4. Set TTL to Forever or your preferred duration.
  5. Click Create API Token.
  6. Important: Save the generated Access Key ID and Secret Access Key.

Open the Sync Vault settings in Obsidian, choose S3 mode, and fill in the following:

FieldValue
Endpointhttps://<ACCOUNT_ID>.r2.cloudflarestorage.com
Regionauto
BucketYour bucket name
Access KeyYour Access Key ID
Secret KeyYour Secret Access Key

Tip: Your <ACCOUNT_ID> can be found in the right sidebar of the R2 home page.

To allow desktop and mobile clients to access R2, you must configure CORS:

  1. Go to your bucket → Settings tab.
  2. Find CORS Policy → Click Add CORS policy.
  3. Paste the following JSON:
[
{
"AllowedOrigins": [
"app://obsidian.md",
"capacitor://localhost",
"http://localhost"
],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
"AllowedHeaders": ["*"],
"ExposeHeaders": ["ETag"]
}
]
  1. Save the policy.

Once configured, click “Test Connection” in Sync Vault. A successful test means you are ready to go.