Host a static website on AWS with Amazon S3 and Route 53
Hosting a static website on AWS S3 is one of the easiest, most reliable and surprisingly affordable ways to host a static website online. Pair Amazon S3 with AWS Route 53 and you can quickly create new DNS records and host your website with a custom domain name.
AWS S3 plus Route 53 setup steps
To host your static website on AWS infrastructure and make it accessible through a custom domain name, simply follow the following steps:
- Create an S3 bucket with the same name as your registered website.
- Upload your files to the S3 bucket.
- Disable access blocking and add a policy that allows global read access.
- Enable static website hosting for the S3 bucket and test your site with the AWS assigned URL.
- Register a domain with Route 53.
- Create an alias record in AWS Route 53 that points to your website's S3 bucket.
- Wait for the DNS records to propagate and test your static website through your custom domain name.
Benefits of web hosting with AWS S3
AWS provides developers a treasure trove of services, from on-demand EC2 instances to server-managed container-managed services such as Fargate, but none of that is necessary to host a simple, static website made up of HTML, CSS and JavaScript.
To host a simple, static website on AWS, all you need is an S3 bucket configured for website hosting. It's the easiest way to make your website go live.
Cameron McKenzie has been a Java EE software engineer for 20 years. His current specialties include Agile development; DevOps; Spring; and container-based technologies such as Docker, Swarm and Kubernetes.