How To Setup Cloudflare R2 & UpdraftPlus (Free) For Remote WordPress Backups
The chepeast remote storage option for WordPress backups.
UpdraftPlus is the best WordPress backup plugin (even without the premium add-ons). It is reliable, secure, and well-supported and hence highly rated.
I personally use UpdraftPlus free version and never had a regret. The major criticism of the free plan is its limited support for popular remote storage options.
Surprisingly, Cloudflare R2 is missing from both free and premium plans.
But since R2 is an S3-compatible storage, UpdraftPlus does support it indirectly.
Table of Contents
Does UpdraftPlus plugin support Cloudflare R2 storage?
Cloudflare R2 is not a remote destination option in UpdraftPlus, even after 2 years of its release and growing popularity among developers and administrators,
But even more surprising is that even though updraftPlus supports S3 compatible storage (that too in the free tier) and mentions a few examples of S3 compatible storage, it misses out on mentioning R2 there as well.
When you click on S3 Compatible (Generic) option, it reads:
Examples of S3-compatible storage providers: DigitalOcean Spaces, Linode Object Storage, Cloudian, Connectria, Constant, Eucalyptus, Nifty, Cloudn... and many more!
But, yes, Cloudflare is supported as an S3 compatible object storage.
What is S3 Compatible Object Storage?
Amazon S3 (Simple Storage Service) is a very popular cloud storage service offered by Amazon Web Services.
While Amazon Web Services (AWS), being targetted to enterprises, is too complicated for an average Joe, Its innovation in the object storage space (i.e. Amazon S3) has a high demand in a much larger market.
As a result, new service providers have emerged which offer all the desirable features of Amazon S3 without the whole complexity of AWS.
An S3 Compatible storage is a solution that can work seamlessly with Amazon S3 (Simple Storage Service) and its associated APIs.
It means that the storage system can understand and support the same interface and protocols used by Amazon S3. It allows users to easily migrate their data and applications from Amazon S3 to a compatible system.
How To Setup Cloudflare R2 Storage in UpdraftPlus?
To set up any S3 compatible remote storage in UpdraftPlus, you need to go to Settings > updraftPlus backups in the WordPress dashboard and click on the settings tab.
Then in the “Choose your remote storage” field, select S3-Compatible (Generic) option.
Like R2, any S3 compatible storage solution would have these values.
S3 access key:
S3 secret key:
S3 location: s3generic://
You have to find these values in our Cloudflare account.
Note: it is an excellent reminder to check if you have enabled a daily or weekly schedule for backups. The default value “Manual” will not take automatic backups at all.
Step 1: Create a new bucket in cloudflare R2
In your Cloudflare dashboard “Home,” you will find the R2 tab in the left sidebar menu.
If it is not enabled, you will need to attach a Credit Card for billing. R2 storage is free upto 10 GB and very affordable thereafter (see their pricing page). But you need to have a valid credit card in order to take their service.
Click on Create Bucket. You only need to enter a bucket name. Bucket name should be lowercase letters, numbers, and hyphens (-). Need not to be unique. No other settings to touch.
Note: You can not manually create folders/directories in your bucket, but you can create as many directly from the updraftplus setting using the API.
Step 2: Find your S3 end-point
Notice a URL just below your newly created bucket name. This is your S3 endpoint.
Click on the tiny copy icon next to this URL and save in your text editor.
UpdraftPlus does not expect a protocol in an endpoint URL; it took me a lot of time to figure this out.
After stripping the protocol and the bucketname from the endpoint, it would look like this:
Notice that this S3 endpoint contains your Cloudflare account ID and remains the same for all the buckets you create.
Step 3: Create S3 access key and secret key.
On the R2 overview page, you will find Manage R2 API Tokens link in the right-hand sidebar (just below your account ID).
There you will find all API tokens specific to R2. Click on Create API token button to create a new one.
On the token creation screen, you need to change just one setting; Set the permissions option from Read to Edit.
You can optionally change your token name to a more descriptive one if you plan to create several tokens for different purposes.
In the next screen, you will see options to save your Access Key ID and Secret Access Key. Click to copy and save in your text editor.
NOTE: This Access Key ID is your S3 access key, and Secret Access Key is your S3 secret key.
Click on finish and close cloudflare dashboard.
Step 4: Finish the updraftPlus settings and test.
Now you have everything you need to enter in updraftplus S3-compatible storage settings except S3 location.
In S3 location type your bucketname followed by any directory structure you like. Save in your text editor.
An excellent example for S3 location would be:
The rule for directory names is that they need to be in lowercase and may contain numbers. No special characters except hyphens (-) are allowed.
Remember, this directory does not need to already exist; updraftPlus will create it for you.
Now, bring all the above settings from the text editor to the updraftPlus settings page. It should look something like this:
Click on Test S3-Compatible (Generic) Settings button. You will get a success message popup which should read something like this.
S3-Compatible (Generic) settings test result: Success: We accessed the bucket, and were able to create files within it. The communication with xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.r2.cloudflarestorage.com was encrypted.
Do not forget to click on the save changes button at the bottom of the settings page after testing the connection.
That is all. You can take a backup now, and it will be stored in your Cloudflare R2 account in the desired directory for you to find and restore when needed.
Frequently Asked Questions:
Is Cloudflare R2 an S3 compatible object storage?
Yes. Cloudflare R2 is S3 compatible and can be supported as an S3 compatible storage anywhere.
Is Cloudflare R2 free?
Cloudflare R2 is free up to 10 GB of storage and 1 Million class A requests. Thereafter it charges about two-thirds per GB compared to Amazon S3. But you need a valid Credit Card to activate this service.
How Much Cloudflare R2 Cost To Backup Single WordPress Website
If your wordpress backup size is less than 1GB you can keep 10 copies of daily/weekly backups in R2 and still never be charged anything. Above 10 GB of usage you will be charged $0.015 / GB-month.