Skip to main content

DigitalOcean Spaces Setup

This tutorial guides you through setting up DigitalOcean Spaces as a storage destination for your FireBackup backups. Spaces offers S3-compatible object storage with a simple pricing model and built-in CDN.

What You'll Learn

  • Create and configure a DigitalOcean Space
  • Generate API credentials with appropriate permissions
  • Configure CORS and lifecycle policies
  • Enable CDN for faster restores (optional)
  • Connect Spaces to FireBackup

Prerequisites

  • A DigitalOcean account
  • Access to FireBackup dashboard as an organization admin
  • doctl CLI installed (optional but helpful)

Time Required

Approximately 15-20 minutes


Step 1: Create a Space

Using DigitalOcean Console

  1. Log in to DigitalOcean

  2. Navigate to Spaces Object Storage in the left sidebar

  3. Click Create a Space

  4. Configure your Space:

    SettingRecommended Value
    Datacenter regionChoose closest to your users
    CDNEnable (optional, for faster restores)
    File ListingRestrict (private)
    Space nameyour-company-firebackup
  1. Click Create a Space

Available Regions

RegionLocationEndpoint
nyc3New Yorknyc3.digitaloceanspaces.com
sfo3San Franciscosfo3.digitaloceanspaces.com
ams3Amsterdamams3.digitaloceanspaces.com
sgp1Singaporesgp1.digitaloceanspaces.com
fra1Frankfurtfra1.digitaloceanspaces.com
syd1Sydneysyd1.digitaloceanspaces.com

Using doctl CLI

# Install doctl if not already installed
brew install doctl # macOS
# or
snap install doctl # Linux

# Authenticate
doctl auth init

# Create a Space (not directly supported, use API)
curl -X POST "https://api.digitalocean.com/v2/spaces" \
-H "Authorization: Bearer $DO_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "your-company-firebackup",
"region": "nyc3"
}'

Step 2: Generate Spaces Access Keys

Spaces uses separate API keys from your main DigitalOcean account.

Create Spaces Keys

  1. Navigate to API in the left sidebar

  2. Scroll to Spaces access keys

  3. Click Generate New Key

  4. Enter a name: firebackup-access

  5. Click Create Access Key

  6. Save both keys immediately!

    • Access Key: Displayed on screen
    • Secret Key: Only shown once!
caution

The Secret Key is only displayed once. Save it securely before leaving the page.

Key Format

Your keys will look like:

  • Access Key: DO00XXXXXXXXXXXXXX
  • Secret Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Step 3: Configure CORS (Optional)

If you need browser-based access for restore previews, configure CORS.

Using the Console

  1. Go to your Space → Settings

  2. Scroll to CORS Configurations

  3. Click Add

  4. Configure:

Origin: https://app.firebackup.io
Allowed Methods: GET, PUT
Allowed Headers: *
Max Age: 3600

Using s3cmd

First, install and configure s3cmd:

# Install s3cmd
pip install s3cmd

# Configure for DigitalOcean Spaces
s3cmd --configure

When prompted, enter:

SettingValue
Access KeyYour Spaces access key
Secret KeyYour Spaces secret key
Default RegionUS (doesn't matter for DO)
S3 Endpointnyc3.digitaloceanspaces.com
DNS-style bucket+hostname%(bucket)s.nyc3.digitaloceanspaces.com

Create a CORS configuration file cors.xml:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>https://app.firebackup.io</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
<MaxAgeSeconds>3600</MaxAgeSeconds>
</CORSRule>
</CORSConfiguration>

Apply CORS:

s3cmd setcors cors.xml s3://your-company-firebackup

Step 4: Configure Lifecycle Rules

Set up lifecycle rules to automatically delete old backups and control costs.

Using the Console

  1. Go to your Space → Settings

  2. Scroll to Lifecycle Rules

  3. Click Add Rule

  4. Configure the rule:

    SettingValue
    PrefixLeave empty for all objects
    ActionDelete after X days
    DaysBased on your retention policy

Example Rules:

PrefixDaysPurpose
daily/30Delete daily backups after 30 days
weekly/90Delete weekly backups after 90 days
monthly/365Delete monthly backups after 1 year

Using s3cmd

Create lifecycle configuration lifecycle.xml:

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>DeleteDailyBackups</ID>
<Prefix>daily/</Prefix>
<Status>Enabled</Status>
<Expiration>
<Days>30</Days>
</Expiration>
</Rule>
<Rule>
<ID>DeleteWeeklyBackups</ID>
<Prefix>weekly/</Prefix>
<Status>Enabled</Status>
<Expiration>
<Days>90</Days>
</Expiration>
</Rule>
<Rule>
<ID>CleanupIncomplete</ID>
<Prefix></Prefix>
<Status>Enabled</Status>
<AbortIncompleteMultipartUpload>
<DaysAfterInitiation>7</DaysAfterInitiation>
</AbortIncompleteMultipartUpload>
</Rule>
</LifecycleConfiguration>

Apply lifecycle rules:

s3cmd setlifecycle lifecycle.xml s3://your-company-firebackup

Step 5: Enable CDN (Optional)

Enable CDN for faster backup downloads during restores.

Using the Console

  1. Go to your Space

  2. Click Settings

  3. Under CDN, toggle Enable CDN

  4. Configure:

    • CDN Endpoint: Auto-generated (e.g., your-company-firebackup.nyc3.cdn.digitaloceanspaces.com)
    • TTL: 3600 seconds (1 hour)
    • Custom Domain: Optional (e.g., backups.yourcompany.com)

Custom Domain with SSL

  1. Add a CNAME record in your DNS:
backups.yourcompany.com → your-company-firebackup.nyc3.cdn.digitaloceanspaces.com
  1. DigitalOcean automatically provisions an SSL certificate via Let's Encrypt

Step 6: Connect to FireBackup

Using the Dashboard

  1. Log in to FireBackup

  2. Navigate to SettingsStorage

  3. Click Add Storage Destination

  4. Select DigitalOcean Spaces

  5. Enter configuration:

    FieldValue
    NameProduction Spaces
    Endpointnyc3.digitaloceanspaces.com
    Bucketyour-company-firebackup
    Access KeyDO00XXXXXXXXXXXXXX
    Secret KeyYour secret key
    Path Prefixbackups/ (optional)
  6. Click Test Connection

  7. Click Save

Using the API

curl -X POST https://api.firebackup.io/api/v1/storage \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Spaces",
"type": "spaces",
"config": {
"endpoint": "nyc3.digitaloceanspaces.com",
"bucket": "your-company-firebackup",
"accessKey": "DO00XXXXXXXXXXXXXX",
"secretKey": "your-secret-key",
"prefix": "backups/"
}
}'

