Hosting an infinite number of apps in the cloud for free, on your own domains.

Longer title: Building and hosting an infinite number of scalable secure web apps on custom domains, with no vendor lock, only using skills I already have, for free.

Sometimes I talk myself into the seemingly impossible. While writing a stubborn paragraph of my book (Your First Product... go sign up!), I wanted to know just how cheaply I could host a custom web app in the infamous cloud.

For example, could I do it for free?

Cheap is good, cheap is wonderful, but FREE is magical. If you can host apps for free, then you can host as many apps as you dream up. Whoosh! Bing! Blam! Another thought? Another app!

Once I'd realized what I was attempting to achieve, I put it in tweet form as this:

And promptly gave up on the idea, as it was clearly BONKERS. Or at least I tried to give up on it. My mind kept turning the idea over... there must be a way to have it hosted for zero dollars, without vendor lock in.

Sometimes if you set up a system with a lot of constraints, you see that it's impossible. And you then need to work out which constraint to relax. (This is called "engineering")

So I did what any true engineer does, I used a spreadsheet. I put all the constraints in their own column, and listed different solutions on each row, then checked which constraints they broke.

Anything involving Azure cost too much, and was too likely to lead to vendor lock in. Heroku had a lot going for it, but relied on technology I don't use. GitHubPages had a lot of advantages -- but don't permit any kind of server-side code. At the same moment as I started looking into 'Parse' I heard that it had been shutdown.

Finally I stumbled on an architecture that suited my needs. It was a hybrid, like that mythical beast with the head of a lion and the belly of a zebra, or however those old myths used to run. They were pretty popular back in the day.

Here's what I came up with.

free_cloud_app_hosting.png

That's right. As befits a zero-dollar architecture diagram, I have resorted to the use of Comic Sans.

The front end is static html and javascript, hosted by GitHubPages. GitHubPages are free, and they let you configure your own domains or sub-domains, so for example I could have "GuessAGuid.secretGeek.net" be served from GitHubPages, provided I own the domain (...and have wrestled it back from some pesky Ukrainian). One downside is that the repository has to be public, as private repositories at github still cost a little money, but since this is just the front end of the website, I see no harm in making the code available.

The front end uses javascript (json) to talk to the back-end, which is an asp.net app hosted elsewhere. The back end is hosted by appharbor using their free tier. Because it's the free tier they won't let me have a custom domain, they assign a url such as http://guessaguid.apphb.com/ but that's okay: this is just a back-end which the customer never need see.

AppHarbor is a great way to host the back-end of a site, because I can deploy to it from the commandline, by just pushing to a repository. I don't want the backend code to be public, so I need a private repository. Private repositories at github cost money. For one low monthly price you get unlimited private repositories... but that's not good enough for my constraints, nuh uh. Fortunately, bitbucket gives you unlimited private repositories for a single user, and appharbor integrates just as nicely with bitbucket as they do with github.

So there we have it. GitHubPages front end, appharbor+bitbucket back end. A way to host an unlimited number of small applications, on custom domains, in the cloud, without learning any new tech or getting slugged with fees from anyone.

(One thing I didn't solve was the 'secure' part. I wanted to have the whole thing encrypted end to end, using the mystical glory of Let's Encrypt, a new certificate authority who are ushering in a golden age of https everywhere. The most commonly suggested way to do this is to use cloudflare with a custom domain in front of github pages, though there's also a kloudsec solution. I haven't tried either, so can add nothing of value on the topic. The 'free tier' of AppHarbor includes 'piggyback SSL' which I think might be sufficient for this example.)

And here's the app:

Guess A Guid ← Can you guess a GUID? Try it and see for yourself!

 

My book "Choose Your First Product" is available now.

It gives you 4 easy steps to find and validate a humble product idea.

Learn more.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.