How To Setup Cloudflare R2 For WordPress Backups Using UpdraftPlus (Free)

The chepeast remote storage option for WordPress backups.

Cloudflare R2 as a Backup destination in UpdraftPlus backup plugin

Cloudflare R2 is the best remote backup storage option with a generous free tier of 10GB.

And UpdraftPlus is the best WordPress backup plugin (even without the premium add-ons). It is reliable, secure, well-supported, and hence highly rated.

I personally use the UpdraftPlus free version and have never regretted it. The major criticism of the free plan is its limited support for popular remote storage options.

Cloudflare R2 is missing from both UpdratPlus free and premium plans.

But since R2 is an S3-compatible storage, UpdraftPlus does support Cloudflare R2 indirectly.

Does UpdraftPlus WordPress Backups plugin support Cloudflare R2?

Cloudflare R2 storage 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 popular cloud storage service offered by Amazon Web Services.

While Amazon Web Services (AWS), being targetted at 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 that 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, go to Settings > updraftPlus backups in the WordPress dashboard and click the settings tab.

Then in the “Choose your remote storage” field, select the S3-Compatible (Generic) option.

All storage options in the updraftplus backup settings.

Like R2, any S3 compatible storage solution would have these values.

S3 access key:

S3 secret key:

S3 location: s3generic://

S3 end-point:

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 backup schedule. 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 must attach a Credit Card for billing. R2 storage is free up to 10 GB and affordable after that (see their pricing page). But you need to have a valid credit card to take their service.

R2 create bucket option in cloudflare dashboard.

Click on Create Bucket. You only need to enter a bucket name. The 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 the S3 endpoint below your newly created bucket

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 it in your text editor.

Important:

Remove the https:// protocol and the /bucketname from the end-point URL before saving it into updraftPlus settings.
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:

<account_id>.r2.cloudflarestorage.com

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.

Create R2 token with Edit permission

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.

Important

As at the time of writing this, all R2 tokens are account level with no option to restrict tokens to specific buckets or folders. So any of your tokens can be used to access any of your buckets. So be careful.
Save Your Access Key ID and Secret Access Key

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 the 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 of S3 location would be:

bucketname/updraftplus-backups/websitename

The rule for directory names is that they must 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.

Important Tip

I insist you use different directories for separate WordPress websites you want backups for using updraftPlus. It comes in handy when you want to restore a backup.

Now, bring all the above settings from the text editor to the updraftPlus settings page. It should look something like this:

Final Step is to put all settings in updraftplus

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 used 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.

Is there any good Cloudflare R2 WordPress plugin?

I found no free WordPress plugin 100% dedicated to only Cloudflare R2, but since Cloudflare R2 is an S3-compatible storage, you can use any good WordPress backup plugin that supports S3.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top