---
title: "Custom Cloudflare R2 Storage"
description: "A step-by-step tutorial on setting up a Cloudflare R2 storage integration for the Topol Plugin, so uploaded files are saved to your own bucket."
url: https://docs.topol.io/email-editor/guide/custom-cloudflare-r2-storage.html
---

# Custom Cloudflare R2 Storage

> **The Custom storage feature is available with the Plugin Expansion plan and higher.**
>
> If you're on the Plugin for Startup plan, consider upgrading to access this feature. For more details, visit our [pricing page](https://topol.io/pricing) or contact support.

The Custom Cloud Storage feature in the Topol Plugin lets you connect your own storage provider. Alongside AWS S3, Google Cloud Storage, and DigitalOcean Spaces, you can also use Cloudflare R2 Storage. This tutorial walks through that setup step by step.

Throughout this guide, you will collect several values that you'll need at the very end (your **bucket name**, **public URL**, **account ID**, **access key**, and **secret key**). Save each one somewhere safe as you go.

## How to configure Custom Cloudflare R2 Storage

**1)** Sign up at [https://dash.cloudflare.com/sign-up/r2](https://dash.cloudflare.com/sign-up/r2).

**2)** Navigate to **R2 Object Storage** -> **Overview**.

![R2 Object Storage Overview](https://docs.topol.io/custom-storage/r2/r2-01-overview.png)

**3)** **Create a bucket** by clicking the **\+ Create bucket** button.

![Create bucket button](https://docs.topol.io/custom-storage/r2/r2-02-create-bucket-button.png)

**4)** Enter your **Bucket name** and leave the other settings at their defaults, then click **Create Bucket**. _Save the bucket name for the final step._

![Bucket name form](https://docs.topol.io/custom-storage/r2/r2-03-bucket-name-form.png)

**5)** Switch to the **Settings** tab. Under **General** there is a **Public Development URL** option; enable it by clicking **Enable**.

![Enable Public Development URL](https://docs.topol.io/custom-storage/r2/r2-04-enable-public-url.png)

The Public Development URL is then **displayed below**. _Save it for the final step._

![Public Development URL displayed](https://docs.topol.io/custom-storage/r2/r2-05-public-url-displayed.png)

**6)** Below the Public Development URL on the same page is the **CORS Policy** section. Click **\+ Add** to add a custom policy.

![CORS Policy Add](https://docs.topol.io/custom-storage/r2/r2-06-cors-policy-add.png)

**7)** Add the following code to the displayed console and save it by clicking the **Save** button.

```json
[
  {
    "AllowedOrigins": [
      "https://d5aoblv5p04cg.cloudfront.net",
      "https://o6lwlm3sld.execute-api.eu-west-1.amazonaws.com",
      "https://v3.develop.email-assets.topol.io",
      "https://v3.email-assets.topol.io",
      "https://v4.develop.email-assets.topol.io",
      "https://v4.email-assets.topol.io"
    ],
    "AllowedMethods": [
      "PUT",
      "GET",
      "HEAD"
    ],
    "AllowedHeaders": [
      "content-type",
      "x-goog-acl"
    ],
    "ExposeHeaders": [
      "ETag"
    ],
    "MaxAgeSeconds": 3600
  }
]
```

**8)** Get your **Account ID** from your Dashboard URL. It is always the long hex string immediately after `dash.cloudflare.com/`

`https://dash.cloudflare.com/<your-account-ID>/...`

_Save it for the final step._

**9)** Generate a **User API token** at [https://dash.cloudflare.com/?to=/:account/r2/api-tokens](https://dash.cloudflare.com/?to=/:account/r2/api-tokens). There, click **Create User API token**.

![Create User API token](https://docs.topol.io/custom-storage/r2/r2-07-create-api-token.png)

Fill out your **Token name**, set **Permissions** to **Object Read & Write**, and click **Create User API Token**.

![Token permissions](https://docs.topol.io/custom-storage/r2/r2-08-token-permissions.png)

The **Access Key ID** and **Secret Access Key** are shown only once. _Save both for the final step._

![Access Key ID and Secret Access Key](https://docs.topol.io/custom-storage/r2/r2-09-access-keys.png)

## Set your Cloudflare R2 credentials for the API Token in TOPOL

The remaining steps happen in the Topol app, using the values you saved above.

**1)** Log in to your Topol account at [https://app.topol.io/](https://app.topol.io/). The **API Tokens** tab is selected by default.

**2)** Select the API Token where you want to set up your own Cloudflare R2 storage and switch to the **Configuration** tab.

**3)** In the **Custom storage** section, click **Set up Cloudflare R2 storage**.

![Custom storage section in the API Token Configuration tab](https://docs.topol.io/custom-storage/custom-storage-options.png)

**4)** A modal will appear. Fill in the values you saved during the setup:

-   **Bucket name**: the bucket you created earlier.
-   **Account ID**: the account ID from your Dashboard URL.
-   **Access key**: the Access Key ID from your User API token.
-   **Secret key**: the Secret Access Key from your User API token.
-   **Public URL**: the Public Development URL of your bucket.
-   **Jurisdiction** (optional): fill this in only if you created your bucket under a specific jurisdiction (for example, `eu`).

![Set up your own Cloudflare R2 bucket modal](https://docs.topol.io/custom-storage/r2/r2-10-setup-modal.png)

**5)** Click **Finish setup**.

**Setup complete. The plugin now uploads files to your R2 bucket.**

If you hit any issues, contact our [support](https://topol.io/contact).
