Docs

DigitalOcean Spaces

4 min readUpdated June 28, 2026

DigitalOcean Spaces is an S3-compatible object storage service with a built-in CDN edge network. It is a straightforward option for teams already using DigitalOcean for hosting. WP Media Cloud connects to Spaces using S3-compatible credentials.

Before you start#

You will need:

  • A DigitalOcean account.
  • A Spaces bucket in your chosen region.
  • A Spaces access key and secret key.

Step 1: Create a Space#

Log in to the DigitalOcean control panel and go to Spaces Object Storage. Click Create a Space. Select a datacenter region closest to your server or your main audience. Choose a unique name for your Space — names must be lowercase and between 3 and 63 characters.

Under File Listing, leave it set to Restrict File Listing. Individual file access will be controlled by the file’s own permissions, not the bucket listing. Under CDN, you can enable the Spaces CDN edge at this point or do it later. Click Create a Space.

DigitalOcean Spaces includes a built-in CDN edge network at no extra cost. To enable it, go to your Space and click the Settings tab. Under CDN, click Enable CDN. DigitalOcean will provision a CDN endpoint in the format [space-name].[region].cdn.digitaloceanspaces.com. You can also configure a custom subdomain here if you have a domain on DigitalOcean.

Copy the CDN endpoint URL — you will need it when configuring WP Media Cloud.

Step 3: Create access keys#

In the DigitalOcean control panel, go to API in the left sidebar and select the Spaces Keys tab. Click Generate New Key. Give the key a name and click Generate Key.

Copy and save the Access Key and Secret Key before closing the dialog — the secret key is only shown once.

Spaces access keys grant access to all Spaces within your account. There is no way to restrict a Spaces key to a single Space at the key level.

Step 4: Connect DigitalOcean Spaces in WP Media Cloud#

You have two options for connecting Spaces to WP Media Cloud. Use whichever suits your setup.

Option A: Setup wizard

Go to WP Media Cloud > Setup Wizard. The wizard walks you through provider selection, credential entry, and CDN configuration. This is the recommended option for most users.

Option B: wp-config.php constants

Add the following constants above the /* That's all, stop editing! */ line in wp-config.php:

define( 'WPMC_PROVIDER',        'do' );
define( 'WPMC_DO_REGION',       'nyc3' );
define( 'WPMC_DO_ACCESS_KEY',   'your-access-key' );
define( 'WPMC_DO_SECRET_KEY',   'your-secret-key' );
define( 'WPMC_DO_BUCKET',       'your-space-name' );
define( 'WPMC_DO_CDN_TYPE',     'custom' );
define( 'WPMC_DO_CDN_URL',      'https://your-cdn.com' );

Set WPMC_DO_REGION to the region code for your Space. DigitalOcean region codes are: nyc3 (New York), ams3 (Amsterdam), sgp1 (Singapore), fra1 (Frankfurt), sfo3 (San Francisco), syd1 (Sydney), and blr1 (Bangalore). The region code is shown in your Space’s endpoint URL in the format [space-name].[region].digitaloceanspaces.com.

Set WPMC_DO_CDN_URL to your Spaces CDN endpoint URL if you enabled CDN in step 2, or omit it if you are serving directly from the Space. Once the constants are in place, go to WP Media Cloud > Settings > Storage and confirm the plugin has loaded them. Constants override any values saved in the settings panel.

Step 5: Test the connection#

Click Test Connection. WP Media Cloud will upload a small test file to your Space and confirm it can be read back. A green success message confirms the connection is working.

Step 6: Configure CDN delivery#

If you enabled the Spaces CDN in step 2, go to WP Media Cloud > Settings > CDN, select Custom CDN URL, and enter your Spaces CDN endpoint URL. All media URLs will now point to the CDN edge rather than the origin Space endpoint.

If you set a custom subdomain on your Space CDN, use that URL instead of the default DigitalOcean CDN endpoint.

Troubleshooting#

Connection test returns Access Denied
The access key or secret key is incorrect. Spaces keys are shown only once at creation. If the secret key was lost, generate a new key pair in the DigitalOcean control panel under API > Spaces Keys.

Connection test returns endpoint error or NoSuchBucket
The region code or Space name is incorrect. The endpoint WP Media Cloud constructs follows the format [space-name].[region].digitaloceanspaces.com. Confirm both the Space name and region code match exactly what is shown in the DigitalOcean control panel.

Files upload but return 403 when accessed publicly
Individual files uploaded through WP Media Cloud need to be set as public. WP Media Cloud sets uploaded files to public by default. If files are returning 403, check that the file ACL is set to public-read in your Space. This can be confirmed by viewing the file in the DigitalOcean control panel.

CDN URL not rewriting
Confirm the CDN endpoint URL is entered correctly in WP Media Cloud > Settings > CDN and that the CDN is enabled on your Space. CDN propagation can take a few minutes after enabling.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only