Setup a custom domain on AWS using S3 static website hosting and Route 53

First, buy a domain name.

Once you have your domain, go to Route 53 in the AWS console and create a new Hosted Zone. Be aware that this costs $0.50/month.

Click into your record set. It’ll have an NS record. Click on that to find your name servers.

On your registrar (the company you bought the domain from), edit the name servers for the domain. Note that this whole process is easier if you use Amazon as your registrar. I used, and the screenshot below is from Hover.

Next, go to S3 in the AWS console and setup your S3 buckets. You’ll need two, one for the plain domain, and one for www.domain. Name them exactly as the domain reads. So if you own, your buckets will be and

(I’m going to assume we’ll redirect requests to, simply because that’s what I prefer, but there’s some debate about this, so feel free to swap this and redirect to www. if you want.)

Go to Properties on your root domain ( bucket. Set it up to have static hosting:

Next, go to Properties on your domain. Set it up to redirect to your root domain:

The final step is to create two DNS “A” records back in Route 53 in your Hosted Zone:

There are a couple of confusing things about this process which I’ll talk about below the screenshot:

That should be it. Now if you upload an index.html to your root bucket ( S3 bucket), and navigate to or in a browser, you should see your HTML show up.

NOTE: it can take a few hours for DNS propagation to finish. A helpful tool to see if it’s finished or in progress is:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store