Laravel: How to use Linode's Storage Object as an alternative to AWS S3 in PHP?

Linode's Object Storage is marked as being S3 compatible. Knowing this I thought that I can simply use Linode's credentials in my filesystems.php and use ->disk('s3') to upload and download files but apparently this is not the case.

I have installed all required S3 PHP packages as suggested in Laravel's docs.

My .env has:

AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
AWS_DEFAULT_REGION=DE
AWS_BUCKET=my-linode-storage-object.eu-central-1.linodeobjects.com

In logs I get exception to Could not resolve host. It tries to concatenate AWS endpoint with what I provided above so no-brainer that it doesn't work. Should I install completely different package to handle Linode's Storage Object connections?

I don't see much tutorials on the web on how to use Linode's Storage Object in Laravel apps. Any links or hints would be appreciated.

2 Replies

You need to provide the S3 driver with the authentication URL.

For DE, this is: eu-central-1.linodeobjects.com

So your .env should be (note a few changes):

AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=bar
AWS_DEFAULT_REGION=eu-central-1
AWS_BUCKET=my-linode-storage-object
AWS_ENDPOINT=eu-central-1.linodeobjects.com

Hi,

Is it mandatory to use the exact key names?

AWS_ACCESS_KEY_ID=foo

vs.

LINODE_ACCESS_KEY=foo

Trying to find out so I can use several different buckets with names for their keys that make sense.

Thank you,
Trevor

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct