• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Run Ruby Apps Using cPanel

Ryan Gray

Published on: February 13, 2020

Categories: Website Development 0

From time-to-time we’ll often get requests from customers on how to run Ruby apps on cPanel. Over the years we’ve seen a steep decline in such requests, but there are certainly still instances where it’s much needed.

Despite cPanel adding their Application Manager to run Ruby on Rails with Phusion Passenger, I’ve still found it to be a pain in the neck. The native version of Ruby that ships in Easy Apache 4 is quite dated and I was unable to successfully upgrade it (if someone knows a way feel free to share in the comments below).

We’ve also integrated our Web Hosting and Reseller Hosting packages with the CloudLinux Ruby selector, but have also run into issues running this alongside LiteSpeed.

After a lot of trial and error, I found the best way to run Ruby on a cPanel server is to install Ruby on Rails directly as well as Phusion Passenger.

Note: The following tutorial is specifically for CentOS 7 servers running cPanel/WHM. It would prob be best to run Ruby on a standard CentOS 7 without cPanel, which you can do with our FlexVPS, but sometimes that’s not ideal for customers who need a control panel.

Requirements

  • An active VPS or Cloud Dedicated server running cPanel/WHM
  • At least 2GB of RAM
  • Full root access (available on all VPS and Cloud Dedicated)
  • Apache 2.4 installed with Easy Apache 4
    • Confirm with the following command:
[root@host2 ~]# httpd -v
Server version: Apache/2.4.41 (cPanel)
Server built:   Jan 28 2020 19:40:24

Install Ruby

To get started, you want to install the latest version of Ruby.

For me, this was the root of my initial problem since the version of Ruby in the EA4 was quite dated and using yum also installs an old version shipped with CentOS.

As of this writing, the latest stable version is Ruby 2.7.0, but you can check their website to make sure.

To install, you’ll want to get the Ruby Version Manager (RVM). Start with the following commands via ssh as your root user:

[root@host2 ~]# gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3  
[root@host2 ~]# curl -L get.rvm.io | bash -s stable  
[root@host2 ~]# source /etc/profile.d/rvm.sh  
[root@host2 ~]# rvm requirements

Make sure each of these completes successfully and resolve any errors before proceeding.

You can then install the latest version of Ruby:

[root@host2 ~]# rvm install 2.7.0

You’ll then want to set that as default to avoid conflicts when you start deploying applications:

[root@host2 ~]# rvm use 2.7.0 --default

Finally, install Rails:

[root@host2 ~]# gem install rails

Install Phusion Passenger

Phusion Passenger is a feature-rich web app server that integrates very nicely with Apache (and Nginx) which will allows your Ruby apps to run with ease.

Install with the following commands:

[root@host2 ~]# gem install passenger
[root@host2 ~]# yum -y install curl-devel sqlite-devel
[root@host2 ~]# passenger-install-apache2-module

Once again, if you get any errors running these, you’ll want to resolve them. This specifically is where RAM comes into play, to be safe, I always like to have at least 4GB just to be on the safe side.

When you complete the final command (installing the Passenger Apache Module) it’ll provide you a line of code you’ll need to copy for the following step. It’ll look something like this:

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.3.8/gems/passenger-6.0.4/buildout/apache2/mod_passenger.so
< IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-2.3.8/gems/passenger-6.0.4
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.3.8/wrappers/ruby
< /IfModule>

Make sure to copy the output from your terminal and not my example above as I’ve had to modify it a bit to get it to display in this post :).

Include Passenger Into Apache Config

In order for Apache to serve your Ruby apps, you’ll need to configure the location of Passenger/Ruby.

cPanel servers require you to place these in include files so they’re not overwritten during their EA updates.

Simply create a new file with the output received above:

[root@host2 ~]# nano /usr/local/apache/conf/passenger.conf

Save the file, then include it in /usr/local/apache/conf/includes/pre_main_global.conf

Include "/usr/local/apache/conf/passenger.conf"

You can also use the Apache Configuration editor in Web Host Manager if you prefer:

You then have to rebuild your Apache configuration:

[root@host2 ~]# /scripts/rebuildhttpdconf

And then restart Apache:

[root@host2 ~]# service httpd restart

If you followed all of these steps correctly, you are now all set to go run Ruby apps on cPanel!

Now as a disclaimer, this method is not supported by cPanel, hence we’re unable to support it at NameHero. However if you’re like me and are ready to pull your hair out trying to run the latest version of Ruby on a cPanel server, I found this was the best way to do it, and it actually works.

Feel free to let me know if you have any questions, I’ll try my best to help!

Ryan Gray

Ryan Gray is the founder and CEO of NameHero, one of the fastest growing independent web hosts in the United States. Ryan has been working online since 1998 and has over two-decades experience in Internet Entrepreneurship.

Related Posts

How to Create a SaaS Landing Page

In this post, we’ll break down the components of a high-converting SaaS landing page. We’ll then show you how to create one for your product.

How to Start an Online Store Without Inventory

Let's discuss the benefits of launching a store without inventory and look at some options. We’ll then show you how to sell products online.

How to Create A Lead Capture Page That Converts

In this post, we’ll show you what makes a great lead capture page and how you can easily build your own.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA