Announcing One-Click Restores, Disaster Recovery, and More
Announcing One-Click Restores, Disaster Recovery, and More
Do you want to save your WordPress backups to DigitalOcean Spaces?
DigitalOcean Spaces is an object storage service designed to accommodate a wide range of data types, from images and videos to full website backups. What sets it apart is its affordability and scalability, making it the ideal choice for securing your site’s data in the cloud.
In this tutorial, we’ll show you how to create a DigitalOcean Spaces backup for WordPress!
DigitalOcean Spaces is an object storage service that is capable of storing large amounts of data. It can hold a wide range of data, including images, videos, user-generated content, site backups, databases, logs, and much more.
DigitalOcean Spaces offers an affordable and scalable storage solution. It allows WordPress website owners to store static content, ensuring their media files are readily accessible to users without worrying about disk space constraints. This scalability is vital for growing websites with expanding content libraries.
You can also use DigitalOcean Spaces as a cloud backup storage service. Rather than storing backups on your local server, you can save them in the cloud.
This makes your backups easy to recover whenever you need them. You won’t have to worry about server errors or hacks corrupting your data.
Here are some of the main features of DigitalOcean Spaces:
To start using DigitalOcean Spaces, it costs $5 per month. This supports 240 GB of storage and 1 TB of outbound transfers. Additional storage will be $.02 per GB.
When you first sign up, DigitalOcean Spaces will give you a $200 credit. This will be valid for 60 days if you want to try out this cloud storage service before buying it.
You might be used to basic file-upload cloud services like Dropbox and Google Drive. If you want to start saving WordPress backups to DigitalOcean Spaces, the setup process is a little more difficult. However, we’ll walk you through every step along the way!
One of the easiest ways to connect your website to DigitalOcean Spaces is to find an S3-compatible WordPress backup plugin. For example, Duplicator Pro is a backup tool that supports a variety of cloud storage services.
With Duplicator, you can back up your site to any of these cloud locations:
If you want this flexibility, purchase a Duplicator Pro subscription. Although there is a free version, the premium plugin adds cloud storage support.
Then, download Duplicator and install it in WordPress. For help, see this tutorial on how to install WordPress plugins.
In your WordPress dashboard, go to Duplicator Pro » Settings » Licensing:
Paste the license key you received with your purchase. Hit Activate to start using Duplicator!
Since DigitalOcean Spaces is an object storage service, it allows you to store data as objects in buckets. These buckets can hold an unlimited number of objects and you can create up to 100 different buckets.
To get started, you’ll need to configure a new DigitalOcean Spaces bucket for your site backups. In your DigitalOcean control panel, click on the Spaces tab and hit Create a Spaces Bucket:
Choose the data center region closest to you. Next, name the new bucket:
Click on Create a Spaces Bucket again. Be sure to remember your bucket name and region for later on in this tutorial.
Before you create your first cloud backup, Duplicator needs permission to make changes to your DigitalOcean Spaces bucket. To do this, you’ll need to generate API keys.
On the main Spaces page, find the API page link:
Then, click on Generate New Key:
Name the access key and hit Create Access Key:
You’ll then get a new access key and secret access key. Copy and save both of these:
Now you have everything you need to connect Duplicator and DigitalOcean Spaces!
When you create a backup with Duplicator, it’ll automatically be stored on your local server. To change this, you’ll need to add a new storage location. Head over to Duplicator Pro » Storage » Add New:
Name the storage location and choose Digital Ocean Spaces as the Type:
In the Authorization section, paste your access keys, endpoint, and bucket name.
Use this endpoint: https://region.digitaloceanspaces.com
Instead of “region”, enter the region you chose when you made the bucket.
The Region field will be automatically filled after you add the endpoint.
For the Max Packages value, you can decide how many backups to keep in DigitalOcean Spaces. Once you exceed this number, Duplicator will delete an old backup. This prevents you from overloading your storage space:
Save the new storage provider.
At this point, you’ll be able to save any backup to DigitalOcean Spaces. To get started, navigate to Duplicator Pro » Packages » Create New:
Give the backup a recognizable name. Then, choose DigitalOcean Spaces as the cloud storage location:
If you want to back up your entire site, make sure all the components are checked in the Archive box. However, you can easily optimize backups by excluding unnecessary files:
When you’re finished, hit Next. Duplicator will fully scan your website before backing it up:
If everything looks normal, click Build to start building the backup. Once your site is backed up, Duplicator will send a copy over to DigitalOcean Spaces.
By setting up automatic backups, you won’t ever have to worry about manually backing up your site. Duplicator will routinely create backups for you, which saves time, minimizes potential downtime, and safeguards your data.
First, open the Schedules page and add a new one:
Name the automatic backup schedule. Choose a backup template or create a new one:
Under Storage, choose DigitalOcean Spaces:
Then, you can customize when your backup will run:
As a final step, save the schedule and enable it. Without any extra help from you, Duplicator will automatically back up your site to DigitalOcean Spaces!
If your site ever gets hacked or displays a critical error, you can find a recent backup stored in DigitalOcean Spaces. Once you open your bucket, you’ll see two files: the archive and the installer.php files:
Download the archive zip file. Then, go back to your WordPress dashboard and head to Duplicator Pro » Import:
Upload the backup archive that you just downloaded. This allows you to quickly restore your site!
Note: If an error locks you out of the WordPress dashboard, don’t worry! You can still restore a backup. You’ll need to download both the archive and installer files and upload them to your site with an FTP client. For more details, check out this classic install guide.
You can only create up to 100 buckets in DigitalOcean Spaces. With the lowest payment option, you’ll get 240 GB of storage. More storage costs $.02 per GB. Other options like Backblaze B2, Google Cloud, and Wasabi offer cheaper storage.
DigitalOcean Spaces Sync is a free plugin on WordPress.org that will connect your WordPress Media Library to a DigitalOcean Spaces bucket. It allows you to back up your media library to the cloud or serve images from your DigitalOcean account. If you serve them from DigitalOcean, the plugin will replace public media URLs with cloud storage links.
Note: This plugin was last updated 4 years ago, so it hasn’t been tested with the latest WordPress updates. We would recommend installing a highly-reviewed and tested plugin like Duplicator Pro to back up your WordPress data.
DigitalOcean Spaces costs $5 per month for the first 240GB of storage and 1TB of outbound transfers. If you need additional storage, you’ll be charged an extra $.02 per GB.
You can use DigitalOcean Spaces to host static assets from your WordPress site like images. First, make sure your server is set up on the latest version of Ubuntu. Then, you’ll need to modify the wp-content/uploads folder permissions using this WP-CLI command:
sudo mkdir -p /var/www/html/wp-content/uploads
Then, set new permissions for the folder. Instead of “sammy” use your non-root sudo user:
sudo chown -R sammy:www-data /var/www/html/wp-content/uploads
After this, give the web server access to write in this folder:
sudo chmod -R g+w /var/www/html/wp-content/uploads
Next, install and activate the DigitalOcean Spaces Sync plugin. Here’s how to navigate to your WordPress plugin folder:
cd /var/www/html/wp-content/plugins
Now, install the plugin:
wp plugin install do-spaces-sync
And activate it:
wp plugin activate do-spaces-sync
In the plugin settings, enter your Spaces access key IDs and bucket name.
By default, the endpoint will be https://ams3.digitaloceanspaces.com. You can modify this to feature your specific region.
In the File & Path Settings, enter either a public storage domain or a full URL path. This depends on whether you want the files stored only on DigitalOcean Spaces or stored on your server as well.
For more information, see the DigitalOcean docs on how to store WordPress assets on DigitalOcean Spaces.
We hope this guide helped you back up your WordPress site to DigitalOcean Spaces!
While you’re here, you may also like these tutorials on WordPress backups:
Do you want to easily send your backups to cloud services like DigitalOcean Spaces? Download Duplicator Pro for automatic cloud backups!