Set up image uploads to Google Cloud Storage

Do you want to use Google Storage for your image uploads? Here are the steps:

  • Set a default Google project if you don’t have one.

  • Get a developer key.

  • Create a bucket by going here. Enter a unique name and select a default storage class (I used multi-regional within the US).

Now we need to configure the Discourse instance. Go to settings, and add a filter for S3. Then make the changes below:

  • Check the “ enable s3 backups ” checkbox if you want to activate manual or automated backups

  • Enter the desired bucket name created above in “ s3 backup bucket ” if enable s3 backups is checked

  • Paste in both “ Access Key ID ” and “ Secret Access Key ” in their respective text fields (these were generated when the developer key was created)

  • In s3_endpoint , paste in the below endpoint:


That’s it! Try uploading an image - it should all work magically :slightly_smiling_face:

To ‘serve’ images directly from your domain, follow the steps below:

  • Make sure your bucket is accessible publicly. It needs to set up using object level permissions though

  • Set up a load balancer if you don’t already have one. For the backend, create a backend bucket, point it to the storage bucket created above, enable CDN, and connect it

  • For the URL map, create two rules. Hosts for both need to be *; paths need to be /original/* and /optimized/*; and the backend needs to point to the backend bucket - save the settings

  • In Discourse settings, change the s3 cdn url to your domain - make sure this ties in with how your load balancer rule has been set up

That’s it - the images should now come from

Issues to be worked:

  • Backups - Uploading backups to a storage bucket is causing issues - will have a look at some point

@akbarnoorani are you referring to storing images or backups? Images are okay but I run into issues with backups.

If you are storing backups, you should make your buckets private.


Hi, Google Cloud Storage is free?

Would this be a better option than storing photos on my DigitalOcean droplet?

A CDN is usually preferred for all but the smallest communities.