So, I have a bunch of side projects. All of them are fairly small and it’s mostly me and a few friends using everything. I’ve constantly tried to cut my hosting costs as much as possible, not as a practical matter but I see it more like code golf, it’s just fun to see what’s possible.
Let’s start off by listing what I’m hosting: * 2 PHP-based web apps * 3 environments each (dev, staging, live). I don’t do local dev because I use a Chromebook * Simple marketing sites * A very simple note app which has been broken up into a front-end and API * My personal blog * My wife’s blog * A website for a local business * A website for a personal project * A few crons I run that send text messages * Anything that needs a DB uses MariaDB
It’s quite a bit of this-and-that and I’ve taken several different approaches in the past, from those free or cheap PHP-based cPanel hosts to cloud servers at DigitalOcean, Rackspace, AWS, etc. A few sites and free tiers I’ve seen gave me the idea of trying to achieve 100% free hosting.
Netlify is great for hosting static sites. If you’re a paying customer, they even have a few tools that can upgrade a static site to be fairly complex. For my purposes, their free tier is great. It even includes static site generation, so when I push to Bitbucket (free private repos), they’ll run my predefined command to generate my site.
I’m currently using Netlify (and Hugo) for the marketing sites for my PHP apps, my personal blog, and the front-end for my note app.
The weaknesses here are that for their free tier, I’m stuck with very static sites. Technically, they also limit the number of visits per month but it’s somewhere around 2000 uniques though I’m not super concerned about it. I’m just not that popular.
Heroku can host just about any web app. They do Python, Node, Java, and a ton of other languages, and luckily for me that includes PHP. PHP isn’t the newest kid on the block, or the best by any means but it’s what I’m used to and what I’m most productive in for now.
The limitations of the free tier is that you only get 1000 dyno(server)/hours per month, and your apps shut down after 30 minutes of no activity. They tend to take 3-5 seconds to spin up again but they’re pretty responsive after the initial spin up.
I’ve set up staging and live for both of the PHP apps and the API for my note app on Heroku. Since it’s mostly just me using them, the 3-5 second lag on first load is tolerable and I excluded the dev environments because running a site on Heroku requires a commit.
Google Cloud Platform
GCP’s free tier is pretty generous. They give you a 512MB server with 30GB of disk free forever, along with a bunch of other stuff that I’m not utilizing yet.
512MB isn’t much these days but it’s enough to run a few things. The real limitation is bandwidth. You’re limited to 1GB outbound, which I’m not 100% sure I can stay within the limits of for now.
I have my MariaDB server running on GCP along with my text message crons and dev instances for the PHP apps.
Admittedly, this isn’t a permanent fix. Azure’s free tier is good for a year and their free forever tier doesn’t offer much. The “free for a year” tier offers a 1GB server with 15GB/month outbound data, which is pretty nice.
The limitation here is obviously the 1 year time limit. 15GB/month isn’t great but it’s better than GCP’s 1GB/month.
I use this server for my wife’s site, the local business website, and my personal project website. They’re all using WordPress, since I don’t want to try and convince non-technical people to use a static site generator, and I need a bit more functionality on my personal project site. For the long-term I’m going to work on getting these sites in Heroku’s free tier but I know that requires some special plugins and probably a decent amount of fiddling with things. Oh well, I’ve got a year.
Not really for hosting, but I use B2 Storage Cloud for backups. Up to 10GB is free and everything after that is half a cent per GB. It’s cheaper than anything else I’ve seen, including AWS’s Glacier, which has a 4 hour wait time.
I am storing a few things in Amazon S3, which does cost me some money, but it’s around $0.22/month. Maybe I’ll get around to getting rid of that soon.
Mailgun offers a free tier MTA service for up to 10k emails/month. It’s $1 / 2k emails after that, so… not bad.