github twitter rss
Hosting a static website for free
Aug 30, 2017

Do you want a website? Does everyone keep recommending wordpress to you? Does that sound complicated and expensive to host? Has your website gone down from spikes in traffic and your cheap hosting got overloaded?

What if you could host your website for free? What if you could stop managing servers and forget about scaling? What if you could know your website performance would always be blazingly fast for your users?

When you use a static website, you can.

What is a static website?

A static website is a return to the earlier days of the internet. The content of such a website is represented as purely a set of files. You might have posts/cool-post/index.html or about.html. “But I don’t want a static website, my content changes”, you might say, but no need to worry. The static part refers to the website while it is running. When a visitor goes to a static website, the server barely has to do any work to serve the request. It simply looks up the file by name. This is in contrast to dynamic, which is how Wordpress and others operate, which requires significant computation on the server for each request. This can get really slow.

Why a static website?

The static nature simplifies many aspects of running the website, gives performance benefits to your users, and gives you plenty of options when looking for a host. Static websites work well for many different kinds of pages on the internet. Blogs, marketing websites for ebooks, pages for restaurants, and more can all run brilliantly as static websites.

Components of a static website

To get a static website set up, you’ll need at minimum a host and a domain name. You’ll probably want a CDN as well. Below, I’ll give a few options for each and then tell you which ones I chose for this blog.

Hosting

A host is the server that responds to requests from users. A good host will be fast, and have very high uptime. Hosting is typically the main expense with managing a dynamic website, with hosting costs through something like wordpress.com easily exceeding $100/yr, venturing into the $1,000s if you gain some sizeable traffic. In contrast, static websites can be hosted for free. I know I’d rather pay $0 than $1000, especially if the $0 option gives my users a better experience.

Amazon S3

Amazon’s Simple Storage Service (S3) is a service where you can upload files and can act as a web server for these files. Amazon bills on request count, but does offer a limited free tier for 1 year.

GitHub.io

GitHub.io integrates directly with GitHub.com repositories and can host static files from those repositories. This service is free.

Netlify

Netlify offers an integrated build server and static hosting system, with HTTPS enabled in a single click. It can connect to GitHub, Bitbucket, and GitLab repositories. The individual plan is free.

Your own computer

The web is just a bunch of computers. Your computer is one of them. There’s nothing stopping you from pointing your newly acquired domain name at your own computer. Just a few more hurdles than a managed provider. Setting this up would involved installing your own webserver like Apache or nginx to server your static files. You would also need to install a dynamic DNS provider like noip.com since residential IPs are prone to changing. If you already own a computer that’s on all the time, adding static website hosting is free.

Domain Name

Static websites let you host for free, but domain names are not hosting and are not usually free. If you want a domain ending in .com or .io, (like jakepusateri.com), that costs money. I use hover (referral link) to manage my domains, but Namecheap seems like a good option too. A .com domain name will cost ~$10-15/year.

But you came here for free, and I’ve got good news! Several TLDs are available for completely free. You can choose between .tk, .ml, .ga, .cf, and .gq. These domains are all the domains of countries that decided it was good press or wanted to encourage tech development in their country. This means that they let anyone register domain names with them for free. All these are available at www.freenom.com. You’ll find a lot of fear, uncertainty, and doubt about these domain names. Some people claim you’ll never rank on google with them, but I couldn’t find any hard evidence to support this, and google certainly has results for websites with these TLDs. If you like the look of one, go for it! I picked up pusateri.ml, and it points to the same place jakepusateri.com does. Thanks, Mali!

Content Delivery Network

A Content Delivery Network (CDN) is an optional component that makes your website faster and your host expenses less. CDNs act as middlemen between the internet and your website to get physically closer to your users and provide better download speeds. CDNs work especially well for a static website because your content doesn’t change user to user and you can cache everything, never needing to request from your original host for most traffic.

Netlify

Hosting and CDN integrated.

CloudFlare

Free CDN. Have paid monthly plans.

Amazon CloudFront

Paid CDN by Amazon, usage based. Limited free tier for 1 year.

My Choices

This website is hosted on netlify. They were easy to set up, connect to bitbucket (free private repos) and automatically run a build+deploy on each git push. For the domain name, I liked the look of my own domain on a .com, so I went with jakepusateri.com as my primary domain.

P.S. Though the goal of this article was to detail how to host a free website, I wish I could pay Netlify at least some money so our incentives would be better aligned. They solve a lot of problems pretty well from my perspective. I worry they will decide the free plan is no longer valuable and cut it, or change some features, or go out of business because too many of their users are on the free plan. They seem to be venture funded for now, and hopefuly their paid (multi-user) plans will continue to subsidize the free accounts. If I was paying them directly I would feel better, but their lowest paid plan is currently $45/mo, and I do not need any of the addtional features it provides over free. If they do cut the free plan, a static website does make it pretty easy to switch to someone else.

To get notified as soon as new posts go up, sign up for my email list.


Back to posts