CloudFlare R2 storage manager with Pages and Workers. Free 10 GB storage. Free serverless backend with a limit of 100,000 invocation requests per day. More about pricing
- Drag-and-drop upload
- Upload large files
- Create folders
- Search files
- Image/video thumbnails
Before starting, you should make sure that
- you have created a CloudFlare account
- your payment method is added
- R2 service is activated and at least one bucket is created
Steps:
- Fork this project and connect your fork with CloudFlare Pages (Deploy your site · Cloudflare Pages docs)
- Add a custom domain (Optional; you must make Cloudflare your nameserver to enable authentication, see below.)
- Bind your R2 bucket to
BUCKET
varaible - Manually redeploy to make R2 bindings take effect
Cloudflare pages settings:
- Framework preset:
None
- Build command: (empty)
- Build output directory: (empty)
- Functions > R2 bucket bindings:
BUCKET
- (select your bucket from dropdown menu)
There is no built-in authentication support. By default everyone can read and write your storage. But CloudFlare Zero Trust can be used to protect your data. Do these steps to enable authentication: (Enabling Access on your *.pages.dev
domain · Cloudflare Pages docs)
- Enable CloudFlare Zero Trust
- In Access->Applications, create a self-hosted application
- Delete the
*
from subdomain - Set Path as
api/write/
to disable public write or leave it blank to disable public read - Create a policy which accepts your email only
If you have added a custom domain:
- Add the domain to Cloudflare websites. You will be given instructions to change DNS of your whole domain.
- Follow steps 10 ~ 12 of the Enabling Access documentation.