Skip to content

Digital Ocean Spaces

This guide walks you through connecting Sunshine Cloud Storage to DigitalOcean Spaces.

What You Need

  • A DigitalOcean account
  • A Spaces bucket
  • A Spaces access key

Step 1: Create a Space

In the DigitalOcean dashboard, go to Spaces Object Storage and create a new Space. Choose a datacenter region (such as NYC3, SFO3, AMS3, SGP1, FRA1, SYD1, or BLR1). Give it a name — this will be your bucket name.

For permissions, the default settings work fine. Sunshine handles public/private access at the object level.

For full details, see DigitalOcean's documentation on creating Spaces.

Step 2: Create Access Keys

Go to API in the DigitalOcean dashboard, then scroll to Spaces Keys. Click Generate New Key and give it a name. Save the Access Key and Secret Key — the secret key is only shown once.

For full details, see DigitalOcean's documentation on Spaces access keys.

Step 3: Connect in Sunshine

  1. Go to Sunshine Photo Cart > Settings > Cloud Storage.
  2. Select DigitalOcean Spaces as the provider.
  3. Choose your connection method:
  4. Database — Enter your Access Key and Secret Key directly in the settings.
  5. wp-config.php (recommended) — Add the provided code snippet to your wp-config.php file.
  6. Select the Region that matches your Space's datacenter.
  7. Enter your Space name, or click Load Buckets to select one.
  8. Click Test Connection to verify everything works.

wp-config.php Example

define( 'SUNSHINE_CLOUD_STORAGE_SETTINGS', serialize( array(
    'provider'          => 'digitalocean',
    'access-key-id'     => 'YOUR_SPACES_ACCESS_KEY',
    'secret-access-key' => 'YOUR_SPACES_SECRET_KEY',
    'bucket'            => 'my-space-name',
    'region'            => 'nyc3',
) ) );

Learn how to add this custom code to your WordPress website

Set the region value to match your Space's datacenter: nyc3, sfo3, ams3, sgp1, fra1, syd1, or blr1.

Using a CDN (Optional)

DigitalOcean Spaces includes a built-in CDN option. You can enable it from your Space's settings in the DigitalOcean dashboard. Once enabled, enter the CDN endpoint URL in the Custom Domain field in Sunshine's Cloud Storage settings.

CORS Configuration

If images aren't loading in the WordPress admin but work fine on the frontend of your site, your Space likely needs CORS (Cross-Origin Resource Sharing) headers. This allows the browser to load images from DigitalOcean Spaces when you're managing galleries in WordPress.

In the DigitalOcean dashboard, go to your Space > Settings > CORS Configurations and click Add. Set:

  • Origin: *
  • Allowed Methods: GET, HEAD
  • Allowed Headers: *
  • Access Control Max Age: 86400

Using * for the origin is safe here since these are publicly accessible images.

Troubleshooting

Bucket not found

Make sure the Space name matches exactly (case-sensitive). Also verify your access keys were created as Spaces Keys (not regular API tokens).

ACL warnings

DigitalOcean Spaces supports ACLs by default. If you see an ACL warning, verify you're using Spaces access keys (not a personal access token) and that your Space's permissions haven't been restricted.

Still need help?

If you have not yet found your answer in the documentation articles, please contact support

Sunshine Photo Cart for WordPress