Alternative: S3-Compatible Configuration

Since Spaces is S3-compatible, you can also use the S3 storage type:

curl -X POST https://api.firebackup.io/api/v1/storage \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Spaces (S3)",
"type": "s3",
"config": {
"bucket": "your-company-firebackup",
"region": "nyc3",
"endpoint": "https://nyc3.digitaloceanspaces.com",
"accessKeyId": "DO00XXXXXXXXXXXXXX",
"secretAccessKey": "your-secret-key",
"forcePathStyle": false,
"prefix": "backups/"
}
}'

Step 7: Verify the Setup

Run a Test Backup

  1. Go to Projects in FireBackup

  2. Select a project

  3. Click Run Backup Now

  4. Select your Spaces storage destination

  5. Monitor the backup progress

Verify in Spaces Console

  1. Go to your Space in DigitalOcean

  2. Navigate to the backups folder

  3. Verify the backup file exists

Using s3cmd

# List backups
s3cmd ls s3://your-company-firebackup/backups/ --recursive

# Check file details
s3cmd info s3://your-company-firebackup/backups/proj_abc123/2024-01-15/backup.enc

Expected output:

2024-01-15 10:30  1048576  s3://your-company-firebackup/backups/proj_abc123/2024-01-15/backup_full_1705312245.enc

Pricing Overview

DigitalOcean Spaces has simple, predictable pricing:

ResourcePrice
Storage$5/month for 250 GB
Outbound Transfer$5/month for 1 TB
Additional Storage$0.02/GB/month
Additional Transfer$0.01/GB

Cost Example:

UsageMonthly Cost
100 GB storage$5 (included)
200 GB storage$5 (included)
300 GB storage$6 ($5 base + $1)
500 GB transfer$5 (included)
tip

Spaces is significantly cheaper than AWS S3 for most backup workloads, especially for storage-heavy use cases.


Troubleshooting

"Access Denied" Error

Cause: Incorrect Spaces access keys

Solution:

  1. Verify you're using Spaces keys, not API tokens
  2. Check the keys haven't been revoked
  3. Regenerate keys if needed

"Bucket Not Found" Error

Cause: Wrong Space name or region endpoint

Solution:

# Verify the Space exists
s3cmd ls

# Check the endpoint matches the region
# nyc3 → nyc3.digitaloceanspaces.com
# sfo3 → sfo3.digitaloceanspaces.com

"SignatureDoesNotMatch" Error

Cause: Incorrect secret key or endpoint format

Solution:

  1. Double-check the secret key (no extra spaces)
  2. Ensure endpoint uses HTTPS
  3. Verify region in endpoint matches Space region

Slow Upload Speeds

Cause: Region mismatch or large files

Solution:

  1. Choose a region closer to your FireBackup deployment
  2. Enable multipart uploads (automatic for files > 5MB)
  3. Check network connectivity

Security Best Practices

Restrict File Listing

By default, new Spaces have file listing restricted. Verify this setting:

  1. Go to Space Settings
  2. Ensure File Listing is set to Restrict

Enable Encryption

Spaces encrypts all data at rest by default using AES-256. No additional configuration needed.

Access Key Rotation

Regularly rotate your Spaces access keys:

  1. Generate a new key pair
  2. Update FireBackup with new credentials
  3. Test that backups work
  4. Revoke the old key

IP Allowlisting (Enterprise)

For enterprise deployments, consider using a firewall to restrict access:

# Add firewall rule to Droplet/App running FireBackup
doctl compute firewall create \
--name firebackup-spaces \
--inbound-rules "protocol:tcp,ports:443,address:your-spaces-endpoint"

Comparison with Other Providers

FeatureDO SpacesAWS S3GCS
Pricing ModelFlat + overagePay per GBPay per GB
Free Tier250 GB + 1 TB5 GB (12 months)5 GB
Regions630+30+
Storage Classes164
Lifecycle RulesBasicAdvancedAdvanced
CDNBuilt-inCloudFront (extra)Cloud CDN (extra)

Next Steps