Hosting a static website on AWS: a guide for SMBs
How to host a high-performance, cost-effective website on AWS with S3 and CloudFront for under 5 euros per month.
Updated on 20 June 2023
A high-performance, cost-effective architecture for your website
AWS lets you host a static website with enterprise-grade performance and reliability for under 5 euros per month. The architecture relies on two services: Amazon S3 for file storage and Amazon CloudFront for global content distribution. This combination delivers sub-second loading times, a free SSL certificate and 99.99% availability.
The S3 + CloudFront architecture
Amazon S3 (Simple Storage Service) stores your website files: HTML pages, CSS stylesheets, JavaScript scripts and images. S3 is designed for 99.999999999% (eleven nines) durability, meaning your files will never be lost.
Amazon CloudFront is a content delivery network (CDN) that replicates your files across over 400 edge locations worldwide. When a visitor accesses your site, CloudFront serves files from the geographically closest server. A visitor in Mulhouse receives files from Frankfurt or Paris, not from a server in the United States.
The SSL certificate is provided free by AWS Certificate Manager. Your site is accessible via HTTPS at no additional cost, which is a prerequisite for Google ranking and visitor trust.
Why choose a static site
A static site consists of pre-generated HTML files, unlike a dynamic site that generates each page on the fly from a database. Static site generators like Hugo, Gatsby or Next.js produce fast, secure and easy-to-host websites.
Security is a major advantage. A static site has no database to hack, no CMS to update and no vulnerable plugins. The attack surface is reduced to a minimum. This is why many businesses are migrating their corporate websites to static architectures.
Performance is the other decisive advantage. Without a database or server-side processing, each page loads in a few dozen milliseconds. Combined with CloudFront, your site achieves Lighthouse performance scores of 100/100.
Detailed cost breakdown
The AWS pricing model is based on actual consumption. For a business website with 10,000 visitors per month, the monthly cost breaks down as follows: S3 storage costs a few cents for a few megabytes of files. CloudFront requests cost about 1 euro for 10,000 visitors. Outbound data transfer costs about 1 euro for 10 GB.
In total, a standard business website costs between 1 and 3 euros per month. Even a site with 100,000 monthly visitors stays under 10 euros. This price includes high availability, a global CDN and an SSL certificate.
Setting it up
The initial configuration includes creating an S3 bucket, configuring CloudFront with Origin Access Control to secure bucket access, requesting an SSL certificate and configuring DNS. The entire process can be automated with AWS CloudFormation or CDK for reproducible deployments.
Content deployment is done by syncing files to S3 followed by a CloudFront cache invalidation. This process can be integrated into a CI/CD pipeline with GitHub Actions for automatic deployment on every site change.
This site (lcmh.fr) uses exactly this S3 + CloudFront architecture. If you are considering this approach for your business, LCMH offers AWS consulting tailored to SMBs in Alsace, from design to production.
You can also read our article on optimizing AWS costs to keep your cloud budget under control.
Sources
- AWS, Hosting a Static Website on Amazon S3. docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html
- AWS, Amazon CloudFront Pricing. aws.amazon.com/cloudfront/pricing
- AWS, Using HTTPS with CloudFront. docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html
Frequently asked questions
- How much does it cost to host a static site on AWS?
- A business website with a few thousand visitors per month costs between 1 and 5 euros per month on AWS. This includes S3 storage, CloudFront distribution and a free SSL certificate. It is significantly cheaper than traditional shared hosting.
- Do you need technical skills to host on AWS?
- The initial setup requires knowledge of AWS configuration (S3, CloudFront, Route 53). Once configured, the site requires no maintenance. A specialized provider can handle the initial setup as a turnkey service.
- What is the difference compared to traditional hosting?
- AWS hosting with CloudFront distributes your site across servers worldwide, ensuring fast loading times everywhere. There are no bandwidth limits, no risk of overload and availability is 99.99%.
Related Articles
AWS for startups: where to start
Practical guide for startups getting started on AWS: account setup, budget, essential services and pitfalls to avoid.
AWS Raised Prices 15%? No, It's More Complicated Than That
Unpacking the AWS EC2 Capacity Blocks pricing adjustment: why alarmist headlines miss the point about dynamic pricing in cloud computing.
AWS Lambda: 10 concrete use cases to automate your business
Discover 10 practical AWS Lambda use cases to automate your business processes without managing servers.
The Well-Architected Framework explained for business leaders
Understanding the 6 pillars of the AWS Well-Architected Framework to make informed decisions about your cloud infrastructure.
Amazon CloudWatch: monitor your AWS infrastructure effectively
Practical guide to configuring Amazon CloudWatch: metrics, alarms, dashboards and logs to keep control of your cloud infrastructure.
AWS Cost Anomaly Detection: automatically detect unusual spending
How AWS Cost Anomaly Detection monitors your cloud spending and alerts you to abnormal consumption before the bill explodes.