> ## Content Index
> Fetch the complete content index at: https://www.jvrc.ca/llms.txt
> Use this file to discover other available public pages before exploring further.

# Guide to deploy a new Rails app (in less than 10 minutes)
- URL: https://www.jvrc.ca/guide-to-deploy-a-new-rails-app-in-less-than-10-minutes/
- Published: 2026-03-12T20:45:00.000Z
- Updated: 2026-09-14T20:46:01.000Z
- Author: Javier Cervantes
- Tags: existing-topic, rubyforum

Below you’ll find a **step-by-step process on how to create a brand new Rails app and deploy it to** [**Fly.io**](http://fly.io/?ref=jvrc.ca)**.** This guide if for you, if you’re looking for to spin up an app because:

- You want to learn how to deploy an application from scratch.
- You’re building your portfolio or a small app.
- You’re looking for a decently abstracted solution.
- You’ve spent hours non-stop battling with documentation or trying to setup things by yourself.

> *Check the section at the end for more information about why Fly is the recommended option.*

## Pre-work

- [Create a fly.io account](https://fly.io/app/sign-in?ref=jvrc.ca) (no credit card needed)
- Install [flyctl](https://fly.io/docs/flyctl/?ref=jvrc.ca) and [rv](https://rv.dev/?ref=jvrc.ca) dependencies by running the following commands in your terminal:
  - `curl -L `[https://fly.io/install.sh](https://fly.io/install.sh?ref=jvrc.ca)` | sh`
  - `curl -LsSf `[https://rv.dev/install](https://rv.dev/install?ref=jvrc.ca)` | sh`
- Restart your terminal and authenticate by running `fly auth login`. Your default browser will open and ask you to login, after that you’ll see the following message:

![Capture d’écran, le 2026-03-09 à 17.04.29](https://canada1.discourse-cdn.com/flex030/uploads/ruby_users_forum/original/1X/543eed4f48d27f27d872a9562a2e77a255f5ef22.jpeg)

- Close window and go back to your terminal.

## Create a Rails app from scratch

- Run the following command to create a new app ([rv](https://rv.dev/?ref=jvrc.ca) will automatically install ruby and rails gem for you): `rvx rails new demo-app`
- After the command finish setting up the app, go to the newly created app folder: `cd demo-app`
- Install the project dependencies by running: `rv ci`

## Update Dockerfile

- The Dockerfile provided by default needs some adjustments to work with Fly, run the following 2 commands to update it:
  - `bundle add dockerfile-rails --optimistic --group development`
  - `rv run rails generate dockerfile --force`

## Launch!

- Run the flyctl command to create a new app and deploy your code: `fly launch`
- Process will stop and show the default settings:

```
We're about to launch your Rails app on Fly.io. Here's what you're getting:

Organization: Javier Cervantes              (fly launch defaults to the personal org)
Name:         demo-app-lingering-cloud-1789 (generated)
Region:       San Jose, California (US)     (this is the fastest region for you)
App Machines: shared-cpu-1x, 1GB RAM        (most apps need about 1GB of RAM)
Postgres:     <none>                        (not requested)
Redis:        <none>                        (not requested)
Tigris:       <none>                        (not requested)

════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════

? Do you want to tweak these settings before proceeding?
```

- Type N and return to use the default values.
- Once the deployment is finish you’ll see URL where the app was created and deployed to a unique URL, for example: `Visit: https://demo-app-lingering-cloud-1789.fly.dev/`

## Verify

- You can go to `[URL]/up` and you’ll see a green screen that confirms that the deployment was successful.

Go to your [Fly Dashboard](https://fly.io/dashboard/?ref=jvrc.ca), you’ll see that a new machine has been provisioned. A volume is also automatically created to you can use a SQLite database by default:

![Capture d’écran, le 2026-03-09 à 17.23.06](https://canada1.discourse-cdn.com/flex030/uploads/ruby_users_forum/original/1X/25dd5c4504d873b5eb2073e1058bf63dad2e8353.png)

## Deploy with a simple database

- Run this command to create a products table and the related scaffolded files: `bin/rails generate scaffold Product name:string`
- Since the app already created, use the deploy command to push the changes: `fly deploy`
- Now you can test the changes in `[URL]/products`

![Capture d’écran, le 2026-03-09 à 17.29.14](https://canada1.discourse-cdn.com/flex030/uploads/ruby_users_forum/original/1X/e1a4bd77194bd1aa60ac5dd941fac95c5dced63d.png)

That’s it! You can use the same process to deploy an existing application or follow the [Getting Started with Rails](https://guides.rubyonrails.org/getting%5Fstarted.html?ref=jvrc.ca) tutorial for a walk through of how to build a simple e-commerce app.

## Why choose PAAS and Fly?

I recommend using a PAAS provider if you’re looking to get something working quickly or if you’re not well versed in “Devops stuff”. For example, self-hosting in a VPS adds additional complexity like provisioning a server, setting up a domain, ssh configuration and you need to take care of security and updates.

More specifically, I selected [Fly.io](http://fly.io/?ref=jvrc.ca) for this guide because it has a [free trial](https://fly.io/docs/about/free-trial/?ref=jvrc.ca) that allows you to spin something up, and decide if you want to continue or look for something else. If you only need to deploy a simple application, the [price](https://fly.io/calculator?ref=jvrc.ca) is also very competitive:

![Capture d’écran, le 2026-03-11 à 15.59.16](https://canada1.discourse-cdn.com/flex030/uploads/ruby_users_forum/original/1X/e9d0d2564b70323f4922cacdd70a18a40cf23253.jpeg)

Finally, it also has the following benefits:

- No additional Postgres database required (unless you want to).
- Pay as go you plans (you can suspend/stop the machines and you won’t be charged)
- You can use the same Dockerfile to switch to a different provider or self-host later.
- Comprehensive [Rails documentation](https://fly.io/docs/rails/?ref=jvrc.ca) and a community forum for troubleshooting.

> You can review and compare with other similar options:[Heroku](https://devcenter.heroku.com/articles/getting-started-with-rails8?ref=jvrc.ca)[Render](https://render.com/docs/deploy-rails-8?ref=jvrc.ca)[Railway](https://docs.railway.com/guides/rails?ref=jvrc.ca)

## Before you go

Thanks for reaching this far! If you find this guide helpful, please share it with others.

I would love to know if you’re able to deploy your apps or if you have any issues, please send your feedback.

Happy coding!