Connect Cloudflare Account
Cloudflare gives you DNS management and R2 object storage. No compute -- you'll need a separate provider for servers.
R2 Pricing vs S3
The big selling point of R2 is zero egress fees. You never pay to download your own backups.
| Cloudflare R2 | AWS S3 | |
|---|---|---|
| Egress | $0 (always) | $0.09/GB |
| Storage | $0.015/GB/month | $0.023/GB/month |
For 100GB of backups: R2 costs about 2.30 + egress fees every time you restore.
Create an API Token
- Go to dash.cloudflare.com (opens in a new tab) > My Profile > API Tokens > Create Token
- You can start from the "Edit zone DNS" template and add R2, or create a custom token
Required permissions:
| Scope | Permission | Access |
|---|---|---|
| Account | Cloudflare R2 Storage | Edit |
| Zone | DNS | Edit |
Set Zone Resources to All zones (or pick specific ones).
- Click Create Token and copy it immediately -- it's only shown once
You'll also need your Account ID. Find it on any domain's overview page in the right sidebar (32-character string).
Add to OEC.sh
Go to Settings > Cloud Accounts > Add Account > Cloudflare.
Enter your API Token and Account ID. Click Add Account.
The account shows Active with Storage and DNS badges.
Using Your Cloudflare Account
Backups (R2) -- Go to Settings > Storage > Quick Setup. Select or create an R2 bucket.
DNS -- Go to Settings > DNS Providers > Quick Setup. Select a domain from your Cloudflare zones. OEC.sh manages A records automatically.
Cloudflare DNS is free and includes DDoS protection on all managed domains.
R2 Location Hints
When creating R2 buckets, pick a location hint near your servers:
| Hint | Region |
|---|---|
wnam | Western North America |
enam | Eastern North America |
weur | Western Europe |
eeur | Eastern Europe |
apac | Asia Pacific |
R2 replicates globally regardless, but the hint optimizes for primary access.
Pairing Cloudflare with Compute Providers
Cloudflare works well as the DNS + storage layer alongside a compute provider:
| Setup | Use Case |
|---|---|
| Cloudflare DNS + Hetzner | Cost-effective European hosting |
| Cloudflare DNS + DigitalOcean | Simple cloud with great DNS |
| Cloudflare R2 + any provider | Zero-egress backup storage |
Troubleshooting
"Invalid API Token" -- Token is wrong or revoked. Check it in Cloudflare > API Tokens. Create a new one if needed.
"Invalid Account ID" -- Make sure you're using the Account ID (not Zone ID). It's 32 characters, found in the dashboard sidebar.
R2 operations fail -- Token needs "Cloudflare R2 Storage: Edit" permission. Also check that R2 is enabled on your account (Cloudflare Dashboard > R2).
"Zone Not Found" -- Token doesn't have access to that zone. Check the token's Zone Resources setting -- it should include the zone or "All zones".
DNS not updating -- Zone might be in pending state. Make sure your domain's nameservers at the registrar point to Cloudflare's assigned nameservers.