# Cloudflare R2

If you’re using Cloudflare R2, you can switch the storage driver to Cloudflare R2 under Admin > Settings > Storage > Driver.

Then configure the following:

1. Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com/) and navigate to the **R2** section.
2. Create a new bucket and note down the **Bucket name** and **Region**.
3. Go to `R2 > Access Keys` and create a new pair. Save the **Access Key ID** and **Secret Access Key**.
4. Find your **R2 Endpoint** — it's typically in the format: `https://<accountid>.r2.cloudflarestorage.com`.
5. Next up, in order to enable CDN and public access, you need to setup a [custom R2 domain](https://developers.cloudflare.com/r2/buckets/public-buckets/#custom-domains) and fill it in over the **R2 Custom Url** field.

Once all fields are configured, your storage will be routed through Cloudflare R2.

<Info>
**Notes:**

• Make sure you add your endpoint/cdn domain to the CORS policy.<br />
• If using CDN & while "Under attack mode", you might need a custom WAF rule like `(http.host eq "cdn.domain.com")` with `Skip` action.
</Info>
