Breakdown of costs for a static website on AWS after 18 months in production
18 months ago I published a tutorial on hosting a static website on AWS using the Hugo static website generator implemented as a Lambda function with the content served from CloudFront and S3. This setup doesn’t use any servers and is infinitely scalable. It is best for small business websites, personal websites and blogs that require customization and have unpredictable traffic patterns.
I knew it’d be cheap but I wasn’t quite sure how much exactly. Now, the site has been in the wild for 18 months and I’d like to share the numbers, which look pretty good!
The site has been getting 500+ unique visitors and 850+ page views per month and it is fair to say that a small local business would have similar traffic numbers. My website has just one post but it’s image-heavy, so it’s about 4 Mb of data transfer per page view. The site is hosted in the us-west-2 region (Oregon).
Looking at the chart and tables below, you can see that my average monthly cost was 93 cents (excluding tax) with more than half or 51 cents spent on a Route 53 hosted zone. All other services cost 42 cents per month on average with CloudFront taking the lion share of the cost because it did most of the work serving the website to users. Lambda’s cost was 0 (yes, zero!) because, with my infrequent updates, I was able to benefit from the free tier. The first month shows a lot of S3 cost, which seems to be correlated with the initial spike in traffic and the content not being cached by CloudFront yet. In other words, it can be ignored as an aberration.
If you are a cost-conscious small business or an individual and enjoy tinkering with technology, a static website is an easy and cost-effective way to have online presence. Whether you are using Hugo, Jekyll or other static website generators, you can host any of those on AWS using Lambda + S3 + CloudFront saving the pain of running the site on your local machine. Here’s my tutorial for Hugo.