[{"data":1,"prerenderedAt":142},["ShallowReactive",2],{"seo-verification":3,"blog-deploying-a-ruby-on-rails-application-on-a-vps-ma-en":6,"promo-bar-likely":141},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-deploying-a-ruby-on-rails-application-on-a-vps-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":27,"featuredImage":29,"bgImage":30,"posterImage":31,"relatedSolution":32,"intro":35,"sections":36,"ctaTitle":82,"ctaBody":83,"ctaButton":84,"ctaUrl":85,"relatedPosts":86},49,"deploying-a-ruby-on-rails-application-on-a-vps",{"fr":12,"en":10,"ar":13,"es":14},"deployer-rails-vps","نشر-تطبيق-ruby-on-rails-على-خادم-vps","desplegar-ruby-on-rails-en-un-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.",4,0,false,"2026-05-02T00:00:00+00:00","2026-11-04T16:30:25+00:00",{"id":17,"name":23,"slug":24,"color":25,"icon":26},"Development","developpement","bg-warning\u002F10 text-warning","dev",[28],{"id":17,"name":23,"slug":24,"color":25,"icon":26},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fdeployer-rails-vps-poster.svg",{"categorySlug":33,"appSlug":34},"development","rails-stack","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.",[37,41,51,54,76,79],{"type":38,"title":39,"body":40},"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":42,"title":43,"items":44},"ul","Concrete benefits of a self-hosted Rails",[45,46,47,48,49,50],"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":38,"title":52,"body":53},"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":55,"title":56,"steps":57},"steps","Deploy Rails step by step",[58,61,64,67,70,73],{"title":59,"body":60},"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":62,"body":63},"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":65,"body":66},"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":68,"body":69},"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 available memory.",{"title":71,"body":72},"Configure Nginx and SSL","Point Nginx at the Puma socket via `upstream` and `proxy_pass`, serve `public\u002Fassets` directly with a long cache, then get a Let's Encrypt certificate with Certbot for `yourdomain.com`. Force HTTPS and automatic renewal.",{"title":74,"body":75},"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 in case of a problem.",{"type":77,"body":78},"tip","Monitor Puma's memory footprint: Ruby processes swell over time due to memory fragmentation. Enable `jemalloc` as the allocator (via `LD_PRELOAD`) to significantly reduce RAM consumed by workers, and configure a periodic restart of Puma workers. On a VPS where RAM is the most limiting resource for Rails, this tuning alone can avoid the need to upgrade.",{"type":38,"title":80,"body":81},"Deploy Rails in one click from the Marketplace","The ServOrbit Marketplace offers a **Rails Stack** template that automatically configures Ruby 3.2, Puma, Nginx, PostgreSQL and Redis on your Ubuntu 24.04 VPS in minutes. Choose your VPS, select the template, and get a production environment ready to host your Rails application — no system command-line required. The provisioning installs the complete toolchain; you just need to clone your repository, run `bundle install`, `db:migrate` and `assets:precompile`, then start Puma.","Your Rails environment ready in minutes","The Rails Stack template automatically configures Ruby 3.2, Puma, Nginx, PostgreSQL and Redis — ready to host your Ruby on Rails application in production.","Deploy my Rails Stack","\u002Fapplications\u002Fdevelopment\u002Frails-stack",[87,105,123],{"id":88,"slug":89,"slugs":90,"title":94,"excerpt":95,"readTime":17,"views":96,"isPinned":19,"noindex":19,"publishedAt":97,"updatedAt":98,"category":99,"categories":100,"featuredImage":29,"bgImage":30,"posterImage":102,"relatedSolution":103},5,"deploying-laravel-on-a-vps-a-production-guide",{"fr":91,"en":89,"ar":92,"es":93},"deployer-laravel-vps","نشر-laravel-على-خادم-vps-دليل-الإنتاج","desplegar-laravel-en-un-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.",1,"2026-02-09T00:00:00+00:00","2026-09-07T11:26:10+00:00",{"id":17,"name":23,"slug":24,"color":25,"icon":26},[101],{"id":17,"name":23,"slug":24,"color":25,"icon":26},"\u002Fblog\u002Fcovers\u002Fdeployer-laravel-vps-poster.svg",{"categorySlug":26,"appSlug":104},"laravel-stack",{"id":106,"slug":107,"slugs":108,"title":112,"excerpt":113,"readTime":114,"views":96,"isPinned":19,"noindex":19,"publishedAt":115,"updatedAt":116,"category":117,"categories":118,"featuredImage":29,"bgImage":30,"posterImage":120,"relatedSolution":121},43,"deploy-a-nodejs-application-on-a-vps",{"fr":109,"en":107,"ar":110,"es":111},"deployer-nodejs-vps","نشر-تطبيق-nodejs-على-vps","desplegar-una-aplicacion-nodejs-en-un-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.",8,"2026-05-08T00:00:00+00:00","2026-11-08T01:13:12+00:00",{"id":17,"name":23,"slug":24,"color":25,"icon":26},[119],{"id":17,"name":23,"slug":24,"color":25,"icon":26},"\u002Fblog\u002Fcovers\u002Fdeployer-nodejs-vps-poster.svg",{"categorySlug":33,"appSlug":122},"nodejs-stack",{"id":124,"slug":125,"slugs":126,"title":130,"excerpt":131,"readTime":132,"views":133,"isPinned":19,"noindex":19,"publishedAt":134,"updatedAt":21,"category":135,"categories":136,"featuredImage":29,"bgImage":30,"posterImage":138,"relatedSolution":139},44,"deploy-a-django-application-on-a-vps",{"fr":127,"en":125,"ar":128,"es":129},"deployer-django-vps","نشر-تطبيق-django-على-vps","desplegar-una-aplicacion-django-en-un-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.",3,7,"2026-05-07T00:00:00+00:00",{"id":17,"name":23,"slug":24,"color":25,"icon":26},[137],{"id":17,"name":23,"slug":24,"color":25,"icon":26},"\u002Fblog\u002Fcovers\u002Fdeployer-django-vps-poster.svg",{"categorySlug":33,"appSlug":140},"django",true,1794270389144]