Deploying Rails on

Deploying Rails on

Recently, Robby Russel posted opens a new window posted on Twitter asking for Heroku alternatives for small Rails apps. Since it got quite a bit of traction, I decided to explore some options and post my experiences as blog posts.

For my first post, I’ll go for one that I’ve already used in the past and liked it very much:

I like them because they’re dead simple and have great docs. The dashboard is pretty good too, but since I’m not one to have too many requirements around my apps, the simplicity of use is what I like the most.

1. Install flyctl and log into Fly

The way we deploy things in is using flyctl, a command line app that is used to manage the applications.

If you’re going to do anything on, you’ll need it. So the first thing to do is to install it.

The Install flyctl page opens a new window has instructions for the main OSes around (MacOS, Linux and Windows). For this article, because I use MacOS, I’ll be following those instructions.

If you have Homebrew, you can type:

brew install flyctl

If not, there’s an installation script:

curl -L | sh

If you used the script, you’ll need to add the flyctl directory to your shell’s rc file. The output of the installation will give you the entries you need to add.

Whatever the method, if you finished the previous step successfully, you should be able to run the flyctl command.

This is the expected output:

$ flyctl
This is flyctl, the command line interface.

  flyctl [flags]
  flyctl [command]

It doesn't look like you're logged in. Try "fly auth signup" to create an
account, or "fly auth login" to log in to an existing account.

Here's a few commands to get you started:
  flyctl launch    Create and configure a new app from source code or a Docker image
  flyctl status    Show app status
  flyctl deploy    Deploy Fly applications
  flyctl logs      View app logs
  flyctl apps      Manage apps
  flyctl machine   Commands that manage machines

If you need help along the way:
  Use `fly docs` to open the documentation, or visit
  Use `fly <command> --help` for more information about a command.
  Visit to get help from the community.

For a full list of commands, run `fly help`.

Once you confirm flyctl was correctly installed, log in to your account. Also, assuming this is your first time around doing this, you’ll need to run:

flyctl auth login

This will open your browser where you’ll log in, after which you can go back to the terminal:

$ flyctl auth login

Waiting for session... Done
successfully logged in as

2. Create your Rails app

I’m going to assume you have one already. If not,’s guide runs you through creating one.

In my case, I’ll be using an app I created as an exercise to learn Hotwire: a character sheet application for FFRPG 3e rules opens a new window .

3. Deploy

Run fly launch from your app directory and follow the wizard. It’s that simple. In my case, all I need is a PostgreSQL database, so my flow look like this:

$ fly launch
Creating app in /Users/mateus/Projects/ruby/character_sheet
Scanning source code
Detected a Rails app
? Choose an app name (leave blank to generate one): ffrpg
? App ffrpg already exists, do you want to launch into that app? Yes
Some regions require a paid plan (bom, fra, maa).


Creating a second machine to increase service availability
Finished launching new machines
NOTE: The machines for [app] have services with 'auto_stop_machines = true' that will be stopped when idling


Visit your newly deployed app at

And if you click that link at the end you’ll see your application:

FFRPG app login page

Once you sign up, you can create your characters (using Hotwire Turbo!):

New character form

After filling out some details…

Character list

4. Final observations

This app uses PostgreSQL as the database. If you happen to want to run a standard Rails application that uses SQLite, some things aren’t fully supported on, like deploying to multiple regions. Make sure to read through their docs opens a new window on this, but if you require multiple regions in production, it might be best to pick a different service to deploy the application, unless you don’t mind the risk.

Also, despite being functional, this application is quite simple, so if you use more services (e.g. Sidekiq, Redis, etc.) your experience may vary. The aim of this tutorial was merely to showcase the simple path for those considering to migrate from Heroku; and for that we believe that’s strong selling point is its ease of use. Its command line tool is easy to understand and thoroughly documented. They also have great community support in the form of a forum opens a new window and, of course, direct support opens a new window for those signed up on their Scale, Launch or Enterprise plans

Incidentally, if you need help migrating your app to or any other hosting service, we can do that for you! Just send us a message opens a new window and get in touch with our team!

Get the book