Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

packy's avatar
Level 7

Custom File Driver - Digital Ocean Spaces

Is there any tutorials on making a custom file driver or a place to suggest a feature for Laravel? As many know, Digital Ocean just launch object storage called Spaces. For many of us that use Forge with Digital Ocean it would be really nice to use this service for files too. Right now I host with Digital Ocean but my files are on S3 bucket.

0 likes
3 replies
boptom's avatar
boptom
Best Answer
Level 7

Since Digital Ocean Spaces uses the same API as Amazon S3 you can just use the S3 settings, with one small change; you need to add an 'endpoint' key to the S3 settings.

In filesystem.php:

        's3' => [
            'driver' => 's3',
            'key' => env('AWS_KEY'),
            'secret' => env('AWS_SECRET'),
            'region' => env('AWS_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'endpoint' => 'https://'.env('AWS_REGION'),
        ],

In .env you need to have

AWS_REGION=nyc3.digitaloceanspaces.com
6 likes
stefancrowe's avatar

Updating the existing S3 config worked for me (I actually stumbled across this just by testing it out).

However, I'm having an issue getting the getTemporaryUrl() method to work.

It returns a "SignatureDoesNotMatch" - is anyone else experiencing this issue?

Edit: I should point out I can perform all other API methods (get, list, etc.)

Swaz's avatar

@stefancrowe I believe its because Amazon and most other services use v4 signing, while DigitalOcean Spaces uses v2 for some reason.

Please or to participate in this conversation.