Client Area

Deploying Ruby on Rails on DomainIndia Hosting (cPanel Passenger, DirectAdmin, VPS)

ByDomain India Team·DomainIndia Engineering
5 min read24 Apr 20264 views
# Deploying Ruby on Rails on DomainIndia Hosting (cPanel Passenger, DirectAdmin, VPS)
TL;DR
Ruby on Rails runs well on DomainIndia — shared cPanel (with Passenger), DirectAdmin (Passenger), or VPS (any Ruby version + any app server). This guide covers Ruby version selection, gem install, database config, and going live for a production Rails 7/8 app.
## Choosing a plan
PlanRuby versionApp serverBest for
Shared cPanel3.0 / 3.2 (Passenger)Passenger (Apache)Small business sites, blogs, MVPs
Shared DirectAdmin3.0 / 3.2PassengerSame as above
VPSAny (rbenv / rvm)Puma, Unicorn, PassengerProduction apps, larger traffic, multi-worker
Rails needs persistent Ruby processes. On shared hosting our Passenger integration handles this. For heavier sites (>1,000 concurrent users, Sidekiq workers, ActionCable WebSockets), go with a VPS. ## Option A — Rails on shared cPanel with Passenger cPanel ships with Passenger built in. The "Setup Ruby App" tool gives you a point-and-click setup.
1
Log in to cPanel → search "Setup Ruby App" (under "Software")
2
Click "Create Application"
3
Click Create — cPanel builds a .htaccess + Passenger config
4
In Terminal (cPanel → Terminal):
5
Clone your Rails app:
6
Install gems (might take 5–10 min):
7
Set environment variables in cPanel Setup Ruby App → "Environment variables":
8
Run database migrations from Terminal:
9
Precompile assets:
10
Click "Restart" in Setup Ruby App to reload Passenger
Info

Use MySQL/MariaDB on shared, not PostgreSQL. Our shared plans provision MySQL by default. Rails's mysql2 gem works perfectly. If you need PostgreSQL, order a VPS.

## Option B — Rails on DirectAdmin with Passenger DirectAdmin also supports Ruby via Passenger. Pre-check: ask our support to confirm Passenger is enabled on your server.
1
Create a subdomain or domain in DirectAdmin
2
Upload/clone your Rails app to ~/domains/yourcompany.com/public_html/ — or a sibling folder like ~/rails_app with public_html symlinked
3
Create .htaccess with:
4
SSH in, install rvm/rbenv:
5
cd ~/rails_app && bundle install
6
Set ENV vars in ~/rails_app/.env (if using the dotenv gem)
7
Migrate + precompile as in Step 8–9 above
8
Touch ~/rails_app/tmp/restart.txt to reload Passenger
## Option C — Rails on VPS (recommended for production) With a VPS you get full control — any Ruby version, any database, Sidekiq workers, WebSockets, etc. Typical stack: Ruby 3.3 + Rails 8 + PostgreSQL + Redis + Puma + nginx + Let's Encrypt SSL.
1
Provision AlmaLinux 9 or Ubuntu 22.04 VPS from DomainIndia
2
Install system deps:
3
Install rbenv + Ruby:
4
Clone app, install gems, migrate, precompile (same as Option A step 5–9)
5
Create a systemd service for Puma at /etc/systemd/system/rails-puma.service:
6
Create nginx reverse proxy at /etc/nginx/conf.d/rails.conf:
7
Get SSL: sudo certbot --nginx -d yourcompany.com
8
Start services:
9
For background jobs, set up a second systemd service for Sidekiq (see our "Background Jobs & Queues" article)
## Database setup On **shared hosting**, create MySQL DB via cPanel → MySQL Databases. Rails `config/database.yml`: ```yaml production: adapter: mysql2 host: localhost database: cpanel_user_rails_prod username: cpanel_user_railsusr password: <%= ENV['DB_PASSWORD'] %> pool: 5 ``` On **VPS with PostgreSQL**: ```bash sudo -u postgres createdb rails_prod sudo -u postgres createuser deploy sudo -u postgres psql -c "ALTER USER deploy WITH ENCRYPTED PASSWORD 'secret';" sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE rails_prod TO deploy;" ``` `config/database.yml`: ```yaml production: adapter: postgresql database: rails_prod host: localhost username: deploy password: <%= ENV['DB_PASSWORD'] %> pool: 5 ``` ## Asset pipeline — propshaft + importmaps (Rails 7+) Rails 7+ ships with **propshaft** (simpler than sprockets) and **importmaps** (no Node required). On shared hosting this is gold — no webpack, no esbuild, no Node.js setup needed. ```bash bundle exec rake assets:precompile RAILS_ENV=production ``` outputs to `public/assets/` with fingerprinted filenames. Passenger + nginx serve these directly. For apps that need Node (React via esbuild, Tailwind JIT), you need the Node.js build to run somewhere — either locally before git push (commit `public/assets/` to repo) or on a VPS with Node installed. ## Common pitfalls ## FAQ
Q Which Ruby version should I pick?

Latest stable — Ruby 3.3.x in 2026. Rails 8 requires Ruby 3.1+. On shared hosting we provide 3.0, 3.2, and (on newer servers) 3.3.

Q Can I use Sidekiq on shared hosting?

No — Sidekiq needs a long-running Redis instance + worker processes. Shared plans don't allow background daemons. Upgrade to VPS.

Q Does DomainIndia support ActionCable / WebSockets?

Not reliably on shared (Passenger WebSocket support is limited). Use VPS for real-time features. Alternatively, use third-party services like Pusher or Ably.

Q How do I debug a 500 error on Passenger?

Tail ~/logs/passenger.log and ~/rails_app/log/production.log. Enable config.consider_all_requests_local = false in production, but config.log_level = :debug temporarily while troubleshooting.

Q Is there a DomainIndia promo code for Rails developers?

Annual plans include 10%+ discount built in. See our VPS plans or cPanel hosting.

Ready to deploy Rails? Our VPS plans come with root SSH and any stack you want. Explore VPS plans

Was this article helpful?

Your feedback helps us improve our documentation

Still need help? Submit a support ticket

Still need help?

Our support team can assist you directly.

Submit Ticket