Back to blog

How to set up Cloudflare R2 from scratch and manage it with Nubbo

Cloudflare R2 is one of the most attractive cloud storage options available today: it’s S3-compatible, offers 10 GB of free storage forever, and charges zero egress fees — meaning you never pay for downloading your own files. In this guide, you’ll set everything up from scratch and connect it to Nubbo to manage your files from a clean, modern interface.

What is Cloudflare R2?

Cloudflare R2 is an object storage service built on Cloudflare’s global network. It’s fully compatible with the S3 API, so any tool that works with S3 also works with R2. What makes it stand out:

  • Zero egress fees: Unlike AWS S3 or DigitalOcean Spaces, R2 never charges you for downloading or serving your files. This is a game-changer if you serve a lot of content.
  • 10 GB free forever: The free tier includes 10 GB of storage, 10 million Class B operations (reads) and 1 million Class A operations (writes) per month — with no time limit.
  • Globally distributed: R2 automatically stores your data across multiple regions for low latency, no region selection needed.
  • S3-compatible API: Works seamlessly with any S3-compatible tool, including Nubbo.

Common use cases:

  • Serving images and assets: zero egress fees make R2 ideal for websites and apps that serve a lot of media.
  • Backups: store project and database backups without worrying about download costs.
  • Media libraries: photographers, designers, and content creators can store and access their files for free.
  • Static hosting: host static files and assets with Cloudflare’s global CDN.

Step 1: Create a Cloudflare account

If you already have a Cloudflare account, skip to the next step.

  1. Go to dash.cloudflare.com and click Sign up.
  2. Enter your email and choose a password.
  3. Verify your email address.
  4. Once logged in, you’ll land on the Cloudflare Dashboard.

No credit card is required for the R2 free tier.

Step 2: Create an R2 bucket

  1. In the Cloudflare Dashboard sidebar, go to Storage & Databases > R2 Object Storage > Overview.
  2. If this is your first time using R2, you may be asked to activate the service.
  3. Click Create Bucket.
  4. Choose a name for your bucket (for example, my-files). R2 is globally distributed, so you don’t need to select a region.
  5. Click Create Bucket to confirm.

Step 3: Generate API credentials

You need an API token so Nubbo can access your R2 bucket.

  1. From the R2 Overview page, look for Account details on the right side. Note down your Account ID — you’ll need it later.
  2. In the same section, click Manage R2 API Tokens.
  3. Click Create API Token.
  4. Give the token a name (for example, nubbo-access).
  5. Under Permissions, select Object Read & Write.
  6. Optionally, restrict the token to a specific bucket for tighter security.
  7. Click Create API Token.
  8. Save the Access Key ID and Secret Access Key somewhere safe. The secret is only shown once.

Your S3 API endpoint is automatically derived from your Account ID:

https://<your-account-id>.r2.cloudflarestorage.com

Step 4: Configure CORS

CORS (Cross-Origin Resource Sharing) allows Nubbo to upload files directly from your browser to R2. Without it, uploads will be blocked.

  1. Go to Storage & Databases > R2 Object Storage > Overview.
  2. Click on your bucket name to open it.
  3. Go to the Settings tab.
  4. Scroll down to CORS Policy and click Edit (or Add).
  5. Add the following configuration:
[
  {
    "AllowedOrigins": ["*"],
    "AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
    "AllowedHeaders": ["*"],
    "ExposeHeaders": ["ETag"],
    "MaxAgeSeconds": 3600
  }
]
  1. Click Save.

For extra security, replace "*" in AllowedOrigins with "https://app.nubbo.app" to restrict uploads exclusively to Nubbo.

Step 5: Connect to Nubbo

Everything is ready on the Cloudflare side. Now connect your bucket to Nubbo.

  1. If you don’t have an account yet, sign up for free on Nubbo.
  2. Once inside, click Add Provider in the sidebar.
  3. Select Cloudflare R2 as the provider type.
  4. Nubbo includes a built-in step-by-step guide inside the setup wizard that you can check at any time.
  5. Give the connection a descriptive name (for example, “My R2 storage”).
  6. Enter the credentials from Step 3: your Access Key ID and Secret Access Key.
  7. Enter your Account ID. The endpoint URL is generated automatically.
  8. Type the bucket name you created in Step 2.
  9. Click Test connection to verify everything works.
  10. If the test passes, save the provider.

You can also use Smart mode: paste your credentials in CSV, JSON, or environment variable format and Nubbo will detect them automatically.

From now on, you’ll be able to browse your files, upload with drag & drop, preview images and videos, search files, share them with public links, and much more — all from the Nubbo interface.

Cloudflare R2 free tier at a glance

ResourceFree allowance
Storage10 GB
Class B operations (reads)10 million / month
Class A operations (writes)1 million / month
Egress (data transfer out)Always free
Time limitNone — free forever

This makes R2 one of the most generous free tiers in cloud storage today, especially when combined with zero egress fees.

Summary

In five steps you’ve set up everything you need:

  1. Cloudflare account created (no credit card required).
  2. R2 bucket created with global distribution.
  3. API token generated with read/write permissions.
  4. CORS configured to allow browser uploads.
  5. Bucket connected to Nubbo and ready to use.

Nubbo also supports AWS S3 and DigitalOcean Spaces, so if you use multiple providers you can manage them all from the same place.


Ready to get started? Create your free account and connect your first R2 bucket in minutes.