A Simple Way to Host Your Static Site on AWS
Created on September 30, 2025
Hosting a static site on AWS is a solid choice if you want something that is fast, cheap, and can handle a lot of traffic. You basically use a few different services like S3 and CloudFront to get your site running on a global network without having to manage any actual servers.
This guide covers the main pieces you need and how to put them together for a professional setup.
The Main Pieces
There are four services you will mostly be working with:
- Amazon S3: This is where you actually store your files like HTML, CSS, and images.
- Amazon CloudFront: This is a CDN that caches your files around the world so they load quickly for everyone.
- AWS Certificate Manager (ACM): This gives you the SSL certificates you need for HTTPS.
- Amazon Route 53: This handles your DNS so your domain points to the right place.
How to Set It Up
1. Set up your S3 bucket
First, create a bucket in S3. It is usually best to name it after your domain. You should keep the public access blocked. Even though it is a website, we want people to go through CloudFront instead of accessing the bucket directly. This keeps things more secure.
2. Get your SSL certificate
You need to go to ACM to get a certificate. One important tip is that you have to do this in the us-east-1 region (North Virginia). CloudFront only looks for certificates in that specific region, even if you are located somewhere else. You can just use DNS validation to prove you own the domain.
3. Create your CloudFront distribution
This is the part that actually puts your site on the web. When you set up the distribution, point it at your S3 bucket. You should use something called Origin Access Control (OAC). This tells S3 that it is okay to show files to CloudFront but not to anyone else. Also, make sure to set it to redirect HTTP to HTTPS and attach your certificate.
4. Update your DNS in Route 53
The last step is to tell your domain where to go. In Route 53, you create an Alias record that points your domain name directly to your CloudFront distribution.
Why Bother With This?
It might seem a bit more complicated than using a simpler host, but there are some big benefits:
- Scalability: It handles a massive amount of users without you having to do anything.
- Speed: Your site will load fast because it is served from locations close to your users.
- Cost: You only pay for the data people actually use. For small sites, this is often just a few cents a month.
- Security: Using OAC and HTTPS keeps everything locked down and safe.
Wrapping Up
While services like Netlify or Vercel are great for quick projects, setting things up on AWS gives you more control and is a great way to learn how cloud infrastructure works. It is a very reliable way to host a site once you get the hang of the initial setup.
No resources added for this note.