Connect and automate

Cloudflare R2 Storage Integration

How to connect your Cloudflare R2 account for S3-compatible file storage.

Developers and Administrators3 min read

Cloudflare R2 Storage Integration

NoCodeBackend integrates directly with Cloudflare R2 to provide you with incredibly cheap, S3-compatible file storage directly attached to your databases. This allows you to upload, manage, and deliver files securely without egress fees.

Why Cloudflare R2?

Cloudflare R2 is an S3-compatible object storage service that charges zero egress fees. This makes it the perfect companion for modern web apps that serve a lot of images, videos, or user-uploaded files.

How to Connect Your R2 Account

Connecting your Cloudflare account to NoCodeBackend is simple and secure. We use your S3 credentials so you maintain full control over your storage.

1. Get Your Cloudflare Account ID

  1. Log in to your Cloudflare Dashboard.
  2. Click on R2 in the left sidebar.
  3. On the right side of the screen, copy your Account ID.

2. Generate an API Token

  1. In the R2 dashboard, click Manage R2 API Tokens.
  2. Click Create API token.
  3. CRITICAL STEP: For permissions, you must select Admin Read & Write. (Note: If you only select "Object Read & Write", NoCodeBackend will not be able to automatically create buckets or configure CORS for you).
  4. Click Create API Token.
  5. Copy the Access Key ID and Secret Access Key. (Keep this screen open until you save them in NoCodeBackend, as the secret key will never be shown again).

3. Connect to NoCodeBackend

  1. Go to the R2 Storage page in your NoCodeBackend dashboard.
  2. Select the database instance you want to connect to storage.
  3. Paste your Account ID, Access Key ID, and Secret Access Key.
  4. Enter a new Bucket Name (e.g., my-app-uploads).
  5. Click Save Configuration.

NoCodeBackend will automatically create the bucket in your Cloudflare account and apply the necessary CORS policies so you can upload files directly from your browser!

Reusing Existing Connections

If you have multiple databases on NoCodeBackend, you don't need to create a new API token for each one.

When configuring a new database:

  1. Select "Reuse an existing connection".
  2. NoCodeBackend will automatically copy your credentials securely.
  3. You can either share the same bucket, or toggle "Create a new bucket for this database" to keep your files logically separated within the same Cloudflare account.

Public URLs & Custom Domains

By default, R2 buckets are private. If you want your uploaded files to be accessible to the public (e.g., for profile pictures, avatars, product images):

  1. Go to your Cloudflare Dashboard → R2 Storage.
  2. Click on your newly created bucket.
  3. Go to the Settings tab and scroll down to Public Access.
  4. 🌟 Recommended (Production): Click Connect Domain to bind your custom domain (e.g., https://cdn.yourdomain.com). Cloudflare automatically provisions SSL and global CDN edge caching with zero rate limits!
  5. Alternative (Development): Click Allow Access under the r2.dev subdomain to get a public URL like https://pub-xxxx.r2.dev.
  6. Paste your custom domain or r2.dev URL into the Public URL field in NoCodeBackend R2 Storage settings.
Cloudflare R2 Storage Integration | Help Center