Free or cheap Ruby on Rails Hosting Options

In my work as a Ruby on Rails developer, I usually encounter applications that run on environments using Terraform or some repeatable infrastructure manager. For Rails apps that need to scale this can be helpful since it provides a way to make fully independent (and repeatable) environments, or copies of your application, that can be “spun” up by the click of a button and destroyed just as easily. 

This is helpful in managing Cloud resources since as anyone who’s used AWS, Azure or Google Cloud can tell you, clicking through multiple screens to configure resources can lead to mistakes and orphaned paid resources that cost you money you didn’t want to spend.

Medium author @ajays871 posted a good writeup about how to go about getting a Rails app deployed using Terraform.

On the flip side, the provisioning of multiple resources across a Cloud provider can be overkill for many Rails side projects. For those apps there are still free and almost free options for hosting your app. Some can be cheaper than hosting a Wordpress or PHP site.

Lets look at some of these options

Heroku.com


First up is the OG of Rails hosting, Heroku. It offers a simple way through the Heroku CLI for onboard rails applications and provision resources like domain names, databases, Redis instances etc. Of course this comes with a price. Currently running a Rails app on Heroku with a Postgres database will cost about $12/mo plus tax ($7/mo for Rails and $5/mo for a Postgres instance).

Heroku used to offer a free tier for hosting Rails apps but those environments also didn’t run all the time and would cycle down when not in use. This would cause a lag for the first user to hit the app next since those resources would then have to spin back up.

That tier is gone now and the base paid tier does not suffer from resources spinning down. At this price it's comparable to what you would pay for hosting Wordpress, Drupal or any PHP application.

Fly.io


This is a very promising alternative to Heroku in that they have a similar CLI interface and method for onboarding Rails apps as Heroku. They currently have a free tier but as their CEO admitted they are experiencing growing pains after Heroku eliminated their free tier and users started switching over. This causes some issues with deploying apps and the app servers intermittently having to restart. Sound like they are working on this though.

They do offer paid tiers of hosting and you can add more ram to your instance at about $5/mo/GB.

Kamatera.com 


Kamatera offers server instances based on the type of application you want to run. For Rails they offer a $5/server tier that should be enough to host a single rails application. The downside here is that you are essentially provisioning a server that you then have to maintain like AWS, Azure or Google Cloud. 

This makes onboarding your rails app a little more difficult too since deployment options for it fall to Capistrano or building a pipeline from your Git Repo which is not for all developers

Vercel.com 


There is a free “Hobby” plan available at Vercel.com. Vercel’s deployment model starts with access to you git repo. From there it detects the app that it needs to build and provisions resources from that. 

To be honest I haven’t successfully deployed a Rails app to Vercel since I keep running into Ruby version issues that I haven’t had time to solve. I’ll update this writeup when I am able to get a medium complexity app deployed on there.

Koyeb.com


Koyeb is another option I have yet to look at, but they claim to offer deployment of 2 services for free. They also offer deployment from Docker images (similar to Heroku and Fly above) and other add on services.

Q

A full stack developer with over two decades of experience. Specializing in Ruby, Micro-services, DevOps and more

Comments (0)

wave

Leave Comment

wave