Client Area

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

ByDomain India Team·DomainIndia Engineering
6 min readPublished 22 Apr 2026Updated 23 Jun 2026179 views

In this article

  • 1Choosing a plan
  • 2Option A — Rails on shared cPanel with Passenger
  • 3Option B — Rails on DirectAdmin with Passenger
  • 4Option C — Rails on VPS (recommended for production)
  • 5Database setup

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"

- Ruby version: 3.2.x (recommended for Rails 7.x+)

- Application mode: Production

- Application root: rails_app (the folder under your home directory)

- Application URL: your domain or subdomain

  1. Click Create — cPanel builds a .htaccess + Passenger config
  2. In Terminal (cPanel → Terminal):

```bash

source /home/$USER/rubyvenv/rails_app/3.2/bin/activate

cd ~/rails_app

```

  1. Clone your Rails app:

```bash

git clone https://github.com/yourcompany/your-app.git .

```

  1. Install gems (might take 5–10 min):

```bash

bundle config set --local deployment 'true'

bundle config set --local without 'development test'

bundle install

```

  1. Set environment variables in cPanel Setup Ruby App → "Environment variables":

- RAILS_ENV=production

- RAILS_MASTER_KEY=<from config/master.key>

- DATABASE_URL=mysql2://user:pass@localhost/db_name

  1. Run database migrations from Terminal:

```bash

bundle exec rake db:migrate RAILS_ENV=production

```

  1. Precompile assets:

```bash

bundle exec rake assets:precompile RAILS_ENV=production

```

  1. 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:

```apache

PassengerAppRoot /home/$USER/rails_app

PassengerRuby /home/$USER/.rvm/wrappers/ruby-3.2.0/ruby

PassengerPython /usr/bin/python3

```

  1. SSH in, install rvm/rbenv:

```bash

curl -sSL https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm

rvm install 3.2.0

```

  1. cd ~/rails_app && bundle install
  2. Set ENV vars in ~/rails_app/.env (if using the dotenv gem)
  3. Migrate + precompile as in Step 8–9 above
  4. Touch ~/rails_app/tmp/restart.txt to reload Passenger

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:

```bash

sudo dnf install -y git postgresql postgresql-server redis nginx certbot

# or on Ubuntu:

sudo apt install -y git postgresql postgresql-contrib redis nginx certbot

```

  1. Install rbenv + Ruby:

```bash

git clone https://github.com/rbenv/rbenv.git ~/.rbenv

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

~/.rbenv/bin/rbenv install 3.3.0

~/.rbenv/bin/rbenv global 3.3.0

```

  1. Clone app, install gems, migrate, precompile (same as Option A step 5–9)
  2. Create a systemd service for Puma at /etc/systemd/system/rails-puma.service:

```ini

[Unit]

Description=Puma Rails server

After=network.target

[Service]

Type=simple

User=deploy

WorkingDirectory=/home/deploy/rails_app

ExecStart=/home/deploy/.rbenv/shims/bundle exec puma -C config/puma.rb

Restart=on-failure

Environment=RAILS_ENV=production

[Install]

WantedBy=multi-user.target

```

  1. Create nginx reverse proxy at /etc/nginx/conf.d/rails.conf:

```nginx

upstream puma { server 127.0.0.1:3000; }

server {

listen 80;

server_name yourcompany.com;

root /home/deploy/rails_app/public;

try_files $uri @puma;

location @puma {

proxy_pass http://puma;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-Proto $scheme;

}

}

```

  1. Get SSL: sudo certbot --nginx -d yourcompany.com
  2. Start services:

```bash

sudo systemctl enable --now rails-puma nginx

```

  1. 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