# S3 and Cloudfront - Setup Not Working

**URL:** https://meta.discourse.org/t/s3-and-cloudfront-setup-not-working/284332
**Category:** Self-hosting
**Tags:** s3
**Created:** [November 3, 2023, 1:48pm UTC](https://meta.discourse.org/t/s3-and-cloudfront-setup-not-working/284332 "2023-11-03T13:48:33Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [November 3, 2023, 2:30pm UTC](https://meta.discourse.org/t/s3-and-cloudfront-setup-not-working/284332/6 "2023-11-03T14:30:17Z")

</div>

> [@Set up file and image uploads to S3](https://meta.discourse.org/t/set-up-file-and-image-uploads-to-s3/7229/1):
>
> ## Discourse configuration
> 
> Now that you’ve properly set up S3, the final step is to configure your Discourse forum. These instructions should work, but **the preferred method is to use environment variables and a CDN** as described in [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916).

~~I believe you can get an overview of what environment variables you need here:  
 [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916)~~

EDIT: In the context of a rake command, see the answer below 👇

---

_[View the full topic](https://meta.discourse.org/t/s3-and-cloudfront-setup-not-working/284332)._
