Please explain how hosting photos within the forum works. Does that get crazy expensive?

AI-generated summary

Hosting Photos within the Forum: Costs and Optimization

AvidLearner expressed concern about the cost of hosting photos within their forum, hosted on Digital Ocean’s $10 plan. awesomerobot clarified that photos are stored within the droplet, but can be alternatively hosted with DigitalOcean Spaces or Amazon S3, which would reduce costs for more storage dramatically.

To optimize users’ photos, Discourse allows settings to restrict maximum allowed image size. awesomerobot provided a rough estimate of storage costs, suggesting that hosting 1,000 users’ photos on DigitalOcean Spaces’ 250GB for $5/mo could cover around 27 years of storage.

awesomerobot recommended setting up photo hosting on DigitalOcean Spaces or S3 before a public launch and noted that Discourse creates optimized images for displaying within posts, but does not optimize the original files uploaded. However, a script can be run manually to trim down the size of the original images stored on the server.

AvidLearner found awesomerobot’s responses helpful in relieving pre-launch worries about photo hosting costs and optimization.

I’m concerned about the cost to host photos. (I’ve set up my forum in a droplet with Digital Ocean’s $10 plan - the forum doesn’t have any users yet.) I assume photos are stored within my Digital Ocean droplet. So does that mean I need to have enough storage space with Digital Ocean to accommodate the amount of data these photos take up?

Hosting photos within the forum is important, but how do I guesstimate the cost over time as more photos get added each month? Are there settings to optimize users’ photos?

I would greatly appreciate if someone could provide a simple explanation about photo hosting and costs. Thank you

Correct, you can alternatively host photos with DigitalOcean Spaces (setup guide) or Amazon on their S3 service (setup guide), which would reduce costs for more storage dramatically.

You also have settings in Discourse to reduce maximum allowed image size, which will ensure you don’t have people uploading overly large images that will take up tons of storage space.

Some guesstimate math from a previous topic:

So extending that math into DigitalOcean Space’s 250GB for $5/mo… if you had 1,000 users uploading 3 images a year at 3MB each… you’d be covered for around 27 years.

Thank you! That’s extremely useful information.

I suspect the forum will be photo heavy, but, since I have zero users at this point, I don’t know yet. Would you recommend setting up the forum to host photos on DigitalOcean Spaces or S3 before a public launch of the forum?

Also, does Discourse optimize the photos? If so, is there documentation on settings for this feature? (I apologize for what are likely very basic and obvious questions - I’m a little slow on the uptake. :upside_down_face:) Thank you!

Yes, it would be easier to start that way rather than migrating down the road.

No, not the original files that are uploaded (which is why we recommend restricting maximum upload size in the settings). Discourse creates optimized images for displaying within posts (to cut down on loading time/bandwidth use), but a user can click on that image to view the full-size original.

If it’s absolutely necessary, we do have a script that could be run manually from the command line every now and then to trim down the size of the original images stored on the server

Thank you, @awesomerobot! Your response has been incredibly helpful and has relieved some of my pre-launch worries.