Rails
Deploy a Rails app with Postgres, workers, Solid Queue, Tailwind assets and Rails 8 extra databases.
Step by step: Deploy Rails to DigitalOcean · Deploy Rails to Hetzner · Deploy Rails to Vultr · Deploy Rails to OVHcloud · Deploy Rails to Scaleway · Deploy Rails to UpCloud
- Release:
bin/rails db:prepareruns before each version goes live (yourProcfilerelease:wins). - Production defaults:
RAILS_ENV,RACK_ENV,RAILS_SERVE_STATIC_FILESandRAILS_LOG_TO_STDOUTare set if you haven’t; assets build withSECRET_KEY_BASE_DUMMY=1, so a real secret isn’t needed at build time.SECRET_KEY_BASEis generated once. - Databases:
pg→ Postgres,mysql2/trilogy→ MySQL,redis/sidekiq→ Redis. Rails 8 extra databases (cache, queue, cable) found inconfig/database.ymleach get their own<NAME>_DATABASE_URL. - Workers: Sidekiq, Solid Queue (
bin/jobswhen present), GoodJob, Resque and Delayed Job are offered from yourGemfile.lock. - Uploads: Active Storage on disk gets a persistent
storage/volume automatically; or attach a bucket and the S3 variables are injected. - Old native gems (nio4r, puma 5…) compile under GCC 14 without changes.
Workers are a second process, not a second app
An app is one codebase and one image; web, worker, the release command and cron are process types of that same app, each scaled on its own — the 12-factor model, not a fleet of near-identical apps for one codebase. With a Procfile:
web: bin/rails server -p $PORT
worker: bundle exec sidekiq
both show up automatically. Without one, Railyard starts web itself and offers the first job runner it finds in your Gemfile.lock as a worker process. Add more from the app’s Workers tab, or scale what’s there from the CLI:
railyard scale my-app worker=3
web is capped at one replica for now; worker scales from 1 to 10. See Workers and scheduled jobs for cron.
Solid Queue, three ways
- Its own database (the Rails 8 default).
config/database.ymldeclares aqueue:entry withmigrations_paths: db/queue_migrate; Railyard reads that as an extra database and provisions a separateQUEUE_DATABASE_URLnext toDATABASE_URL.bin/rails db:preparemigrates both in the release step. The worker process runsbin/jobsif your app has it, otherwisebundle exec rake solid_queue:start. - Sharing the primary database. Drop the
queue:entry (or point it at the primary connection) and Solid Queue’s tables live next to your own — nothing extra is provisioned, oneDATABASE_URL, same worker command. - Inside Puma, no worker process. The canvas Settings → Rails panel’s Run Solid Queue inside Puma switch sets
SOLID_QUEUE_IN_PUMA=true, which a stock Rails 8config/puma.rbalready reads (plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]). Puma dispatches jobs itself; drop theworkerprocess and scalewebinstead.
The same panel adds Action Cable on Solid Cable (WebSockets, which provisions its own CABLE_DATABASE_URL), YJIT and Thruster in front of Puma.
Config and secrets
Nothing but env vars: set one under Variables, or railyard env:set my-app KEY=VALUE from the CLI, and the same image runs unchanged from staging to production — dev/prod parity, not a build-time branch. SECRET_KEY_BASE and any other secret your app owns are generated once and encrypted; a third-party key is never invented for you. To point at a Postgres or Redis running as its own service on the canvas rather than an addon on the app’s server, reference it with ${{redis.REDIS_URL}} — resolved per environment, the same cross-service syntax used everywhere. See Variables and secrets.
Precompiling assets (Tailwind, esbuild, importmap)
assets:precompile runs in the build step with no setup from you: the build wires a Node toolchain into the Ruby build itself, so a tailwindcss:build or cssbundling-rails/esbuild step chained onto it just works — there’s no separate Dockerfile stage or pre-deploy hook to write. If precompiling needs the database or Redis — an initializer that queries at boot, say — and only the app server has those, Railyard notices the failure there and defers that same step to the release phase automatically, where they exist. Pushing a pre-built image instead of letting Railyard build it works the same way: assets compile against throwaway Postgres and Redis containers on the build server first and get baked into the image before it reaches the app server, so your real database is never touched. You don’t need a release_command for any of this — set one only if db:prepare isn’t enough, e.g. a data migration script.
Deploy it
- From a repo: paste the Git URL, or pick it from the picker once GitHub is connected — Railyard reads the Gemfile, fills in the process list, databases and documented variables, and deploys on every push.
- From the CLI:
railyard create my-app https://github.com/me/my-app --addons postgres,redis, or runrailyard git:remote && git push railyard mainfrom inside the repo to deploy on every push without GitHub. - One click: add the deploy button to your README, or publish to the template catalog so anyone can launch it with its addons and variables already filled in.