Ruby on Rails One-Click Application

DigitalOcean’s Ruby on Rails One-Click Application provides a convenient way to get your Rails application running on an Ubuntu server. With Nginx, Puma, and Postgres all pre-installed, the One-Click provides a solid foundation for hosting your app.

Components

Droplets created using this One-Click have the following software components:

Component Version
Linux Ubuntu 18.04.1
Ruby Latest from rvm.io
Rails Latest gem package
Puma Latest gem package
Nginx Latest from APT
Node.js Latest from APT
Postgres Latest from APT
Postfix Latest from APT
Certbot Latest from APT

In addition to the package installation, the One-Click also:

  • Enables the UFW firewall to allow only SSH (port 22, rate limited), HTTP (port 80), and HTTPS (port 443) access.

  • Creates a rails system user which deploys the application.

  • Creates a rails database user which the application uses to connect to PostgreSQL.

  • Configures Ruby to use vendored bundles and installs all Gems and processes locally to the rails user.

  • Configures Nginx to forward requests to a local UNIX socket, acting as a reverse proxy for the application server.

Quickstart

After you create a Ruby on Rails One-Click Droplet:

  • You can view the Rails site immediately by visiting the Droplet’s IP address in your browser.

  • The message of the day (MOTD) will show the system and database user passwords, which are also saved in /root/.digitalocean.passwords.

  • The MOTD will also show you SFTP credentials that you can use to upload files using software like FileZilla, WinSCP, or rsync.

  • The Puma server’s Systemd unit file is /etc/systemd/system/rails/service.

To manage the Rails site, log into the Droplet via SSH as root using either the password emailed to you or with an SSH key, if you added one during creation.

The application server, Puma, is managed by Systemd, so you can use the systemctl command to start, stop, restart, and check the status of Puma. For example, systemctl restart rails.service will restart it.

Because Ruby will be configured to use vendored bundles, use the rails user to interact with the default project via sudo -i -u rails.

Next Steps

See Getting Started with Rails for an overview of working with Rails or jump to the Say Hello, Rails! directions to get started to deploy your app. Note that your site will be located at its IP address or domain name rather than http://localhost:8000.