Build Status

Useful Capistrano recipes including:

  • Create MySQL database and user on server (via prompts)
  • Restart/Stop/Start Apache/HTTPD server
  • Log rotation and tailing commands
  • Deploy Omeka

Included Tasks

  • cap apache:reload
  • cap apache:restart
  • cap apache:start
  • cap apache:stop
  • cap db:create_ini
  • cap db:mysql:dump
  • cap db:mysql:fetch_dump
  • cap db:mysql:restore
  • cap db:mysql:setup
  • cap deploy
  • cap deploy:seppuku
  • cap deploy:setup_dirs
  • cap deploy:symlink
  • cap log:rotate
  • cap log:tail
  • cap omeka:db_ini
  • cap omeka:fix_archive_permissions
  • cap omeka:get_plugins
  • cap omeka:get_themes
  • cap omeka:link_archive_dir
  • cap omeka:maintenance:start
  • cap omeka:move_archive_dir
  • cap omeka:move_files_to_shared
  • cap omeka:rename_files
  • cap symlinks:make


Add this line to your application's Gemfile:

gem 'omeka-recipes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omeka-recipes


To set up the initial Capistrano deploy file, go to your application folder in the command line and enter the capify command:

$ capify .


Inside a newly created config/deploy.rb file, add this:

require 'capistrano/ext/multistage'

require 'omeka-recipes'

Now set up capistrano to do multistage

cap multistage:prepare


Plugins are defined in the plugins hash, giving a plugin name, and it's git repo. Be sure to use a read-only version.

set :plugins, {
  'Neatline' => 'git://',
  'NeatlineMaps' => 'git://',
  'CsvImport' => 'git://',
  'Scripto' => 'git://'


Themes are defined in the themes hash, passing a theme name and it's git repository.

set :themes, {
  'neatline' => 'git://',
  'emiglio' => 'git://'

Example Configuration

The following is an example of a config/deploy.rb file:

set :stages, %w(production staging)
set :default_stage, "staging"
require 'capistrano/ext/multistage'

require 'omeka-recipes'

set :application, "omeka"
set :repository,  "git://"

set :scm, :git

set :branch, 'stable-1.5'

set :plugins, {
  'Neatline' => 'git://',
  'NeatlineFeatures' => 'git://',
  'NeatlineMaps' => 'git://',
  'NeatlineTime' => 'git://',
  'SolrSearch' => 'git://',

set :themes, {
  'mcos-omeka-theme' => 'git://'

after "deploy:restart", "deploy:cleanup"

In each of the stages of your deployment (e.g. config/deploy/production.rb), you will need to add a definition to tell capistrano where to go.

server '', :app, :web, :primary => true

And your staging:

server '', :app, :db, :web, :primary => true


RVM is disabled by default, but you can enable it by setting :use_rvm, true. You may also leverage it by setting your rvm_ruby_string to an appropriate version (default is 1.9.3).

If using_rvm is true, the rvm recipe will load the RVM capistrano extensions so you don't have to worry about them during your deployments. You will need to make sure you have an .rvmrc file in the project directory, and system-wide installation on the servers.

See for more information.


See the LICENSE for more information.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request