Kernlift

Cloudflare R2

Store uploaded files with Cloudflare R2.

Before you begin

An account with access to the provider and permission to edit the settings below in Kernlift.

Expected result — an uploaded file you can download again.

Set up Cloudflare R2

Create the R2 bucket

Open Cloudflare R2. Create an R2 bucket and record its name.

Workers with an R2 binding

On Workers, bind the bucket as BUCKET in wrangler.jsonc and deploy.

S3 access with a scoped token

For S3 access instead, create a bucket-scoped Object Read & Write token. Save the S3 credentials and account endpoint.

Provider documentation · R2 bucket and credential setup · token permissions

Configure the application

Open /admin/config/storage in the Kernlift admin console.

Value from providerAdmin field
BucketBucket name
S3 endpointS3 endpoint
Signing regionRegion
Access Key IDAccess Key ID
Secret Access KeySecret Access Key

Enable uploads and select the S3 driver. For R2 over S3 use region auto. With a Worker binding, select Native bucket binding instead and skip the S3 fields. Save the configuration.

Kernlift settings for Cloudflare R2

Verify

  1. Upload a small allowed file at /app/assets/upload.
  2. Download it from /app/assets and check the content.

Troubleshooting

S3 upload fails with "Storage upload failed (403)"

The error shows the provider's own code and message. Check the access key, secret and bucket name, and that Region matches what the endpoint expects for signing.

Next steps

Set up file storage and uploads