Host a bucket mirror on Cloudflare R2
The recommended main mirror. R2 charges nothing for downloads, so the bill depends only on how much you store. You need no server and open no port.
Checked against Cloudflare's documentation and pricing on 2026-11-07. Prices change; check the R2 pricing page before you budget.
Before you start
- A Cloudflare account.
- A domain added as a zone in the same Cloudflare account. A full setup (Cloudflare runs the domain's DNS) is simplest. A partial (CNAME) setup also works if the DNS stays elsewhere.
- The Sovereign desktop app with Help keep models available and Cloud storage: Library 0.24 or later (Mac build 10, Linux revision 5). See the desktop guide.
- At least one backed-up model whose licence allows sharing.
- For the final check: a second computer with the standalone tools (installation).
The examples use the bucket sovereign-mirror and the address
mirror.example.org. Use your own.
Steps
-
Turn on R2. In the Cloudflare dashboard, open Storage & databases → R2 → Overview. If R2 is not active yet, complete the checkout to add the R2 subscription. Cloudflare can ask for a payment method even if you stay inside the free tier.
-
Create the bucket. Choose Create bucket and enter
sovereign-mirror(lowercase letters, numbers and hyphens, 3–63 characters).- Location: leave it automatic, or choose the hint nearest most of your recipients.
- Default storage class: Standard. Infrequent Access adds retrieval fees and is outside the free tier.
- Jurisdiction: leave it unset unless your data must stay in one
(EU, FedRAMP or US). It cannot be changed later. A jurisdiction bucket
has its own S3 endpoint,
https://ACCOUNT_ID.JURISDICTION.r2.cloudflarestorage.com; choose the same jurisdiction in step 7 and Sovereign uses it.
New buckets are private. Public reads come only from the next step.
-
Connect your own domain. Open the bucket's Settings → Custom Domains → Add. Enter
mirror.example.org, choose Continue, review the DNS record Cloudflare will add, then choose Connect Domain. Wait until the domain shows as Active.Use a custom domain, not the
r2.devaddress. Cloudflare saysr2.devaccess "is rate-limited and should only be used for development purposes." A custom domain is also yours: if you ever move the mirror, the name can move with it. -
Keep
r2.devoff. Under Settings → Public Development URL, the status should be disabled. If it is on, choose Disable, typedisallowand confirm. -
Copy your account ID. It is shown under Account Details on the R2 Overview page: 32 letters and digits. It is not a secret.
-
Create a key for this one bucket. On the R2 Overview page, under Account Details, choose Manage next to API Tokens, then Create Account API token:
- Permissions: Object Read & Write.
- Specify bucket(s): Apply to specific buckets only, then
sovereign-mirror. - Leave the client IP filter empty unless your computer has a fixed address.
Choose Create API Token. Cloudflare shows an Access Key ID and a Secret Access Key. The secret is shown once. Leave this page open and go straight to the next step; do not save the keys in a file, a note or a message. If you lose the secret, delete the token and create a new one.
An account token keeps working if your own Cloudflare user is removed. A User API token works the same way if you cannot create account tokens.
-
Connect it in Sovereign. Open Sharing → Help keep models available → Cloud storage → Set up cloud storage and choose Cloudflare R2:
Field Value Account ID the ID from step 5 Jurisdiction (optional) Default, or the one you chose in step 2 Bucket name sovereign-mirrorPublic address https://mirror.example.orgAccess key ID paste from step 6 Secret access key paste from step 6 The keys go only into these two fields. Sovereign stores them in the computer's keychain and sends them only to Cloudflare.
Older app versions (Library 0.24 and earlier) have no jurisdiction choice. For a jurisdiction bucket there, choose Other S3-compatible storage with Endpoint
https://ACCOUNT_ID.eu.r2.cloudflarestorage.com(orfedramp,us), Regionauto, the bucket name and your public address. A bucket connected that way keeps working after you update. -
Choose Check and connect. Sovereign uploads a small test file, downloads it without credentials from
https://mirror.example.organd deletes it.- Ready: the panel shows Keeping a copy in Cloudflare R2 · sovereign-mirror and People download from https://mirror.example.org. Close the token page in Cloudflare.
- The upload didn't work: check the account ID, the bucket name and the keys, and that the token has Object Read & Write on this bucket.
- Nobody could download from the public address: the custom domain is not active yet, or the address you entered differs from it.
-
Let it upload. With sharing on, Sovereign uploads each shared model: objects first, the signed manifest last. Cloud uploads count toward the same daily and monthly upload limits as sharing from this computer, if you set any (they are off by default). The panel lists each model under In the bucket now, with its manifest ID, size and upload time. Export verification info saves a sharing file per model for recipients and shows the signing key to tell them separately (see bucket mirrors).
-
Confirm downloads work from another computer. In the bucket's Objects view, open the
manifests/folder. Each file is namedMANIFEST_SHA256.json; copy one ID. On the second computer:curl -fsS -o /dev/null -w '%{http_code}\n' \
https://mirror.example.org/manifests/MANIFEST_SHA256.json
curl -fsS -o /dev/null -w '%{http_code}\n' \
https://mirror.example.org/.well-known/sovereign/peers.json
model-preserve fetch MANIFEST_SHA256 --trust publisher-trust.json \
--mirror https://mirror.example.org --store ./mirror-checkBoth
curllines should print200.peers.jsonappears after the first model has synced.publisher-trust.jsonis the trust snapshot for the key that signed the model, enrolled independently as for any fetch (see quickstart). The fetch verifies every byte; its JSON receipt names the manifest and the verified byte count. Pick a small model; fetch stops at 20 GiB unless you pass--max-bytes. Delete./mirror-checkafterwards.
Optional hardening
- Budget alert: Manage Account → Billing → Billable Usage → Create budget alert (Pay-as-you-go accounts). Set a dollar threshold and your email.
- Rate limiting: the Free plan includes one rate-limiting rule on the zone,
counted per IP address. A rule on the path
/objects/limits a single client's request flood. Downloads are free, but read requests beyond 10 million a month are not. - Caching: not needed. Egress is free either way. By default Cloudflare
caches only some file types on a custom domain, and not Sovereign's
extension-less objects or
.jsonmanifests. A Cache Rule can cache/objects/*; those are immutable and uploaded with a one-yearCache-Control. Leave/manifests/*and/.well-known/*uncached so a withdrawal takes effect at once.
What this costs
R2 Standard, from the pricing page (2026-11-07):
| Item | Price | Free each month |
|---|---|---|
| Storage | $0.015 per GB-month | 10 GB-month |
| Class A operations (uploads, lists) | $4.50 per million | 1 million |
| Class B operations (downloads, HEAD) | $0.36 per million | 10 million |
| Data transfer out (egress) | free | unlimited |
| Stored | Approximate monthly bill |
|---|---|
| 100 GB | $1.35 |
| 500 GB | $7.35 |
| 2 TB | $30 |
The number of downloads does not change these figures until reads pass 10 million a month. Uploads use one Class A operation per 64 MiB part, so 2 TB is about 32,000 operations, inside the free million. Storage is billed until you empty the bucket.
What this exposes
- The bucket is public at
mirror.example.org. Anyone can download every object in it and see which models it holds. It is not anonymous. - Cloudflare knows who owns the account and sees every request and the downloader's address. Your domain's DNS records are public.
- The mirror's signed card and
peers.jsonadvertise the address, and discovery (DHT, Nostr) can publish it further. - The bucket cannot list itself through the custom domain, and your home address is not involved.
- Cloudflare can suspend an account or act on abuse reports. Serve only models whose licences allow redistribution.
How to stop
- In Sovereign, turn Help keep models available off. Sovereign withdraws the models by deleting their manifests from the bucket. Wait until the panel says the models are out of the bucket.
- Choose Disconnect. Sovereign forgets the keys on this computer. The bucket's contents stay as they are.
- In Cloudflare, delete the API token (R2 → Overview → API Tokens → Manage).
- Remove the custom domain: bucket Settings → Custom Domains, the domain's … menu, Remove domain. This also removes its DNS record.
- Empty and delete the bucket: Settings → Delete Bucket, choose Empty Bucket, then Delete. Storage billing stops once the bucket is empty.
Sources (checked 2026-11-07)
- R2 get started
- Create buckets
- Public buckets and custom domains
- Authentication and API tokens
- S3 API compatibility (region
auto) - Data location and jurisdictional endpoints and the US jurisdiction
- Pricing
- R2 and the Cloudflare cache
- Budget alerts
- Rate limiting rules
- Delete buckets
- Application services terms: the CDN section points large-file serving at paid services such as "the Developer Platform", of which R2 is part.