Ruby Shared Hosting

Why shared hosting?

Shared hosting has a lot of upsides for Ruby developers. Since you'll be sharing a physical machine, your expenses will be much less than if you were to rent out a dedicated server. It will also require less maintenance and setup time because the software stack required to host Ruby applications will already be installed by your shared hosting service. They also take the time to maintain — meaning you won't have to deal with security patches and operating system upgrades. With a virtual private server or dedicated hosting, you'll lose a significant amount of time dealing with patches and updates.

Why Dreamhost?

Dreamhost is one of the most popular shared hosting services. They offer extraordinary features like unlimited storage and bandwidth, which tends to attract developers.

Dreamhost supports Ruby applications via Apache and Passenger. This includes Ruby on Rails, Sinatra, Ramaze, and any other Rack-based framework. Rack is the interface between Ruby libraries and servers. It's widely used by web frameworks, so you'll have a lot of options if you go with Dreamhost.

Unlimited storage is extremely useful for your website, but also useful if you want to use Dreamhost to hold your private Git repositories. Git comes pre-installed on most of Dreamhost's services, which means you can have an unlimited number of private Git repositories on your account.

Configuring Rack-based applications

Ruby applications run on shared hosting accounts via Rack. Applications can be configured using the file in the application's root directory. You'll have to consult your framework's documentation on how to configure using Rack and As an example, for Sinatra:

require File.expand_path '../myapp.rb', __FILE__
            run Sinatra::Application

This will run any Sinatra application in classic mode.

Running Rack-based applications on Dreamhost

First, go to the control panel. From Domains, go to Manage Domains, then edit. Be sure to enable Ruby on Rails Passenger (aka mod_rails). Add your project directory to the web directory box. Save your changes.

Now from your project directory, create two directories: tmp and public. The public directory will use Apache to serve assets like JavaScript files or CSS files.

Add a file. Consult your framework's documentation on how to run the application via Rack.

Looking for more hosts?

Although Dreamhost is one of the most popular shared hosting services, there are several more available for hosting Rack based applications. For a full list, see Ruby on Rails Hosts.

Dreamhost supports Rack-based applications like Sinatra or Ruby on Rails.

Check out Dreamhost