Guides · FOR

Best hosting for a Rails app in 2026: picks and Puma setup

We are paid if you buy through an 'Order' link. 'Visit' links pay us nothing.

Prices in this guide, checked 28 Nov 2026

  1. Webdock VPS Essential1 vCPU, 2 GB, 15 GB NVMe

    $2.36/mo before tax · billed €2.15 (euro rate of 27 Nov 2026)checked 28 Nov 2026

  2. DigitalOcean Basic 512MB1 vCPU, 0.5 GB, 10 GB SSD

    $4/mo before taxchecked 28 Nov 2026

  3. Hetzner CPX021 vCPU, 1 GB, 20 GB NVMe

    $8.09/mo before tax · $7.49 server + $0.60 IPv4 · Germany; $6.59 in Helsinkichecked 28 Nov 2026

How we pick: the plans this guide names, then the providers it names, then the cheapest we would pick, in that order, each one you can order today; cheapest first within each of the three. Figures in the text below were written 22 Sep 2026. Prices in this table were checked 28 Nov 2026 on each provider's own site. How we check prices

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.

Figures in this text were written 22 Sep 2026.

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

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:

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-utilizes 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

Figures in this text were written 22 Sep 2026.