HF PanelDocsv1.0.0

Ruby apps

Run a Rails, Sinatra, Hanami or any Rack app on one of your domains, served by Puma with automatic restart.

The Ruby apps screen runs a Rails, Sinatra, Hanami or any Rack app on one of your domains. The app is served by Puma as your account's own service on a local port, and the domain forwards every visit to it. It starts automatically and restarts if it crashes.

Where: Control Panel › Software › Ruby apps

Ruby apps screen

Note: if the screen says Ruby isn't installed on this server yet, ask your hosting provider to install ruby-full and ruby-bundler. You also need at least one domain.

Create a Ruby app

  1. Under New Ruby app, enter the App name, for example blog.
  2. Choose the Domain. All visits to this domain go to the app.
  3. Enter the App folder in your home, for example apps/blog, for your code and Gemfile (a minimal one is created if missing).
  4. Enter the Rackup file. Rails and Sinatra apps have a config.ru, the default.
  5. Set the number of Workers (0 = a single process).
  6. Add Environment variables if your app needs them.
  7. Click Create app.
  8. Put your code in the app folder, then choose Set up / bundle install from the app's menu.

Set up / bundle install installs the gems in your Gemfile and (re)starts the app.

Field Rules
App name lowercase letters, numbers, - and _, up to 30 characters; cannot be changed later
Domain a main domain, not a parked domain. A domain can run only one app (Ruby, Python or Node.js).
App folder a folder inside your home
Rackup file a path ending in .ru
Workers 0–8 (default 2)
Environment variables one NAME=value per line, upper-case names; no quotes or backslashes in values (up to 500 characters); up to 30 variables

Note: PORT and HOST are set for you; RACK_ENV and RAILS_ENV are production; Puma serves the app on PORT. BUNDLE_PATH and PATH are set for you too.

Manage apps

The apps table shows each app's workers, Domain, Folder · rackup and Status (Running, Starting or stopped).

Button What it does
Restart / Stop / Start controls the app's service
Set up / bundle install installs the gems again and (re)starts the app
Settings opens the app's settings; click Save & restart to apply changes
Log file opens the logs folder in the File Manager
Remove app removes the app after you confirm

If the app does not come up, the message points to its log, ~/logs/ruby-<app name>.log. Removing an app keeps its files; the domain serves its website folder again.