Connect your Cloudflare R2 bucket to Dreep
Create an R2 bucket and an API token scoped to it, then connect both under Settings, Storage in Dreep. Originals and generated variants land in your own Cloudflare account while delivery stays on Dreep URLs.
Set it up in six steps
Steps two to four happen in the Cloudflare dashboard. Allow about ten minutes.
- 1
Check your plan and project
BYOB needs a Starter or Pro plan and an empty project. The bucket cannot be changed later, and only the project owner can connect it.
- 2
Create the bucket
In Cloudflare R2, create a bucket such as acme-media. Leave public access off, because Dreep reads with credentials and serves through its own URLs.
- 3
Create a scoped R2 API token
Under API Tokens, create a token with Object Read & Write limited to that bucket. Admin permissions are not needed.
- 4
Copy the keys and your account endpoint
Save the Access Key ID and Secret Access Key, which are shown once. The endpoint is https://<ACCOUNT_ID>.r2.cloudflarestorage.com, or the .eu. variant for EU buckets.
- 5
Connect in Dreep
In Settings, Storage, pick Cloudflare R2 and enter the bucket name, region auto, the endpoint and both keys. Dreep writes and deletes a probe object to confirm access.
- 6
Upload exactly as before
The same API key, SDK calls and delivery URLs now read from and write to your R2 bucket.
Your upload code doesn't change
BYOB is a project setting, not an SDK option.
// Same calls as before BYOB. The bytes now land in your R2 bucket.
const upload = await dreep.presignUpload({
filename: "listing-photo.jpg",
contentType: "image/jpeg",
sizeBytes: 2_480_000,
});
// The browser PUTs to upload.uploadUrl, then:
const asset = await dreep.confirmUpload({ id: upload.id });up, err := client.PresignUpload(ctx, dreep.PresignOptions{
ContentType: "image/jpeg",
SizeBytes: 2480000,
Filename: "listing-photo.jpg",
})
// The browser PUTs to up.UploadURL, then:
asset, err := client.ConfirmUpload(ctx, up.ID, nil)curl -X POST https://api.dreep.cloud/api/v1/upload/presign \
-H "Authorization: Bearer $DREEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename":"listing-photo.jpg","contentType":"image/jpeg","sizeBytes":2480000}'Already have files in this bucket?
BYOB and import do different jobs. BYOB makes Dreep write new uploads and variants into your bucket. The separate R2 importer under Integrations copies objects that already exist into a Dreep project as a one-off background job, so a read-only token is enough for it.
Frequently asked questions
Which R2 API token permission does Dreep need?
Object Read & Write, scoped to the one bucket you connect. Admin permissions are not required.
What region do I enter for Cloudflare R2?
Enter auto. R2 doesn't use AWS-style regions, and the endpoint URL tells Dreep where the bucket lives.
Do I need a CORS rule on the bucket?
Not for uploads. Browsers PUT to the upload URL on cdn.dreep.cloud and Dreep writes to R2 from its own servers.
Can I connect R2 to a project that already has uploads?
No. BYOB has to be connected while the project is empty. Create a new project, connect R2, then use the new project's API key.
Keep your media in your own R2 account
Create a project on Starter or Pro, connect your bucket before the first upload, and ship with the same SDK calls.