[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"seo-verification":3,"blog-deployer-rails-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"title":9,"excerpt":10,"readTime":11,"views":12,"isPinned":13,"publishedAt":14,"category":15,"categories":21,"featuredImage":23,"bgImage":24,"posterImage":25,"relatedSolution":26,"intro":28,"sections":29,"ctaTitle":72,"ctaBody":73,"ctaButton":74,"ctaUrl":75,"relatedPosts":76},49,"deployer-rails-vps","Deploying a Ruby on Rails application on a VPS","Deploy Ruby on Rails on a VPS: Puma, Nginx, PostgreSQL, Sidekiq and SSL. A complete guide for Ruby developers who want to self-host.",8,213,false,"2026-05-02T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},4,"Development","developpement","bg-warning\u002F10 text-warning","dev",[22],{"id":16,"name":17,"slug":18,"color":19,"icon":20},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fdeployer-rails-vps-poster.svg",{"categorySlug":18,"appSlug":27},"rails","Ruby on Rails remains a formidably productive framework for building complete web applications. Deploying it on your own VPS, with Puma, PostgreSQL and Sidekiq, gives you full control over background jobs, assets and scaling, without depending on a costly PaaS.",[30,34,44,47,69],{"type":31,"title":32,"body":33},"h2","Why self-host Rails on a VPS?","A production Rails application combines several processes: the Puma web server, Sidekiq workers for asynchronous jobs, PostgreSQL and Redis. Managed platforms bill each dyno or worker separately, which drives up the bill as soon as the application grows. On a VPS, all these processes coexist on a single server that you control: you set the number of Puma threads and workers, you launch as many Sidekiq workers as RAM allows, and you manage asset precompilation and caching. With Rails 7 and later, the native integration of Propshaft, Solid Queue and Solid Cache simplifies self-hosting even further. You keep a fixed cost and a fully transparent stack.",{"type":35,"title":36,"items":37},"ul","Concrete benefits of a self-hosted Rails",[38,39,40,41,42,43],"Puma and Sidekiq on the same VPS, without billing each worker separately.","Tuning the number of Puma threads and workers according to cores and RAM.","Unlimited background jobs with Sidekiq\u002FRedis or Solid Queue.","Controlled PostgreSQL: indexes, `pg_dump` backups and connection tuning.","Asset precompilation and Rails caching handled locally, at no extra cost.","Fixed and predictable cost, ideal for growing SaaS and business applications.",{"type":31,"title":45,"body":46},"Hardware and software prerequisites","Rails is more RAM-hungry than average because of the Puma and Sidekiq workers: aim for 2 GB minimum, and 4 GB as soon as you launch several workers or add Redis and Elasticsearch. Install Ruby 3.2+ via `rbenv` or `asdf`, or use a `ruby:3.3-slim` Docker image. Plan for PostgreSQL 15, Redis for Sidekiq and caching, Node.js if you use a JS bundler, and Bundler. Nginx serves as a front end for TLS and static assets. A domain pointed at the VPS is required. Set `RAILS_ENV=production` and generate a `SECRET_KEY_BASE`.",{"type":48,"title":49,"steps":50},"steps","Deploy Rails step by step",[51,54,57,60,63,66],{"title":52,"body":53},"Prepare the server and the application","Over SSH, install Ruby 3.3, PostgreSQL and Redis (or Docker). Clone the repository and configure the variables: `DATABASE_URL`, `REDIS_URL`, `RAILS_MASTER_KEY` and `SECRET_KEY_BASE`. Run `bundle install --without development test`.",{"title":55,"body":56},"Precompile the assets and migrate","Run `RAILS_ENV=production bin\u002Frails assets:precompile` then `bin\u002Frails db:migrate`. With Rails 7+, Propshaft and importmap simplify the asset pipeline without a complex Node build.",{"title":58,"body":59},"Launch Puma","Start the server via `bundle exec puma -C config\u002Fpuma.rb`, setting `WEB_CONCURRENCY` (workers) and `RAILS_MAX_THREADS` in the environment. Have Puma listen on a Unix socket for better performance with Nginx, and manage the process via systemd.",{"title":61,"body":62},"Start the Sidekiq workers","Create a systemd service that runs `bundle exec sidekiq -e production -C config\u002Fsidekiq.yml`, with automatic restart. Adjust the number of Sidekiq threads according to the job load and the available memory.",{"title":64,"body":65},"Configure Nginx and SSL","Point Nginx to the Puma socket via `upstream` and `proxy_pass`, serve `public\u002Fassets` directly with a long cache, then obtain a Let's Encrypt certificate with Certbot for `yourdomain.com`. Force HTTPS and automatic renewal.",{"title":67,"body":68},"Automate deployments","Set up a script or Kamal\u002FCapistrano that chains `git pull`, `bundle install`, `db:migrate`, `assets:precompile` and the restart of Puma and Sidekiq. Atomic deployment with symbolic links lets you roll back instantly if a problem occurs.",{"type":70,"body":71},"tip","Watch Puma's memory footprint: Ruby processes bloat over time due to memory fragmentation. Enable `jemalloc` as the allocator (via `LD_PRELOAD`) to significantly reduce the RAM consumed by workers, and configure a periodic restart of the Puma workers. On a VPS where RAM is the most limiting resource for Rails, this single tweak can save you from having to upgrade.","Launch your Rails application","The ServOrbit Cloud VPS provides a template with Ruby, PostgreSQL, Redis, Nginx and automatic SSL, ready to host your Rails application, Puma and Sidekiq.","Deploy my Rails VPS","\u002Fvps-cloud",[77,91,104],{"id":78,"slug":79,"title":80,"excerpt":81,"readTime":82,"views":83,"isPinned":13,"publishedAt":84,"category":85,"categories":86,"featuredImage":23,"bgImage":24,"posterImage":88,"relatedSolution":89},5,"deployer-laravel-vps","Deploying Laravel on a VPS: a production guide","Take Laravel to production on a VPS: PHP, workers, cache, database, reverse proxy and HTTPS configured cleanly.",7,2840,"2026-02-09T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[87],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-laravel-vps-poster.svg",{"categorySlug":20,"appSlug":90},"laravel-stack",{"id":92,"slug":93,"title":94,"excerpt":95,"readTime":11,"views":96,"isPinned":13,"publishedAt":97,"category":98,"categories":99,"featuredImage":23,"bgImage":24,"posterImage":101,"relatedSolution":102},43,"deployer-nodejs-vps","Deploy a Node.js Application on a VPS","Deploy a Node.js application to production on a VPS: PM2, Nginx reverse proxy, Let's Encrypt SSL, and automatic startup at boot.",591,"2026-05-08T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[100],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-nodejs-vps-poster.svg",{"categorySlug":18,"appSlug":103},"nodejs",{"id":105,"slug":106,"title":107,"excerpt":108,"readTime":11,"views":109,"isPinned":13,"publishedAt":110,"category":111,"categories":112,"featuredImage":23,"bgImage":24,"posterImage":114,"relatedSolution":115},44,"deployer-django-vps","Deploy a Django Application on a VPS","Deploy Django on a VPS: Gunicorn, Nginx, PostgreSQL, Docker, and SSL. A complete guide for Python developers who want to self-host.",628,"2026-05-07T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[113],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-django-vps-poster.svg",{"categorySlug":18,"appSlug":116},"django",1785628431629]