What Is Ruby on Rails Hosting?
Ruby on Rails hosting is a server environment with the Ruby interpreter, the Bundler package manager and a Rails-compatible application server, usually Puma, installed and running behind a reverse proxy such as Nginx. It also needs a supported database such as PostgreSQL or MySQL. Because of this setup, Rails is typically hosted on a VPS, cloud server or Rails-focused platform rather than basic shared hosting.
What a Ruby on Rails hosting setup needs
- A Ruby interpreter version matching the one the app was built against, often managed with a version manager such as rbenv or RVM.
- Bundler, which installs the exact gem versions listed in the app's Gemfile.
- An application server, most commonly Puma, which runs the Rails app and handles concurrent requests.
- A reverse proxy such as Nginx in front, handling HTTPS and static assets and forwarding dynamic requests to Puma.
- A database, typically PostgreSQL or MySQL, since Rails relies heavily on its Active Record database layer.
How a request flows through a Rails stack
- A visitor's request reaches the reverse proxy on port 443.
- Static assets (compiled CSS, JavaScript, images) are served directly by the proxy when possible.
- Dynamic requests are forwarded to Puma, which runs the Rails application code.
- Rails queries the database through Active Record and renders a response.
- The response travels back through Puma and the reverse proxy to the visitor.
Basic deployment commands
bundle install
RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec puma -C config/puma.rb
In production, Rails also expects a SECRET_KEY_BASE environment variable and the assets to be precompiled with rails assets:precompile before the app starts serving traffic.
Where Rails applications are hosted
| Option | Trade-off |
|---|---|
| VPS or cloud server | Full control over Ruby version, gems and tuning; you manage everything |
| Rails-focused platform-as-a-service | Push code and the platform manages the server, at a higher price |
| Basic shared hosting | Rarely supports Rails well; avoid for production apps |
What to check before choosing a host
- Which Ruby versions are available and whether you can install a specific one with rbenv or RVM.
- Whether PostgreSQL or MySQL is included and how backups are handled.
- SSH access to run Bundler, migrations and asset precompilation.
- Enough RAM for Puma workers, since each one holds the full application in memory.
- Support for background job processing if the app uses one, such as Sidekiq, which usually needs Redis as well.
Frequently asked questions
What is Ruby on Rails hosting?
It is a hosting environment with the Ruby interpreter, Bundler and an application server such as Puma installed, plus a compatible database, so a Rails application can run in production behind a reverse proxy.
Can I run Rails on shared hosting?
Rarely in practice. Most shared hosting plans are built around PHP's per-request model and do not give the SSH access, Ruby version control or background process management that Rails apps typically need.
What is Puma used for in Rails hosting?
Puma is the application server that most modern Rails apps use to handle web requests in production. It replaces the Rails development server and can run multiple worker processes to handle concurrent traffic.
Which database does Rails hosting need?
PostgreSQL and MySQL are the most common choices for production Rails apps, since Rails ships with built-in support for both through Active Record. SQLite is fine for development but is rarely used in production.
Do I need Redis for Rails hosting?
Not always, but it is commonly used alongside Rails for caching, session storage, and as the backing store for background job tools such as Sidekiq. Check your specific application's requirements.
What does "convention over configuration" mean for hosting?
It means Rails expects files, gems and settings to live in the places the framework conventionally expects, with less manual configuration than some other frameworks. On the hosting side this still requires the correct Ruby version, gems and environment variables to be set up correctly before the app will run.
Related topics
- What Is MySQL? Databases
- What Is a VPS (Virtual Private Server)? VPS & Cloud
- What Is Cloud Hosting? Hosting Basics
- What Is Shared Hosting? Hosting Basics
- What Is an SSL Certificate? Security & SSL