About 5 minutes
How to upload files to Cloudflare R2 and share links
Cloudflare R2 is a great match for Aktar: it has no egress fees, a free tier that covers 10 GB, and custom domains served through Cloudflare's network. You don't have to copy an account ID, a bucket name and two keys from the dashboard: Set Up Cloudflare R2… needs one API token, made from a link that fills in its permissions for you, and does the rest. Prefer to set everything up by hand? That's the last step.
What you need
- A Cloudflare account (R2's free tier covers 10 GB)
- A domain on Cloudflare if you want links on your own domain (optional)
- Aktar for Mac, Windows, iPhone, iPad or Android
Step by step
- 1
Open Set Up Cloudflare R2
In Aktar's Settings, open Destinations and choose Set Up Cloudflare R2…. When you have no destination yet, it's the main button. Then click Open Cloudflare.
- 2
Create the API token
Cloudflare's token page opens with the name Aktar and two permissions already chosen: R2 Storage: Edit, to create the bucket and upload to it, and Zone: Read, to list your domains for public links. Choose Continue to summary, then Create Token, and copy the token.
- 3
Paste it and choose
Paste the token into Aktar. Pick the account if you have more than one, then the bucket: a new one (Aktar suggests
aktar) or one you already have. Last, where public links point:- The bucket's r2.dev address works right away. Cloudflare rate-limits it, so it's best for trying things out.
- A subdomain of a domain on your Cloudflare account, like
files.example.com, is the one for real use. Cloudflare adds the DNS record and certificate, which takes a few minutes.
- 4
Set Up
Click Set Up. Aktar creates the bucket, turns on public links, saves the destination and runs Test Connection on its own. On your own domain, links get clean paths like
files.example.com/A7kdP2x.png(see short links). Choose Done, or Edit to change anything, and drop your first file on Aktar. - 5
Prefer to set it up by hand?
If you'd rather use an R2 token limited to one bucket: in the Cloudflare dashboard, open R2 Object Storage and create a bucket. In its Settings, connect a custom domain under Custom Domains or enable the Public Development URL. Then, under Manage API tokens, create a token with Object Read & Write for that bucket and copy the Access Key ID and Secret Access Key (the secret is only shown once). In Aktar, choose Add Destination, then Cloudflare R2, and fill in the values from the table below.
Settings in Aktar
Enter these values in Settings → Destinations → Add Destination. Field names match the app.
| Field | Example value |
|---|---|
| Provider | Cloudflare R2 |
| Profile Name | PersonalAny name you like. |
| Account ID | 3f9a71c0e2b8…From the R2 overview page. |
| Region | autoKeep the default. |
| Access Key ID | a1b2c3d4…From the R2 API token. |
| Secret Access Key | ••••••••Stored in the Keychain or Credential Manager. |
| Bucket | screenshots |
| Public Base URL | files.example.comYour custom domain or the r2.dev URL. |
| Object Path | {short}.{ext}Optional, see file names and folders. |
Tips
- Aktar doesn't keep the token. It turns it into S3 keys (the token's ID is the access key, a hash of its value is the secret), stores those like any other destination's keys, and forgets the token. Delete the token in Cloudflare whenever you want to cut Aktar's access.
- A custom domain is cached by Cloudflare, so popular links load fast worldwide at no extra cost.
- Set it up on one device, then use Share to Another Device to move the destination, keys included, to your other computers and phones.
- Want uploads that delete themselves after 1 to 30 days? Aktar adds the bucket's lifecycle rules for you when its keys can manage them, as keys from Set Up Cloudflare R2 or an Admin Read & Write token can. With an Object Read & Write token, add them yourself under Object Lifecycle Rules in the bucket's Settings. See expiring uploads.
Troubleshooting
Set Up says the public link doesn't work yet
Right after you connect your own domain, Cloudflare is still adding its DNS record and certificate. Wait a few minutes and run Test Connection again from the destination's menu.
Set Up finds no account for the token
The token was created without access to an account. Create it again from Open Cloudflare and keep the account it offers (or All accounts) under Account Resources.
The link returns Access Denied or 403
Make sure the Public Base URL is your custom domain or r2.dev URL. The …r2.cloudflarestorage.com endpoint is only for the API and never serves public files. More in Access Denied errors.
Test Connection says the credentials are invalid
If you set it up by hand, use the Access Key ID and Secret Access Key from an R2 API token, not a regular Cloudflare API token or your Global API Key, and check that the Account ID has no extra spaces.
Uploads work but links are slow or rate-limited
You're probably using the r2.dev development URL. Connect a custom domain for production use.
Still stuck?Browse the FAQ or ask on GitHub.