Contents
  1. 1. Cloudflare R2 Bucket
  2. 1.1 Create an R2 Bucket
  3. 1.2 Bind a Personal Domain to R2
  4. 1.3 Create an R2 API Token
  5. 2. PicGo Configuration

I previously used Alibaba Cloud OSS for personal image hosting, but as the number of posts and images grew and site traffic increased, image-hosting bandwidth also rose and costs kept climbing. So I looked for another platform and found that Cloudflare R2 can provide 10 GB of storage and 10 million free read requests per month.

1. Cloudflare R2 Bucket

1.1 Create an R2 Bucket

Open the Cloudflare dashboard and find R2 Object Storage on the left. On the right you can see the monthly free usage information, then add the R2 subscription to your account.

Create an R2 Bucket

Then create a bucket. The bucket name can be anything you like; if your audience is mainly in mainland China, choose the Asia-Pacific region Asia-Pacfic (APAC).

Create an R2 Bucket (2)

Create an R2 Bucket (3)

1.2 Bind a Personal Domain to R2

Then click Settings → Add Custom Domain and add your subdomain (I could add it directly because I have used a domain hosted on Cloudflare; otherwise you need to set up DNS verification manually).

Bind a Personal Domain to R2

Manually refresh the page; when both Status and Access turn green, the domain has been added successfully.

1.3 Create an R2 API Token

Go back to the R2 Object Storage overview page, find the API button on the right, and choose Manage API tokens.

Create an R2 API Token

Then create Account API tokens.

Create an R2 API Token (2)

After creation, record all of the data (these IDs and secrets are shown only once; after you close the page they will not appear again, and you can only create new ones). Never make them public either.

2. PicGo Configuration

In PicGo, search for and install the S3 plugin.

PicGo Configuration

Then fill in the fields following the examples in the figures below.

PicGo Configuration (2)

PicGo Configuration (3)

References:

  1. Cloudflare R2 Object Storage: https://developers.cloudflare.com/r2/pricing/
  2. PicGo: https://github.com/Molunerfinn/PicGo
  3. PicGo-Plugin-S3: https://github.com/wayjam/picgo-plugin-s3
  4. Huacai’s Blog. Freeloading CloudFlare R2 for personal image hosting. https://blog.huacai.one/post/3