Skip to content

DigitalOcean Spaces Storage

Robin Rodricks edited this page Jul 6, 2026 · 3 revisions

In order to use DigitalOcean Spaces storage you need to reference NuGet package first. The provider wraps around the standard AWS SDK which is updated regularly, but adds a lot of untrivial workarounds that makes your life painless.

Connect to DigitalOcean Spaces

You can use the DigitalOceanSpaces method to connect to DigitalOcean Spaces storage (S3 compatible).

For digitalOceanRegion, you need to enter the DigitalOcean Region endpoint, like nyc3. This is internally combined into the following string which is used as the Service URL: "https://{digitalOceanRegion}.digitaloceanspaces.com".

IBlobStorage storage = StorageFactory.Blobs.DigitalOceanSpaces(
    accessKeyId, secretAccessKey, bucketName, digitalOceanRegion);

Connection Strings

To create with a connection string, first reference the module:

StorageFactory.Modules.UseAwsStorage();

Then construct using the following format:

IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("do.spaces://keyId=...;key=...;bucket=...;region=...;sessionToken=...");

where:

  • keyId is (optional) access key ID.
  • key is (optional) secret access key.
  • bucket is bucket name.
  • region is the Digital Ocean region code.
  • sessionToken is the optional token for temporary AWS credentials.

AWS CLI Profile Support

If you already have credentials in the local credentials file generated by AWS CLI, you can also use them to connect to a bucket with FluentStorage. Look here for more details.

Native Operations

Native operations are exposed via IAwsS3BlobStorageNativeOperations interface.

Clone this wiki locally