Quick Tip: Capistrano SSH Ports

Posted by Curtis Miller Curtis Miller

If you have changed the SSH port number on your server, then you need to let Capistrano know how to connect. Luckily, it's pretty easy.

Add the following to your deployment file, replacing 8888 with your port number.


ssh_options[:port] = 8888

This will apply that port number to connections made by Capistrano. If you need to specify the port for each server (app, web, db) then tack it on to the end of their declarations.

role :app, ""
role :web, ""
role :db,  "", :primary => true

I haven't verified that one, but it supposedly works. Happy deployments!

Velocity Labs

Need web application development, maintenance for your existing app, or a third party code review?

Velocity Labs can help.

Hire us!