Deploy Guide · Ruby

Deploy a Ruby on Rails App

Ship Rails to production the way it was meant to be — simple.

Overview

Ruby on Rails remains one of the most productive web frameworks for building full-featured applications quickly. Deploying Rails on Kubeletto means no Capistrano, no VPS configuration, no nginx setup — just a Dockerfile and a git push.

Prerequisites

  • Rails 7+ with a Dockerfile (Rails 7 includes one by default)
  • DATABASE_URL and SECRET_KEY_BASE in environment
  • A Kubeletto account

Step-by-Step Guide

Deploying Ruby on Rails to Kubeletto is done by configuring a Dockerfile, connecting your GitHub repository, and setting environment variables. Follow this step-by-step checklist to deploy your code:

  1. 1

    Use Rails built-in Dockerfile

    Rails 7 generates a production-ready Dockerfile. Review and customize it for your stack.

    bash
    # Rails 7 generates this automatically
    # rails new myapp --dockerfile
    # Customize as needed for your gems and asset pipeline
  2. 2

    Configure Puma to bind to 0.0.0.0

    Update config/puma.rb to bind to all interfaces.

    ruby
    # config/puma.rb
    port ENV.fetch("PORT") { 3000 }
    workers ENV.fetch("WEB_CONCURRENCY") { 2 }
  3. 3

    Deploy and set environment variables

    Set Rails secrets and database credentials before the first deploy.

    bash
    kubeletto env set SECRET_KEY_BASE=$(rails secret) --app rails-app
    kubeletto env set DATABASE_URL=postgres://user:pass@host/db --app rails-app
    kubeletto env set RAILS_ENV=production --app rails-app
    kubeletto deploy --source github --repo your-org/rails-app --branch main

Sample Environment Variables

To configure your Ruby on Rails application, set these key-value pairs in the environment variables tab of the Kubeletto console or CLI. Ensure production secrets are flagged as write-only:

.env
RAILS_ENV=production
SECRET_KEY_BASE=your-64-char-secret
DATABASE_URL=postgres://user:pass@host:5432/dbname
REDIS_URL=redis://...
RAILS_LOG_TO_STDOUT=true
RAILS_SERVE_STATIC_FILES=true

Related Kubeletto Features

Kubeletto offers automatic SSL certificate provisioning, zero-downtime rollbacks, and scale-to-zero autoscaling for Ruby on Rails container workloads:

PaaS Platform Comparisons

See how Kubeletto compares directly against other cloud platforms and PaaS providers when deploying Ruby workloads:

Frequently Asked Questions

Find direct answers to common questions about hosting, building, scaling, and managing Ruby on Rails containerized apps on Kubeletto:

How do I run Rails database migrations on deploy?

Add `bundle exec rails db:migrate` to your container entrypoint script before starting Puma. This runs automatically on each new deployment revision.

Can I run Sidekiq background jobs on Kubeletto?

Yes. Deploy Sidekiq as a separate Kubeletto app using the same codebase but with CMD overridden to `bundle exec sidekiq`. Both apps share the same environment variables.

Where should I store uploaded files with Active Storage?

Configure Active Storage to use an S3-compatible service. Container filesystems are ephemeral on Kubeletto, so local disk storage won't persist across deploys.

Deploy your Ruby on Rails app today

Free during our active beta. No credit card required.

Start Deploying Free