- Home
- Frameworks
- Ruby on Rails
Rails deployment without the platform tax
Deploy Ruby on Rails apps to servers you own
Push to your main branch and Hatchbox builds, migrates, and restarts your Rails app with zero downtime — on servers you own, at raw hosting prices instead of platform markup.
Includes a 7 day free trial. $10 per server per month after that — unlimited apps.
Hatchbox has been deploying Rails applications since 2016. Point it at a GitHub repository
and a fresh Ubuntu server, and it does the rest — there's no build script to write. It
sees rails in your Gemfile and takes it from there: Ruby versions, bundler,
asset compilation, migrations, the web server, background workers, SSL certificates, and
log streaming.
The Ruby version comes from your .ruby-version, .tool-versions,
or Gemfile.lock. No buildpacks, no Dockerfile, no lock-in — and you keep full
SSH access to a plain, boring server you can debug yourself at 3am.
Why deploy Rails with Hatchbox
Zero-downtime deploys
Each deploy builds into a fresh release directory, then flips the symlink and reloads Puma with a phased restart. Failed builds never take your site down.
Migrations run once
db:migrate runs automatically on the cron server, so it happens exactly
once per deploy no matter how many web servers you're running.
Workers detected for you
Hatchbox spots Solid Queue and Sidekiq on the first deploy and adds the worker process itself. It restarts them on deploy, and again if they crash.
Encrypted credentials just work
Set RAILS_MASTER_KEY as an environment variable and your
credentials.yml.enc decrypts on the server like it does locally.
What customers say
I run 15+ Rails apps and static sites with Hatchbox. My bill went from $400/month on Heroku to $28/mo with Hatchbox & DigitalOcean combined.
Donn Felker
Software Professional
If you want the most bang for your buck, Hatchbox / Hetzner / DigitalOcean is the killer combo. You can throw sooo much at this and it's crazy how inexpensive it is.
Josh Pigford
Serial Entrepreneur
- Applications deployed
- 24,000+
- Deployments run
- 2 million+
- Deploying since
- 2016
How to deploy a Rails app
Four steps from an empty server to a live site. Most people finish in under half an hour.
-
Connect a server
Add a DigitalOcean, Hetzner, AWS, Linode, or Vultr API key and let Hatchbox provision a server, or point it at any existing machine running Ubuntu LTS.
-
Connect your repository
Authorize GitHub and pick the repo and branch. Hatchbox installs a webhook so every push to that branch can deploy automatically.
-
Set your environment variables
Add
RAILS_MASTER_KEY,DATABASE_URL, and anything else your app reads from the environment. -
Deploy
Hit deploy and watch the log stream. Bundle, precompile, migrate, restart — usually a couple of minutes.
What Hatchbox does for you
Hatchbox detects Rails from rails in your Gemfile and configures the deploy
itself. There's no build script to write.
Build steps it runs
- Installs the Ruby version from
.ruby-version,.tool-versions, orGemfile.lock - Installs the matching Bundler version and your gem dependencies
- Runs
assets:precompileif your app has it — skipped automatically for API-only apps - Runs
db:migrateon the cron server, so migrations happen exactly once per deploy
Processes it adds
Created on your first deploy, then kept alive and restarted on every deploy after.
bin/rails server -b 127.0.0.1 -p $PORT # web
bin/jobs # added if Solid Queue is detected
bundle exec sidekiq # added if Sidekiq is detected
Caddy reverse proxies to the web process and load balances across your web servers. Add or scale processes yourself whenever you need to.
Environment variables you set
Added in Hatchbox and written into every release.
RAILS_MASTER_KEY=<contents of config/master.key>
DATABASE_URL=postgres://user:pass@host/db_name
# If you use the Solid gems
QUEUE_DATABASE_URL=...
CACHE_DATABASE_URL=...
CABLE_DATABASE_URL=...
Rails deployment questions
Still stuck? Ask us directly — a real person who has deployed a lot of Rails apps will answer.
bin/jobs process automatically on the first deploy. For the others, set QUEUE_DATABASE_URL, CACHE_DATABASE_URL, and CABLE_DATABASE_URL and the Rails 8 defaults work without further configuration.
rails console, tail logs, inspect processes — it's your server.
Simple, predictable pricing.
We charge per server, not per app. Run one application or twenty on the same box — the bill doesn't change.
$10
- Unlimited applications
- Deploy anywhere
- Zero downtime deployments
- Custom domains & free SSL
- Databases, cron jobs & background workers
- Full SSH access to your servers
- Real, human support
- 7 day free trial
Deploy more than Rails
One server, one bill, as many apps as it can hold. Run any of these alongside your Rails app for no extra cost.
- Ruby Deploy Hanami Hanami hosting on infrastructure you control
- Ruby Deploy Bridgetown Bridgetown hosting with full server access
- Go Deploy Hugo Hugo hosting without the per-site pricing
- Ruby Deploy Jekyll Jekyll hosting with real server access
- Ruby Deploy Middleman Middleman hosting on your own infrastructure
- JavaScript Deploy Astro Astro hosting with no vendor lock-in
Ready to deploy your Rails app?
Hatchbox has run more than 2 million deploys across 24,000+ applications since 2016. Start a 7 day free trial and put yours on a server you own.