ロゴ

Connect Your Own Cloudflare R2 Storage to Fileflare

This method allows you to connect your own storage server to Fileflare so that you are in control of your own storage and bandwidth. Doing this allows you to pay for your own storage via your Cloudflare account.

Cloudflare also doesn’t charge for bandwidth usage, so you can deliver many terabytes to your customers at no extra cost.

1. Sign up to Cloudflare R2

必要なのは

  1. Go to Cloudflare.com
  2. In the left navigation, go to “R2”
  3. Add your payment details
r2

2. Create a bucket

cloudflare

3. Specify jurisdiction

We will want to specify a jurisdiction so that we know what the “Region” is. We will need to enter this into Fileflare later in this tutorial. Just remember where you set it to.

In this guide, we are using the EU.

specify jurisdiction

Click “Create bucket” once you have set it.

4. In your bucket, click Settings

Go to your “Settings” for the bucket. Here is where we are going to paste some things into Fileflare.

setting

4.1 Copy the URL from “Bucket details”

Copy the URL without the bucket name so that we can paste it to Fileflare in the “Endpoint” box.

url

Go to Fileflare > Settings > Configure custom S3. Paste the URL to Fileflare’s “Endpoint” box (without the bucket name at the end of the URL).

custom s3
Screenshot 2023 09 22 at 09.22.15 1

4.2 Copy and paste the CORS text from Fileflare to Cloudflare

Go back to Fileflare’s custom S3 settings page and copy the below code.

cors text

Go to the Cloudflare bucket settings page again. Scroll down until you see the CORS setting. Click on the “Add CORS policy” button.

cors policy

Paste the CORS text you copied from Fileflare to this box and overwrite the text there and save.

cors paste

3. Create the API keys

Go to the Overview page and click “Manage R2 API Tokens”.

r2 page

Create API token.

create api token

Make sure you choose “Admin Read & Write”. This is important.

admin read & write

Click the “Create API Token” button to create it.

All you need is the Access Key ID and the Secret Access Key. Copy them to the Fileflare page in the correct boxes.

api key
dda

7. In Fileflare, fill out the final details

In the “Bucket” box, enter your bucket name.

In the “Region” box, enter the region that you selected when creating the bucket. Use the code in the left column in the table below.

Region text to enter into the “Region” boxRegion
wnamWestern North America
enamEastern North America
weurWestern Europe
eeurEastern Europe
apacAsia-Pacific

Because we chosen Eastern EU, we entered “eeur”.

box

Leave the “Folder” box as it is.

Adjust the checkboxes to suit your needs. We would recommend these settings in the image below.

設定

8. Done

Now click “Save”, and all should be done.