Vardo
Tutorials

Deploy a Ruby on Rails App

Deploy a Rails application to Vardo using Railpacks or a custom Dockerfile.

This tutorial covers deploying a Ruby on Rails app from GitHub to Vardo. You've got two build options — Railpacks (zero-config) or a custom Dockerfile.

Prerequisites


1. Create a project

  1. Go to Projects in the sidebar
  2. Click New Project
  3. Name it — e.g., my-rails-app
  4. Click Create

2. Create the app

  1. Inside your project, click New App
  2. Choose GitHub as the source
  3. Search for and select your repository
  4. Pick the branch to deploy from (usually main)
  5. Choose a build method:

Select Railpacks as the build template. Railpacks detects your Ruby version, installs dependencies, precompiles assets and starts your app automatically. No config files needed.

It handles:

  • Ruby version detection from .ruby-version or Gemfile
  • bundle install with proper caching
  • rails assets:precompile
  • rails db:migrate on deploy
  • Starting Puma on port 3000

Option B: Dockerfile

If your repo has a Dockerfile, Vardo uses it directly. A typical Rails Dockerfile looks like:

FROM ruby:3.3-slim

RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs

WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle install

COPY . .
RUN bundle exec rails assets:precompile

EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
  1. Click Create App

3. Set environment variables

Rails apps typically need a few env vars to run in production:

  1. Open the app detail page
  2. Click the Environment tab
  3. Add your variables:
    RAILS_ENV=production
    SECRET_KEY_BASE=your-secret-key-here
    DATABASE_URL=postgresql://user:pass@db-host:5432/myapp_production
    RAILS_SERVE_STATIC_FILES=true
  4. Click Save

Generate a SECRET_KEY_BASE with rails secret locally if you don't have one.


4. Set up the database

If your Rails app uses PostgreSQL, you've got two options:

Option A: Add a Postgres app in the same project. Create a new app using the Postgres template, then reference it via DATABASE_URL in your Rails app's environment.

Option B: Use an external database. Point DATABASE_URL at your managed database (RDS, Neon, Supabase, etc.).

Either way, Vardo runs rails db:migrate automatically during Railpacks deploys. If you're using a Dockerfile, add a release command or run migrations in your entrypoint.


5. Deploy

  1. Click Deploy on the app detail page
  2. Watch the build log — Railpacks installs dependencies, precompiles assets and starts Puma
  3. When the status changes to Running, you're live

Subsequent pushes to your configured branch trigger deploys automatically.


6. Add a custom domain

  1. Go to the app's Domains tab
  2. Click Add Domain
  3. Enter your domain — e.g., app.mycompany.com
  4. Add a DNS record:
    CNAME  app.mycompany.com  →  vardo.example.com
  5. Click Verify — Vardo provisions a TLS certificate automatically

Troubleshooting

Build fails: Your Ruby version is X, but your Gemfile specified Y

Railpacks reads .ruby-version or the ruby directive in your Gemfile. Make sure one of them matches what you actually want.


Assets not loading in production

Set RAILS_SERVE_STATIC_FILES=true in your environment variables. Without it, Rails expects a reverse proxy to serve static files — Vardo handles routing but the app container needs to serve its own assets.


Migrations fail on deploy

Check the deploy logs. Common issues:

  • DATABASE_URL not set or pointing at the wrong host
  • Database doesn't exist yet — create it first via rails db:create or your database provider's dashboard
  • Pending migrations with syntax errors — test locally first with rails db:migrate

Next steps

On this page