Cheap (and AWESOME!) Web Hosting

5 min read

My professional field is web development, and throughout my years, I’ve hosted a lot of websites. Between personal sites and clients’ sites, I’ve managed the hosting for dozens of projects. I have to say, though, that how I set up Eff You Money, must be the cheapest I have ever seen or accomplished. Not only is it cheaper, it’s incredibly faster, more reliable, infinitely scalable, and I only pay for the exact amount of what I use.

My setup won’t work for everybody, in that, you will probably need some minimal technical know-how in order to do it. Thankfully, the internet is full of guides to help you along.

First, let’s go over the numbers of how much I’m saving vs. a typical web host…and I have the perfect example! The old version of this very site!

The old cost of my website is easy to calculate. One, $10/mo droplet from DigitalOcean.

What was good about hosting on DigitalOcean?

  1. Setting up a Wordpress machine took a couple clicks
  2. The machine came with a SQL database to go along with Wordpress to store posts, comments, etc.
  3. $10/mo isn’t bad at all

What was bad about hosting on DigitalOcean?

  1. $10/mo is more expensive than it needs to be (for what I needed). Don’t get me wrong. $10/mo for a machine that can host multiple, low-traffic websites is great…and their interface is outstanding. It’s just overkill, computing-wise, for what I needed…which is to just display some HTML.
  2. My droplet was hosted in the east coast of the US, meaning the further you live away from the east coast, the slower my website will be.
  3. If I had suddenly gotten a lot of traffic from a post that went viral (a man can dream!), the droplet would crumble under the pressure and my website would be down.

There must be something more in-tune to what I need

As an experiment, I moved my website to Amazon S3. S3, as it turns out, is not just a place to store files. It can also serve websites from files that are stored there. After all, a website is just a collection of HTML, styling and maybe some Javascript… also known as files that don’t change, or “static files.”

What’s more, I can combine S3 and CloudFront, a Content Delivery Network. CloudFront distributes the files of my site to various data centers around the world to make sure that no matter where a user of mine is trying to visit my site from, they will be accessing a version of my website that is closest to them. CloudFront also automatically compresses my files into teensy weensy files (technical term), making the loading of my site even faster.

The glaring omission here is that I have not hosted Wordpress on S3. As I said before, Wordpress requires a database, and S3 is not that. I also didn’t want to pay for Amazon’s database offerings. This site is built on Hugo, and easy-to-learn framework for building static websites. It’s certainly less feature-rich than Wordpress, but I still have some of the bells and whistles for what I want.

For instance, I have this blog setup to automatically post new posts to Buffer/Twitter, which used to be its own Wordpress plugin. Another piece of Wordpress functionality was scheduled posts, but I also found an automated method for accomplishing that with Hugo. Really, I was able to find a solution to everything I missed from Wordpress. What I gained was a super clean writing experience, free from gobs and gobs of poorly-written and hardly-maintained Wordpress plugins.

Checking out Amazon’s offerings

This is all well and good, but let’s get down to brass tacks. Surely this has to be expensive. In 1995, that would be true…but as it has turned out, Amazon has their web offerings figured the fuck out.

First, the only cost of S3 is the storage of the site. The entirety of this website, including images, is 2MB. S3 charges $0.023 per GB.

$0.023 price per GB * (2 MB site / 1000 MB in a GB) = $0.000046 per month to host the site on S3.

Second, CloudFront charges $0.085 per TB of data transfer, and $0.0075 per 10,000 requests. I don’t want to alarm anybody, but I don’t get anywhere near that! But, for funsies, let’s pretend I got one million views every month…and that they downloaded my entire website every time.

$0.0075 price * (1,000,000 views / 10,000 cost basis) = $0.75 CDN request cost per month

$0.085 price per TB * (2 MB site / 1,000,000 MB in a TB) = $0.00000017 CDN data transfer cost per month

Total cost of CloudFront: $0.75 per month.

All in, hosting this site on S3 and CloudFront is costing me ~$0.75 per month.

Let’s hammer home a few things:

  1. S3 and CloudFront is definitely cheaper than my old host.
  2. Since this site is hosted on Amazon S3 and distributed around the world, it can handle an infinite amount of traffic without going down. No more “Reddit hug of death” for getting a spike in traffic.
  3. Not only can it handle infinite amounts of traffic… when I get hardly any traffic (the usual), I don’t even come close to spending a penny to host the site. I pay for exactly what I use.

Want to get started on something like this?

Here is a guide that I followed that helped me along. I combined this with Hugo to generate my site’s files…and voila.

DigitalOcean does not suck

DigitalOcean is very good!

Personally, I just didn’t need the 247 compute power that it offered me, and found that the route I took optimized costs for what I actually used. I think of it like comparing an automatic shotgun to a sniper rifle. DigitalOcean provides you with a machine that can do a lot of things, host a lot of websites and is very easy to get started with. Amazon’s web offerings provided me with very specific tools for my one, very specific use case.

If you’re just hosting a simple site, blog, or even a front-end only application, I encourage you to see if you might be able to save a few bucks every month by using some of Amazon’s services!