Disclosure: we may earn a commission or referral reward from CloudCone, Contabo, DigitalOcean (account credit, not cash), Hostwinds, InterServer, RackNerd, VPSDime and Vultr if you sign up through our links. It does not change the price you pay. Every other provider pays us nothing. Prices in this guide are as of the date shown and may have changed; see the comparison pages for the latest checked prices.
Guides · FOR
Best hosting for a Ruby on Rails app in 2026: the honest picks
Some prices quoted in this guide are out of date. It is being rebuilt on our price index; for current prices use the comparison pages, which show when each price was checked.
Rails is one of the more resource-hungry frameworks to host — Puma workers each hold their own copy of the Rails codebase in memory, so RAM is what runs out first at scale. This guide names the picks that actually work: from an indie side project on a $5 VPS to a production Rails app with real users.
Prices as of 2026-09-22.
What Rails actually needs
- RAM: 4 GB minimum for real production, 8+ GB comfortable. Each Puma worker uses 300-600 MB of RAM. 5 workers = ~2 GB before you even have a request in flight. Add Postgres, Redis, Sidekiq worker.
- vCPU: 2 for small, 4 for scaled. Puma workers scale with cores.
- Ruby 3.2+, ideally 3.3. Real performance improvements over 3.0.
- Postgres. Rails and Postgres are extremely well integrated; use it over MySQL.
- Redis for cache, sessions, and Sidekiq queues.
- A background job runner. Sidekiq is the standard; GoodJob (Postgres-backed) if you want to avoid Redis.
Recommended picks
Small production Rails ($5-10/mo)
Hetzner CX22 at $4.60/mo — 2 vCPU, 4 GB RAM. Install Ruby via rbenv, Puma under systemd, Nginx as reverse proxy, Postgres and Redis on the same box.
Tight but workable at low traffic. Move up to Hetzner CX32 ($7.60/mo) as soon as your usage justifies it.
Medium production Rails ($20-30/mo)
DigitalOcean Basic 4 GB at $24/mo — 2 vCPU, 4 GB RAM, 80 GB storage.
Add DO Managed Postgres 1 GB at $15/mo when your DB feels operational.
Scaled Rails ($50+/mo)
DigitalOcean Basic 8 GB at $48/mo — 4 vCPU, 8 GB RAM.
Run 5-6 Puma workers. Externalize Postgres and Redis to managed services.
PaaS alternative
Fly.io Machines — Docker-based, autoscales, includes managed Postgres. See Fly.io vs VPS.
Heroku — the original Rails PaaS. Reasonable for very small apps; expensive at scale.
The Puma systemd service
/etc/systemd/system/puma.service:
```
[Unit]
Description=Puma web server for Rails
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/var/www/myapp
Environment=RAILS_ENV=production
Environment=PATH=/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:/usr/local/bin:/usr/bin:/bin
ExecStart=/home/deploy/.rbenv/shims/bundle exec puma -e production
Restart=always
[Install]
WantedBy=multi-user.target
```
systemctl enable --now puma.
The Sidekiq systemd service
/etc/systemd/system/sidekiq.service:
```
[Unit]
Description=Sidekiq background worker
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/var/www/myapp
Environment=RAILS_ENV=production
Environment=PATH=/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:/usr/local/bin:/usr/bin:/bin
ExecStart=/home/deploy/.rbenv/shims/bundle exec sidekiq
Restart=always
[Install]
WantedBy=multi-user.target
```
Nginx reverse proxy
```nginx
upstream puma {
server 127.0.0.1:3000;
}
server {
server_name yourdomain.com;
location /assets/ {
alias /var/www/myapp/public/assets/;
expires 1y;
add_header Cache-Control "public, immutable";
}
location / {
proxy_pass http://puma;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
certbot --nginx -d yourdomain.com for SSL.
Deployment tools
Capistrano — the classic Rails deploy tool. Still works. Zero-downtime with --rolling.
Kamal — Rails 8's official deploy tool. Docker-based, git-push-style deploys.
Manual with a bash script — for a single-box app, a simple deploy script (git pull, bundle install, precompile assets, migrate, restart puma) is fine.
Memory tuning for Puma
Rails apps that use jemalloc see 20-30% reduction in RAM usage per worker:
```bash
apt install libjemalloc2
```
In your Puma systemd service:
```
Environment=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
```
On a 4 GB VPS, this is often the difference between running comfortably and hitting the OOM killer.
Common Rails hosting mistakes
- Running one Puma worker instead of clustering. Under-utilises multi-core VPS.
- Skipping Redis for Sidekiq. WP-Cron-style in-request background work slows every request.
- Not using
bootsnap. Cold-start is slow without it. - Precompiled assets served by Puma. Serve via Nginx directly.
- Using SQLite in production. Fine for hobby projects, not for real production.
Which one you should actually pick
- Learning / building a small Rails app → Hetzner CX22 at $4.60/mo.
- Live app, real users → DigitalOcean Basic 4 GB at $24/mo + Managed Postgres.
- Scaled Rails with heavy background work → DigitalOcean Basic 8 GB at $48/mo + Managed Postgres + Managed Redis.
- You want git-push deploys with no ops → Fly.io or Kamal on any VPS.
- You want the cheapest possible → Hetzner + self-manage.
Related guides
- Best hosting for a Node.js API — the JS parallel.
- Best hosting for a Django app — the Python parallel.
- Best hosting for a Laravel app — the PHP parallel.
- Best hosting for a small SaaS MVP — MVP-scale hosting.
- Vercel vs VPS 2026 — a PaaS comparison Rails developers ask about.
Prices as of 2026-09-22.