Capistrano: Delete old releases automatically

Whenever you deploy using Capistrano, a new folder is created within the releases directory on the remote server containing the application code.

By default Capistrano 3 keeps the last 5 releases in case you need to rollback to an older release. You can overwrite this setting by using

set :keep_releases, 3
Thomas Eisenbarth