ruby on rails hosting providers
user profile avatar
tech girl

Published on • 🕑3 min read

A Guide on How to Host Your Ruby on Rails Application

4likes8

Blog views712

Listen to this blog

Congratulations on Learning Ruby on Rails and Creating Your first Ruby on Rails Application! But wait a minute, how do you host your application on the internet?

One of the most challenging endeavors I have faced as a Ruby on Rails developer is finding hosting websites that offer free tier hosting for students and are actually easy to use. That is why I have compiled a list of my favorite hosting platforms to help make your life easier and make you fall in love with Ruby on Rails.

In this article, i will also compare the advantages and disadvantages of each hosting platform and give you tips on how to get the best out the listed platforms.

1. Railway

railway-logo

Railway is my first choice for hosting a ruby on rails application. The platform provides new users with $5 credit, which is depleted based on the CPU usage of your web service. To host a ruby on rails application on railway, you will need to create an account either using GitHub or email, import your repository and add other necessary configurations.

One most vital configuration is having a railway.json file and a Procfile. The railway.json file defines how railway will build your application, while the Procfile defines the instructions necessary to run the appliaction, which in this case is rails db:migrate and rails s.

For more guidelines on how to host on railway, consider cloning this Ruby on Railway Template. You can also check out this blog deploying on railway 

2. Render

Render-Logo

Render is the second most popular choice for deploying ruby on rails application for free. The platform is more common among developers, although successfully hosting on the platform could be an headache.

Unlike railway, render provides a free instance that allows you to host a web service with no limitations as long you do not exceed the allowed bandwidth. Render also offers postgress database, which expires after a while if you fail to switch to a paid account.

This means that your data could be lost when the database expires. Therefore, navigating such challenge would require hosting the database on a separate platform such as Supabase, Vercel or Firebase.

The web service provided by render also sleeps after 30 minutes of inactivity and waking it might take more than 1 minute. This deliberately makes the server too slow, which I believe is an attempt by render to encourage individuals to switch to a paid plan. However, auto-sleep also helps cut costs when the server is not in use.

To get started with render, you will need to create a render-build.sh file in your repository, which directs render how to build the app. However, render has also introduced automatic builds, which makes it very easy to deploy on the platform.

For more information on how to deploy on render, check their Ruby On Rails Documentation or just go to their website and create a new web service.

3. Koyeb

Koyeb

I recently discovered koyeb on stackoverflow. Koyeb provides a free lifetime plan for a web service that allows developers to experiment with their site. The forever free tier providers 50 active hours per month. The web service auto-sleeps after periods of inactivity, which makes it slow to respond.

The platform also automatically runs builds using docker and does not need any instructions on how to build or configure the app. Just import the GitHub repo and that's it! However, you will need to host the database in another program such as Supabase or Vercel.

However, I did experience some lag with Koyeb and Render, which made the database really slow. The issue is likely caused by PGbouncer which is used to distribute loads. Since with render and Koyeb you have to host your database separately, the web service gets really slow.

As I wrap up, other sites that i have found but might not be free (not tried them out yet) include Microsoft Azure and OpenShift. However, the greatest flex is of course to self-host your application.
Let me know of other awesome free platforms that rubyists can enjoy!

Like what you see? Share with a Friend

4 Comments

8 Likes

Comments (4)

sort comments

Before you comment please read our community guidelines


Please Login or Register to comment

user profile avatar

Tech Wizard

online

Published on

I better use nodejs to develop my APIs than suffer with rails!

user profile avatar

Jane Wanjiru

online

Published on

In this race I would say railway is worth it!
user profile avatar

Tech Wizard

online

Published on

Thanks @donvine! but that doesn't sound legal
user profile avatar

the don

online

Published on

AI is being used to censor us and people are not yet aware!