Appearance
Create a file backup of a DigitalOcean Spaces bucket
Mount a DigitalOcean Space as a local filesystem and back it up with SimpleBackups.
DigitalOcean Spaces is an S3-compatible object storage service. By mounting a Space on your server using s3fs-fuse, you can treat it as a regular directory and back it up as a file backup with SimpleBackups. This guide covers mounting, credential management, boot automation, and backup configuration.
Prerequisites
- Ubuntu VPS running Ubuntu or a compatible distribution
- DigitalOcean Space with its Access Key and Secret Key
- Root or sudo access on your server
- SimpleBackups account — sign up if you do not have one
Install s3fs-fuse
s3fs-fuse lets you mount S3-compatible storage as a local filesystem.
bash
sudo apt updatebash
sudo apt install s3fsStore your credentials
Create a directory for secrets and save your DigitalOcean Spaces credentials:
bash
mkdir ~/.secretsbash
echo "ACCESS_KEY_ID:SECRET_ACCESS_KEY" > ~/.secrets/dospace-credentialsReplace ACCESS_KEY_ID and SECRET_ACCESS_KEY with your actual credentials. Then restrict the file permissions:
bash
chmod 600 ~/.secrets/dospace-credentialsMount the Space
Create a mount point and mount your Space:
bash
sudo mkdir /mnt/dospacebash
s3fs YOUR_SPACE_NAME /mnt/dospace -o passwd_file=~/.secrets/dospace-credentials -o url=https://YOUR_REGION.digitaloceanspaces.com -o use_path_request_styleReplace YOUR_SPACE_NAME with the name of your Space and YOUR_REGION with the region code (for example, nyc3).
Verify the mount by checking the filesystem and listing the contents:
bash
df -hbash
ls /mnt/dospaceYou should see the contents of your DigitalOcean Space.
Automate mounting at boot
To ensure the Space mounts automatically after a reboot, add an entry to /etc/fstab:
bash
sudo nano /etc/fstabAdd the following line:
bash
s3fs#YOUR_SPACE_NAME /mnt/dospace fuse _netdev,passwd_file=/home/your_username/.secrets/dospace-credentials,url=https://YOUR_REGION.digitaloceanspaces.com,use_path_request_style 0 0Replace your_username with your actual username. Test the configuration:
bash
sudo mount -aCheck for any errors and verify the mount as described above.
Set up the backup in SimpleBackups
With your Space mounted as a local directory, you can configure a file backup in SimpleBackups:
- Log in to your SimpleBackups dashboard
- Navigate to Servers and click Connect Server. Use the Automatic (SSH Key) method and follow the instructions to connect your VPS
- Click Create Backup and select File Backup
- Select the server you connected and enter the directories you want to back up (for example,
/mnt/dospaceor specific subdirectories within it) - Choose your storage destination — you can use SimpleStorage or any connected storage provider
- Set your schedule and retention policy
- Review your settings and click Save to enable the backup