Version 6.0.3.4
OS Ubuntu 20.04
A web application framework that includes everything needed to create a database-backed web application according to the Model-View-Controller (MVC) pattern.
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.After you create a Ruby on Rails One-Click Droplet:
You can view the Rails site by visiting the Droplet’s IP address in your web browser. It takes a moment for the installation to complete, so if it doesn’t appear immediately, wait a minute and reload the page.
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 unit file for Rails 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
.
In addition to creating a Droplet from the Ruby on Rails 1-Click App via the control panel, you can also use the DigitalOcean API.
As an example, to create a 4GB Ruby on Rails Droplet in the SFO2 region, you can use the following curl command. You’ll need to either save your API access token to an environment variable or substitute it into the command below.
curl -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$TOKEN'' -d \
'{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image":"rails-20-04"}' \
"https://api.digitalocean.com/v2/droplets"
Developers supporting developers
Ask anything related to system administration, programming, devops, open source, or the DigitalOcean platform.
Partner with us to build traction for your open source project or software company