
What you host in S3 for a static site
Static sites are composed of files that can all be stored as S3 objects:
All these objects can be served via S3’s website endpoint once static website hosting is enabled.
Key constraints and access patterns
- S3 static hosting supports only static content (client-side HTML/CSS/JS). For server-side rendering or backend logic, use compute services such as Amazon EC2, AWS ECS, or AWS Lambda.
- To make a site publicly accessible directly via the S3 website endpoint, the objects must be publicly readable or you must place a CDN (for example, Amazon CloudFront) in front of the bucket and configure secure access.
To serve a website directly from S3 you must allow public reads (or put Amazon CloudFront in front of S3 and use an Origin Access Control (OAC) so the bucket objects can remain private). Be careful when changing public access settings—only expose the objects you intend to make public.
Pricing overview
S3 static website hosting uses standard S3 pricing components plus a small per-request fee for the website endpoint:
Website endpoint format
When static website hosting is enabled for a bucket, S3 provides an HTTP website URL in this format:index.html) or an error document if a resource is not found.
Custom domains and HTTPS
To use a custom domain (for example,example.com or www.example.com):
- Create an S3 bucket whose name exactly matches the domain you want to serve:
- Apex (naked) domain: bucket named
example.com - Subdomain: bucket named
www.example.com
- Apex (naked) domain: bucket named
- Configure DNS (for example with Amazon Route 53) to point your domain to the S3 website endpoint.
To serve a custom domain over HTTPS, put Amazon CloudFront in front of the S3 bucket, attach an AWS Certificate Manager (ACM) certificate for TLS, and (ideally) configure CloudFront to use the S3 REST API origin with an Origin Access Control (OAC) so the S3 objects do not need to be publicly readable.
When to use S3 static website hosting
- Use S3 static hosting for purely static websites, marketing pages, documentation, and single-page applications (SPAs).
- Use CloudFront in front of S3 when you need:
- HTTPS for custom domains
- Global caching for lower latency
- Private content delivery with restricted S3 access
Quick summary
- Amazon S3 can host static websites (HTML/CSS/JS/assets) and serves them over an HTTP website endpoint.
- It does not run server-side code—use compute services for dynamic backend logic.
- Costs include standard S3 storage and egress plus a small per-request fee for website endpoint requests.
- S3 provides a website URL when hosting is enabled. For custom domains the bucket name must match the domain exactly and use CloudFront + ACM if you need HTTPS and restricted bucket access.

Links and references
- AWS S3 pricing: https://aws.amazon.com/s3/pricing/
- Amazon CloudFront: https://aws.amazon.com/cloudfront/
- Origin Access Control (OAC) documentation: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html
- AWS Certificate Manager (ACM): https://aws.amazon.com/certificate-manager/
- Amazon Route 53: https://aws.amazon.com/route53/