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

CookieMonster's avatar

heroku - uploaded images dissapear.

I want the ability to allow users to upload their avatar. While it works, I also noticed it will disappear after some time due to the file system by heroku:

The Heroku filesystem is ephemeral - that means that any changes to the filesystem whilst the dyno is running only last until that dyno is shut down or restarted. Each dyno boots with a clean copy of the filesystem from the most recent deploy. This is similar to how many container based systems, such as Docker, operate.

It recommends me to use AWS S3 storage but I know it's not free. Are there any alternatives that I can get by?

0 likes
9 replies
Tray2's avatar

You can use a tool like gravatar.

martinbean's avatar

@nickywan123 Heroku’s filesystem is temporary. Anything uploaded will be forgotten as your app is served by “dynos” and not a single web server. So an image uploaded to one dyno will be lost when Heroku switches to another dyno to serve your app.

You’ll need to use something like S3 to persist files. There’s no way around it.

CookieMonster's avatar

And AWS S3 is a paid service right?

My app is not really a business enterprise so if possible I'll try to look for free services.

martinbean's avatar

@nickywan123 Why do you think someone is going to let you upload and store files for free…?

S3 has a free tier. But you’ve given no indication as to what you’re wanting to store, so it may be free, it may be pennies, it may be thousands of dollars.

CookieMonster's avatar

I've store files like avatar(user upload them), posts that includes images/videos, etc.

martinbean's avatar

Right. So you’ve got to store them somewhere? If you used a shared host, you’d be paying them for disk space. If you had a VPS, you’d pay for disk space on that. If you use S3, you pay for what you store there.

CookieMonster's avatar

how's the configuration with google drive filesystem? what's the limitation?

Please or to participate in this conversation.