How to Serve a Static Website With a Custom Domain on S3 Using SSL

Amazon S3 is a great way to host a static website, but it doesn't support SSL with custom domains and someone may be squatting on the bucket name you need to host your website.

In order to use SSL with a custom domain on S3 you need to also use Cloudfront. Here are the high-level steps necessary to make it all work:

  1. Create a Route 53 Hosted Zone with the domain you wish to use
  2. Create an S3 bucket (the name of the bucket is not significant since it gets hidden behind Cloudfront)
  3. Create an SSL certificate using Amazon Certificate Manager
  4. Create a Cloudfront distribution and configure the S3 bucket you just created and the ACM certificate

But there are a ton of little details that are required to make all of that work. You need to create an Origin Access Identity to securely wire Cloudfront up to S3. You need to update the DNS record with the correct name servers. The list goes on.

Oh, and you want to do all of this from within your own code? That's really hard.

If you're doing all of this to just host a static website, use Perspect. We've automated it all.

Try it out now.

Start building your website now