Deployment Gem
Ruby Perl Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Capistrano tasks for deploying Rails applications using Ubuntu LTS 10.04 or LTS 12.04, rbenv, nginx, Unicorn and PostgreSQL or MySQL. Much of the code has been taken from Ryan Bates's Capistrano Recipes Screencast. It is highly recommended that you view the screencast for further information on Capistrano deployment recipes.


  • Capistrano
  • Fresh Ubuntu 10.04 or 12.04 install


Add these lines to your application's Gemfile:

gem 'capistrano'
gem 'unicorn'
gem 'rockin', :git => ''

And then execute:

bundle install


In your project, run the following:

capify .

Then run this generator with an optional IP address to copy over a deploy.rb that is more suited to this gem. The application name defaults to the same name as your rails app and the repository is pulled from your .git/config.

rails g rockin:install

Once the command is run, it might ask you for permission to overwrite deploy.rb. Say yes.

Before you run any Commands, its is recommended that you do not use the root account for your VPS with the scripts. You must create yourself a user within the administrative group. To do this, on the VPS, run the following command:

adduser <username> --ingroup admin

Replace with the username of your choice.

This script is able to setup both mysql and postgres databases. To change the database which you want installed, edit the following line in the config/deploy.rb file:

set :database, "mysql" # or "postgresql"

Double check the settings in the deploy.rb file. Play close attention to the values for server, domain, application and repository to ensure the are correct.

You can start package installation on Ubuntu by running the following command. This will install all the necessary packages run you application

bundle exec cap deploy:install

To set up the deployment directories for your application and setup a blank database, run the following command.

bundle exec cap deploy:setup

When you are ready to deploy your code, run the following command:

bundle exec cap deploy:cold

Advanced Options

Shown below are the default advanced settings, but they can overridden.


set(:domain) { "#{application}.com" }


set :ruby_version, "1.9.3-p125"
set :rbenv_bootstrap, "bootstrap-ubuntu-10-04" # Or bootstrap-ubuntu-12-04 for Precise


set(:unicorn_user) { user }
set(:unicorn_pid) { "#{current_path}/tmp/pids/" }
set(:unicorn_config) { "#{shared_path}/config/unicorn.rb" }
set(:unicorn_log) { "#{shared_path}/log/unicorn.log" }
set :unicorn_workers, 2

Found a bug?

If you are having a problem with Bootstrapped, first look at the FAQs above. If you still cannot resolve it, please submit an issue here.


Contributing is simple, create an issue to ensure that your change will be accepted. Then fork the repo, create a branch, make your change, and submit a pull request attaching your code to the issue.