Skip to main content

R2 Cloudflare Setup

Cloudflare R2 is an S3-compatible object storage service with no egress fees — making it a cost-effective choice for organisations with high document volumes or large file sizes. R2 is a good fit for teams that want cloud-native storage outside Microsoft's ecosystem.

Prerequisites

  • A Cloudflare account with R2 enabled
  • An R2 bucket created and ready to receive files
  • An R2 API token with Object Read & Write permissions on the bucket
  • Org Admin access in Kazinex

Step 1: Create an R2 bucket in Cloudflare

  1. Log in to your Cloudflare dashboard.
  2. Navigate to R2 Object Storage.
  3. Click Create Bucket.
  4. Choose a bucket name (e.g. kazinex-documents) and select the storage region closest to your team.
  5. Click Create Bucket.
tip

Use a dedicated bucket for Kazinex documents rather than a shared bucket. This simplifies permissions management and makes it easy to set bucket-level policies if needed.

Step 2: Create an R2 API token

  1. In the Cloudflare dashboard, go to R2 Object StorageManage R2 API Tokens.
  2. Click Create API Token.
  3. Configure the token:
    • Permissions: Object Read & Write
    • Specify bucket: Select the bucket you created in Step 1
    • TTL: Leave as No expiry (or set an expiry consistent with your security policy)
  4. Click Create API Token.
  5. Copy the Access Key ID and Secret Access Key — you will need both in Kazinex. The secret is shown only once.

Step 3: Configure R2 in Kazinex

  1. In Kazinex, go to SettingsStorage.
  2. Click Configure on the R2 Cloudflare card.
  3. Enter the following:
FieldDescription
Account IDYour Cloudflare Account ID (found in the Cloudflare dashboard sidebar under your account name)
Access Key IDThe Access Key ID from the API token you created
Secret Access KeyThe Secret Access Key from the API token
Bucket nameThe exact name of the R2 bucket (e.g. kazinex-documents)
JurisdictionOptional — the R2 jurisdiction prefix if you created the bucket in a specific jurisdiction (eu, fedramp). Leave blank for the default global region.
  1. Click Save.

Step 4: Verify the connection

Click Test Connection on the R2 card. Kazinex will:

  1. Attempt to list objects in the bucket using the provided credentials
  2. Write a test file and confirm it can be read back
  3. Delete the test file

A Verified badge confirms successful connection. If the test fails, check:

  • The Access Key ID and Secret Access Key are correctly copied (no trailing spaces)
  • The token has Object Read & Write permission on the specified bucket
  • The bucket name is an exact match (R2 bucket names are case-sensitive)
  • Your Cloudflare account has R2 enabled (it may require a payment method on file)

File organisation in R2

Files are stored with the following object key structure:

/{organisation-id}/{project-id}/{document-id}/{revision-id}/{filename}

Objects are not organised in folders visible in the Cloudflare dashboard — R2 uses a flat namespace with prefixed keys. The structure above appears as "folders" in the Cloudflare R2 browser using the prefix delimiter.

File size limits

R2 supports individual files up to 5 TB. Kazinex enforces its own configurable limit per organisation (see File Restrictions). The default is 500 MB unless overridden by your plan.

S3 compatibility

R2 is S3-compatible. If your organisation uses S3-compatible tooling (custom scripts, migration tools), you can connect those tools directly to the R2 bucket alongside Kazinex. Use the Cloudflare R2 endpoint:

https://{account-id}.r2.cloudflarestorage.com

Setting R2 as the default provider

After verifying, click Set as Default on the R2 card. New document uploads will use R2. Existing documents remain in their original provider.

What's next