We can install Dokku, an open source PaaS, to your servers. Dokku provides the ability to run more than one container on a single server, allocating resources as needed.
For a list of your Dokku server's available commands, use
ssh -t to connect to your Dokku user at your server:
Run commands on your Dokku server using
ssh -t email@example.com and a command:
For example, to check the version of Dokku running on your server, use the
For detailed information about a command, use the
Dokku supports plugins that extend the functionality of your Dokku platform.
We manage plugin installation and can add plugins to your Dokku server by request.
We install plugins for MySQL and Let's Encrypt by default.
You can find a list of current Dokku plugins in the Dokku Community Documentation.
To configure Dokku to work with a Rails application, you must create a container for the application, create its database container, configure the application for the database, and link the database to your application.
To link your Rails application to your database, set the database scheme on your application using the
Link the database container to your application container:
Add your Dokku application container as a git remote:
In your application's
/config/database.yml, add the URL for the Dokku database container to your production environment:
Procfile and set the application server:
In your application's
Gemfile, add your application's Ruby version,
rails_12factor to your production group, and your database gem:
Dokku uses the
rails_12factor gem to send logs to stdout and serve assets in production.
git push dokku
After deploying your application, you can use a custom domain to point to your Dokku server:
Log in to your domain host and create DNS records to point to your Dokku server. For example, you can create an A record pointing to your application IP or a CNAME record pointing to abcde.example.cloud.
Using the command line, assign your application the domain:
We automatically install Dokku's Let's Encrypt plugin to allow you to add SSL certificates to secure your application.
To add SSL certification to your application:
Add a valid email address to your application's Dokku configuration:
Use the Let's Encrypt plugin to add your SSL certificate:
Let's Encrypt SSL certificates are valid for 90 days, and are due for renewal after 60 days.
To check your certificate expiry status for all applications on your Dokku server, use the
To automatically renew the SSL certificates on your Dokku server during the renewal period, use the
To revoke your application's SSL certificate, use the
Dokku provides logs to view activity on your Dokku server using the
To view a continuous stream of your application logs, use the
To back up your entire Dokku server, use the Cloud control panel to create a server backup.
Most Dokku database plugins allow you to backup your application database to an Amazon S3 account using Dokku commands. To backup your database you must first authorize the Dokku plugin to use your S3 account with your credentials before creating a backup.
:helpfunction for more information.
To backup your database to S3 using the MySQL plugin:
Use the terminal to authorize the plugin to use your S3 credentials:
Backup the application database using the
After authorizing the database plugin to backup to an S3 bucket, you can also schedule regular backups using the MySQL plugin using the
To schedule a backup of your application database:
backup-schedule command uses crontab expressions to set a schedule. For example, to schedule a backup every day at 4:30 AM: