Hosting on AWS Elastic Beanstalk and S3

The customer is using AWS Elastic Beanstalk as host.

Any workarounds to refer to the images stored in S3 instead of in the site folders?

The article I found about it was from '16 and link to solution didn’t work any longer.


I copy this quote from @bastianallgeier

We used a file upload hook that uploaded the original to S3 and afterwards replaced the file on disk with a 1px spacer. The S3 ID, original width and height were stored in the meta text file and the URL component would then use that ID from the text file to create the correct URL. This way, Kirby will still think it has normal files on disk, while they are actually tiny and don’t take up much space at all. But the originals are all in S3

Is there by any chance more information on how to achieve this?

Is the hook available somewhere?

The upload hook is one of the hooks available in Kirby, see the docs:

All hooks:
Upload hook:

Then there’s an API through which you can upload images to S3:

URL component:

@bnomei Are you working on something like this?

bastians idea was very clever so i was interested.
i did a quick prototype for reading files as virtual files from digitalocean spaces a few months ago but i did not pursue it much further and currently have no plan to do so.