Get the Best WordPress Backup
& Migration Plugin Today
Get Duplicator Now
Announcing one click restores, disaster recovery, and more

Announcing One-Click Restores, Disaster Recovery, and More

Want to be able to restore your site with just one click? In the newest version of Duplicator, we're launching…
Cloudflare R2 backup

How to Back Up WordPress to Cloudflare R2 

Are you not sure how to create a Cloudflare R2 backup?

Cloudflare R2 is a new cloud storage service that rivals more expensive options like Amazon S3. By sending your backups to Cloudflare R2, you’ll save your data to the cloud without overspending your budget. 

In this tutorial, we’ll show you how to back up your WordPress site to Cloudflare R2!

What Is Cloudflare R2 Storage?

Cloudflare R2 is an object storage service for storing large amounts of unstructured data like pictures, videos, data lakes, website backups, and more. Similar to other providers like Amazon S3, Wasabi, and Google Cloud, Cloudflare R2 organizes data as objects inside buckets. 

Cloudflare R2 cloud storage

With Cloudflare R2, you won’t have to worry about any egress bandwidth fees. This means that you can transfer data to and from cloud storage as much as you need to.

Here are some extra benefits of using Cloudflare R2 as your cloud storage service:

  • Scalable cloud storage
  • Globally distributed 
  • Integrates with Cloudflare Workers and Cloudflare CDN
  • S3-compatible object storage
  • 99.999999999% data durability
  • Automated migration service

Plus, Cloudflare R2 is much cheaper than other popular options. Its storage is free for the first 10GB and then costs $.015 per GB. This is more affordable than AWS storage, which starts at $.023 per GB.

How to Back Up WordPress to Cloudflare R2

Because Cloudflare R2 is so scalable and affordable, it is a great choice for website owners who need to store backups off-site. Let’s show you how to send your WordPress backups to this cloud storage service!

Step 1: Install Duplicator Pro

Duplicator Pro is a flexible WordPress backup plugin that supports a variety of S3-compatible storage services. With this tool, you’ll be able to instantly connect your website with Cloudflare R2, securing backups in the cloud.

Duplicator Pro plugin

Along with Cloudflare R2, here are all of the cloud storage providers you can use with Duplicator:

To get started, choose a subscription for Duplicator Pro. There is a free version of the plugin, but you’ll need to upgrade to start creating cloud backups.

Next, install and activate Duplicator in your WordPress dashboard. If you’re not sure how to do this, check out this helpful guide on installing WordPress plugins.

As a final step, head over to Duplicator Pro » Settings » Licensing:

Activate Duplicator Pro license key

Paste your license key and hit Activate. You’ve just unlocked Duplicator’s cloud storage features!

Step 2: Create a Cloudflare R2 Bucket

Once you set up Duplicator, it’s time to create a Cloudflare R2 account. The first 10GB of storage is free, so you can hit Get Started for Free.

Enter an email and password for the new account. Be sure to verify your email address.

In your Cloudflare dashboard, click on the R2 tab. Here, enter your payment information. You’ll only be charged if you exceed the monthly storage limits:

Cloudflare R2 payment

After this, click on Create Bucket:

Cloudflare R2 bucket

Name the new bucket. You can allow Cloudflare to automatically choose your bucket’s region or specify one yourself. Then, hit Create Bucket again:

Cloudflare R2 customize bucket

Now you’ll have a cloud storage bucket to store your website backups!

Step 3: Copy Your Access Keys

To allow Duplicator to save backups to your Cloudflare R2 storage account, you’ll need to generate access keys. On the Overview page in your dashboard, click on Manage R2 API Tokens:

Manage R2 API token

Then, hit Create API Token:

Create R2 API token

After naming the token, select the Object Read & Write permissions level:

Cloudflare R2 new token

Apply these permissions to all of your buckets, or the one you just created. You can also decide how long this token will stay active:

Cloudflare R2 token settings

Once you create the API token, you’ll get access keys. Copy these so you can use them in the next step:

Cloudflare R2 access keys

You’ll also need your S3 API endpoint. This will be in your bucket settings:

Cloudflare R2 S3 API

With all of this information, you can fully authorize Duplicator to send backups to Cloudflare R2 cloud storage!

Step 4: Connect Cloudflare R2 to Duplicator

At this point, open your WordPress dashboard and go to Duplicator Pro » Storage » Add New:

Add new storage location

Name the new storage location. Select Cloudflare R2 as the Type:

New Cloudflare R2 storage

Under Authorization, paste your access key, secret key, and endpoint. If you allowed Cloudflare to choose your region, enter auto. Finally, add your bucket name:

Duplicator Cloudflare authorization

You can adjust the Max Packages value if you want to avoid storing too many backups in your Cloudflare account. Duplicator will delete old packages, optimizing your storage space.

Duplicator cloud storage settings

To make sure the setup is correct, click Test Storage. If Duplicator can create and delete a small file on Cloudflare R2, you have a new cloud backup location!

Step 5: Create a Cloudflare R2 Backup

Now you can back up your website to the cloud! First, head over to Duplicator Pro » Packages » Create New:

Create Duplicator package

Give the backup a name or keep the automatically generated one. Under Storage, choose Cloudflare R2:

Cloudflare R2 backup

If you expand the Archive section, you can customize the backup. Select All Components if you want to save a full copy of your website. However, you can easily uncheck certain elements like inactive plugins, themes, or the media library:

Duplicator custom package components

Hit Next. Then, Duplicator will fully scan your site:

Duplicator package scan

If everything looks fine, click on the Build button. During the backup process, Duplicator will make a copy of your WordPress site and automatically send it to the cloud. 

Step 6: Set Up Automatic Cloudflare R2 Backups

To make sure your site is backed up as often as it should be, consider setting up automatic backups. This way, you’ll never forget to save your data. Plus, it takes one maintenance task off your hands.

With Duplicator, you can automate backups in just a few minutes. First, find Duplicator » Schedules » Add New:

Create website backup schedule

Give the schedule a descriptive name. You can choose the default package template or create a new one for custom backups:

New Cloudflare R2 backup schedule

Under Storage, select Cloudflare R2 as your cloud provider:

Auto Cloudflare R2 backup

Then, you can choose how often you want your site automatically backed up. Duplicator supports hourly, daily, weekly, and monthly auto backups.

Cloudflare scheduled backup

If you’d like to, select a custom start time. At the bottom of the page, enable the schedule and save it. 

How to Restore Your Cloudflare R2 Backup

You might panic after you experience an unexpected WordPress error, cyber attack, server downtime, or other critical issue. This is why it’s so important to have your backups stored in the cloud.

If you regularly send backups to Cloudflare storage, they’ll help you restore your website to its normal functionality. All you’ll need to do is open your bucket and find the folder where your backups are stored:

Open Cloudflare R2 bucket

Here, you’ll see your most recent backups:

Cloudflare R2 stored backups

Each backup will have two files: the archive and the installer. The archive contains a copy of your site files, database, and any other data you included in the backup. The installer, on the other hand, helps you unpack the backup in a new location.

If you can still access your WordPress dashboard, all you’ll need is the archive file. Click on the three-dot icon to the right and hit Download:

Download Cloudflare R2 backup

Then, go back to your website and find Duplicator Pro » Import. Upload the backup archive file:

Import website archive

After it uploads, you’ll see information about the backup:

Import Cloudflare backup

Hit Continue. On the next page, click on the Launch Installer button:

Launch site installer

Now, the Duplicator installer wizard will walk you through the restoration. Be sure to select Restore single site as the Install Type:

Restore cloud backup

On the other hand, some errors could lock you out of your dashboard entirely. In this case, use your favorite file manager to upload both the archive and installer files into your root directory:

Upload Cloudflare backup

Then, open a browser window and paste this URL: https://your-domain/installer.php

To launch the Duplicator installer, replace “installer.php” with the name of your installer file.  

FAQs About Cloudflare R2 Backups

Is Cloudflare R2 worth it?

Cloudflare R2 can be a worthwhile cloud storage service if you’re looking for a more affordable solution than Amazon S3. Cloudflare R2 offers the same data durability, scalability, and security, without any egress bandwidth fees. 

When it comes to pricing, Cloudflare R2 offers 10GB of storage space for free every month, while Amazon S3 only offers 5GB. Both have pay-as-you-go pricing, but Cloudflare R2 plans start at $.015 per GB per month and Amazon S3 increases this to $.023 per GB.

How do I upload files to Cloudflare R2?

You can easily upload backup files to Cloudflare R2 using Duplicator Pro, the best WordPress backup plugin. After adding your Cloudflare R2 bucket as a new storage location, create a new backup. If you choose Cloudflare R2 as the storage location, Duplicator will automatically back up your website to the cloud. 

What is the maximum size for Cloudflare R2?

The maximum upload size for Cloudflare R2 is 4.995GB. This applies whenever you’re uploading a file or uploading one part of a multi-part upload. You can increase this limit by contacting Cloudflare’s account team. 

Extra Ways to Optimize Your WordPress Backups

We hope this guide helped you create a Cloudflare R2 backup for your WordPress site!

Along with sending them to the cloud, here are some other ways to optimize your backups:

Do you want to protect your data from unexpected errors? Download Duplicator Pro to save your site backups in 11 different cloud storage locations!