Static Site Hosting

The blog

I have recently started again working on personal blog. Therefore I have created new minimalistic Hugo template which allowed me to get more insights about Hugo. The template target is to keep me focus on writing rather than deciding which color pallet is best or which new cool feature I can bake in.

Currently it only shows list of posts, list of tags and simple, still empty about me page. It didn’t take me long time to make it running. I keep the repo on GitHub and I’m planning to use GitHub Actions for CI/CD. The only thing which left is hosting.

Static site hosting

I have never hosted a personal site before, so I plan to do a little reasarch taking into account conditions:

  • HTTPS
  • Custom domain
  • Cheap or free
  • Possibility to deploy from Github

For the purpose of pricing the hosting, I assume:

  • 200 visit per day
  • 2 MB per post

Github Pages

GitHub Pages offer custom domain only for Public repositories for free accounts. Since my repository is private and I have no intent to pay for GitHub Pro, this option is not on a table. Otherwise it would be probably one of the best options.

AWS

AWS: S3, Cloudfront

Let’s explore S3 static site hosting.
The S3 does not support https. You can have https for static site hosted in S3 with help of Cloudfront. Unfortunately it will be another cost added, but the solution is fully serverless. No server maintainance is required.

The pricing estimaiton will be done for eu-central-1 region.

  • S3: 0.01$
  • Cloudfront: 1.4$
  • Route53: 0.5$
  • Total: 1.91$/month

AWS: Lightsail

Generally Lightsail is overkill for static site hosting, but it is also the quickest one to deploy. Therefore for some cases might be suitable. Lightsail comes in two flavours: Virtual Servers and Containers. The pricing is quite transparent. Amazon provide tiers and you pay fixed amount every month, no mater what exaclty is traffic or used resources as long as usage is within tier limit.
For static site the cheapest one would be enough, that is:

  • Virtual server (512MB, 1CPU, 20GB SSD, 1TB transfer): 3.5$/month
  • Object storage (5GB storage, 25GB trabsfer): 1$/month
  • TOTAL: 4.5$/month

AWS: EC2, EIP

Another way is to use EC2. The t4g.nano has 2vCPUs, 0.5 GiB memory. I’m only considering on-demand and spot pricing.

The on-demand is a bit too pricey, since even S3 is cheaper, but spot instance might be good fit for such workload as static site hosting. Additional configuration would be required such as running webserver, auto scaling group to spin up new instance, moving Elastic Internet IP in automatic fashion.

I’m guessing the configuration and maintaince might be too much, but it is still worth considering, given you need an actual virtual server.

  • EC2 t4g.nano on-demand: 3.5$/month
  • EC2 t4g.nano spot: 1.68$/month

Cloudflare Pages

Free plan of Cloudflare Pages is enough for my usecase:

  • 1 build at a time
  • 500 builds per month
  • 100 custom domains per project
  • Unlimited bandwith

The only limit which my be a bummer for colaborative project is 1 build at the time.

The integretion with Github is sueprb. It takes 5 mins to setup once you already have Github repo prepared. Adding custom domains is an easy task as well.

Netlify

Netlify free plan gives you:

  • 1 build at a time
  • 300 minutes per month for builds
  • free custom domain
  • 100 GB/month bandwith

Netlify has pretty good free plan, but already you can see it is a little bit worse than Cloudflare Pages. The limits still will not be an issue at first (probably will not be an issue ever for my webstite xD ), but probably I would hit a limit bandwith limit firstly in Netlfiy.

Integreation with GitHub is trivial as in most webhosting services.

Render

Render free plan:

  • 1 build at a time
  • 500 minutes per month for builds
  • free custom domain
  • 100 GB/month bandwith

Similar to Netlify - has more build munites per month, but still worse bandwith tha Cloudflare. Integration with Github supported.

Firebase

Firebase free plan:

  • 10 GB/month bandwith (egress)

I actually only check bandwith which is way worse than in other webhositng services and that is it.

Vercel

Vercel free plan:

  • 100 deployments per day
  • 6000 minutes per month for builds
  • 100 GB/month bandwith

Vercel limits looks better tha Reneder’s, Firebase’s and Netlify’s and even better than Cloudflare’s in some cases. Still only Cloudflare gives you unlimited bandwith.

Sum up

After briefly looking into opitions where to host static website, I’ll go with Cloudflare.

Did I do a thorough research? No
Am I making a mistake? Maybe
Do I want to waste more time when all webhosting services are good enough for years? No :)

The outcome I expected was reachded. Free or cheap webhosting with minium maintaince and limits that will not force me to pay more in longer future.