This HowTo explain how to deploy web applications through capistrano with git repo hosted on

This was tested with EC2 instance and you need to edit your ssh config so that root could login with the password.

Add you public key to the server for authentication:

cat ~/.ssh/ | ssh ServerName/IP “cat >> .ssh/authorized_keys”

Install the required package

apt-get install capistrano

Create a deployment config file

cd /var/www/deploy

capify .

vi /var/www/deploy/config/deploy.rb

set :application, “testapp”
server “”, :web ,:primary => true
set :deploy_to, “/var/www/#{application}”
set :use_sudo, false
ssh_options[:forward_agent] = true
set :scm, :git
set :repository, “”
set :branch, “master”
role :app, ‘ROLE’