How to configure DADI CDN for Digital Ocean Spaces

Since the very beginning, DADI CDN has had built-in support for serving assets from Amazon S3 buckets. Released earlier this week, DADI CDN 3.0 ships with additional support for Digital Ocean Spaces.

Image

Spaces uses an S3-compatible API and, as such, the existing S3 configuration in CDN is almost all that’s needed to connect your CDN installation to your Digital Ocean Space - only one extra endpoint configuration property is required to tell CDN where to find your assets.

"images": {
  "s3": {
    "enabled": true,
    "accessKey": "your-access-key",
    "secretKey": "your-secret",
    "bucketName": "your-space-name",
    "region": "your-region",
    "endpoint": "your-digital-ocean-endpoint" // new endpoint configuration
  }
}

🔗Configuring CDN for Digital Ocean Spaces

🔗Creating a Space

If you don’t have a Space already, click the “Spaces” menu item in your Digital Ocean account to load the Spaces overview, then “Create a Space”. Give your Space a name, choose a region and click “Create a Space” to finish.

Image
Image
Image

When creating a Space you are given a URL for the Space that contains the Space name and the region you selected:

https://<name>.<region>.digitaloceanspaces.com

The endpoint for configuring CDN is the <region>.digitaloceanspaces.com portion of this URL, for example sgp1.digitaloceanspaces.com. Add this to the endpoint property in CDN’s S3 configuration block:

"images": {
  "s3": {
    "enabled": true,
    "accessKey": "your-access-key",
    "secretKey": "your-secret",
    "bucketName": "cdn-demo",
    "region": "sgp1",
    "endpoint": "sgp1.digitaloceanspaces.com"
  }
}

🔗Access Keys

Spaces access keys can be found under the “API” menu when logged into your Digital Ocean account. If you don’t have one already, generate a new key and use the key and secret in the S3 configuration block in your CDN configuration file:

"images": {
  "s3": {
    "enabled": true,
    "accessKey": "KJGWLK7S4DON3R5TNAKT",
    "secretKey": "your-secret",
    "bucketName": "cdn-demo",
    "region": "sgp1",
    "endpoint": "sgp1.digitaloceanspaces.com"
  }
}

Image
Image
Image

🔗Further reading

The above information (and a lot more besides) can be found in the latest CDN documentation at https://docs.dadi.cloud/cdn/3.2#amazon-s3-and-digital-ocean-spaces.

Related articles

More tutorials articles
Mail icon

Like what you are reading? Want to earn tokens by becoming a DADI Node? Save money on cloud computing services? Build amazing digital product with DADI Web Services? Register with DADI now.

To hear about our news, events and products or services register now. You can also indicate which services you are interested in, which we use for research and to inform the content that we send generally.

* You can unsubscribe at any time by emailing us at data@dadi.cloud or by clicking on the unsubscribe link which can be found in our emails to you. Read our Privacy Policy.