GatsbyJS: Hosting a Gatsby Site in AWS using S3 and Cloudfront

Hosting on Aws – GatsbyJS: Hosting a Gatsby Site in AWS using S3 and Cloudfront

GatsbyJS: Hosting a Gatsby Site in AWS using S3 and Cloudfront

Hosting on Aws

In this video, I go step by step through the process of setting up hosting for a website built with GatsbyJS on an AWS S3 bucket and a Cloudfront distribution. I use the Gatsby framework in this video to build my website, but the solution that I setup in this video can also be used for any statically generated website..

Subscribe for future videos►

GatsbyJS –

0:00 – Introduction
1:08 – Configuring the S3 bucket.
3:13 – Configuring the Cloudfront distribution.
4:30 – Preparing and uploading the files to the S3 bucket.

Gatsby Fundamentals Udemy Course:
Website –
Twitter –
LinkedIn –
Facebook –

#gatsbyjs #staticwebsitehosting #s3bucketwebsite

you search:

Hosting on Aws

GatsbyJS: Hosting a Gatsby Site in AWS using S3 and Cloudfront

16 thoughts on “Hosting on Aws – GatsbyJS: Hosting a Gatsby Site in AWS using S3 and Cloudfront

  1. since static sites don't need servers, isn't it easier to hose it on github/netlify? Are there any reason to use AWS? Also, don't you need to pay for hosting if you do it on AWS?

  2. Hello Phil, I have followed this amazing tutorial to upload a few gatsby sites on AWS. Recently, I got a message from AWS something about AWS migrating some of their services. Does this affect how you have deployed in the tutorial? The first paragraph from AWS is below:

    "This is a reminder that Amazon Simple Storage Service (S3) and Amazon CloudFront are both migrating their services’ certificates from DigiCert to Amazon Trust Services starting March 23, 2021. If you do not send HTTPS traffic directly to your S3 bucket, or only use custom domains like with your CloudFront distribution, then there is no impact and you can disregard this message. If you do send HTTPS traffic directly to your S3 bucket, or use CloudFront domains covered by *, please continue reading and review the FAQ below on which certificates are migrating."

  3. Hey great video, i'm having an issue where any route results in an access denied error. I tried setting the error pages to redirect back to index.html as was suggested by some tutorials, but no luck then an route like redirects back to the home page. Any ideas?

  4. Thanks for the great tutorial! It helped me a lot!

    As a viewer, I felt it would be easier to follow if you slow down just a little bit, and get a better audio setup.

  5. This has been the most efficient and concise tutorial on setting up Gatsby this way. I was able to pretty much follow along and set everything up in "real time".

    There have been changes to the layout of the cloudfront and S3 interfaces in the past 9 months – which are superficial except for the link for the s3 bucket is not viewable in the bucket creation page, but is viewable in the dashboard after selecting the bucket.

    Thank you for making this series!

  6. So good. I hope you keep making videos. I was worried about deploying to AWS, but this video made it simple. But also, I agree with the comment above, please zoom in a little more.

  7. When I try to upload the files into my bucket it doesnt upload folders only the files within my folders but I have like a hundred folders and can just click through each? Solution?

  8. Thanks for this awesome video, very helpful…
    I have one question, I don't have experience with aws, so my question is: How much bandwidth you can get for free per month when using s3 and cloudfront? and how does aws charge you? is it per bucket/bandwith/GB/etc… ?

  9. Your videos are incredibly helpful, hands down the best I've seen on the subject! I've just finished watching your entire catalogue and implemented nearly all suggestions into my own project. To anyone seeing this comment, do yourself a favor and subsribe to this channel!

    I've got a bunch of questions, but the first one (i guess most important in my situation) is:
    What would be the best practices if I wanted to set up a staging branch within this workflow, so that whenever I commit any new changes, the staging branch is updated, and I can test and view the changes on a separate web server (i.e. another S3 bucket pointing to or )? Ideally, this environment should be password protected to keep google out, so the content isn't indexed twice and the main page is punished. Then, when the staging environment is reviewed to satisfaction, a merge into the master branch would update the main site (

    Sorry if the question is a bit confused. I'm just a hobby developer, and I got a talent for screwing things up, hence the need for a staging environment before I push new changes to go live. 🙂

    Again, thanks for sharing your experience with us, its incredibly valuable. I wish you and your channel the best, and i'll be looking out for any new content.

Leave a Reply

Your email address will not be published. Required fields are marked *