Cloud Computing 5 min read

How to Build a Free Personal Image Hosting Service with Cloudflare R2 and PicGo

This guide walks through the reasons for creating a custom image bed, explains why Cloudflare R2 is chosen over domestic providers, and provides step‑by‑step instructions for setting up an R2 bucket, binding a domain, configuring public access, and integrating PicGo for automatic uploads.

JavaEdge
JavaEdge
JavaEdge
How to Build a Free Personal Image Hosting Service with Cloudflare R2 and PicGo

Why Build a Personal Image Bed?

Technical writers often use Markdown and need external image links for multi‑platform publishing; a personal image service ensures images remain accessible after blog migrations, especially when platforms like Juejin, JianShu, or YuQue enforce hotlink protection.

Why Choose Cloudflare R2?

Generous free tier

Free CDN

No domain备案 required for custom domains

Even if the free quota is exceeded, the cost remains low; pricing details are available on the Cloudflare R2 plans page.

Why Not Domestic Providers?

Qiniu

Free tier exists but requires a domestically备案ed domain, which many prefer to avoid due to annual reviews.

Tencent Cloud

No free tier, conflicting with open‑source principles

Complex pricing and excessive marketing jargon make it cumbersome

Alibaba Cloud

No free tier

High cost; a mainland traffic package for a year is expensive

Creating an R2 Bucket

Purchase R2 Plan

Requires a credit card (UnionPay supported)

No upfront payment; verification is sufficient

Create Bucket

Choose any compliant name; keep it simple. If the primary audience is in mainland China, select the Asia‑Pacific region.

Name can be arbitrary as long as it follows naming rules

Recommend the Asia‑Pacific region for mainland users

Bind Custom Domain to Bucket

Bind a domain (e.g., my-img.javaedge.cn) to access files via your own URL. Ensure the domain is already resolved in Cloudflare; otherwise, set up DNS first.

After entering the domain, wait about a minute for the status to become Active.

Enable Public Access

If not enabled, uploaded images cannot be accessed publicly. After turning on public access, the bucket is ready for use.

Generate an R2 API Token

Create an API token in the Cloudflare dashboard to allow PicGo to upload images to the bucket.

Configure PicGo for Automatic Uploads

Install the S3 Plugin

Search for the S3 plugin within PicGo; network latency may require multiple attempts.

After configuration, all article images are uploaded to the newly created image bed, confirming the setup works.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

TutorialS3R2Image HostingCloudflarePicGo
JavaEdge
Written by

JavaEdge

First‑line development experience at multiple leading tech firms; now a software architect at a Shanghai state‑owned enterprise and founder of Programming Yanxuan. Nearly 300k followers online; expertise in distributed system design, AIGC application development, and quantitative finance investing.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.