Skip to content
Automate your WordPress deploys with Capistrano and Git
PHP Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Please note: This repository is no longer actively maintained and the LAMP setup section does not work. Feel free to submit pull requests if you want to contribute and keep it up to date.


This repository is intended for use as a template for your WordPress projects. By following these instructions you can quickly and easily deploy WordPress using Git and Capistrano.


For this example, we’ll assume your GitHub username is johndoe and you wanted to setup a WordPress blog at

  • Fork this repo
  • Make your project private, and rename it your project name. Say, johndoe_blog, for example.
  • Clone your fresh repo into the wp-content folder of your local wordpress install:
    rm -rf wp-content
    git clone wp-content
    cd wp-content
  • Adjust the settings in Capfile

<pre> #the domain name for the server you'll be running wordpress on set :domain, ""

#the name of this wordpress project set :application, “johndoe_blog” #your repo set :repository, “”

Once all that’s done, commit and push it back to GitHub. Then hack on your WordPress theme and drop your plugins as normal, committing and pushing as you go.

Setting up a LAMP Stack on a CentOS Server

Once you’re ready to rock, pick up a server from Linode or something.

  • cap setup:server
    • You’ll first be prompted for your root password
    • A bunch of stuff will get installed. Go get a beer.
    • After lots of installing of lots of stuff, you’ll be asked for a couple things:
      • A new password for your root user
      • A password for the newly created wordpress user
      • A password for the root account of MySQL
  • Once, that’s done, an SSH key will be generated for you. Add this key to your account GitHub project (see Deploy keys).

To setup WordPress on your server

  • cap setup:wordpress
  • You’ll first be prompted for your wordpress user’s password.
  • You’ll then be prompted for a database name, username, and password for this WordPress site. This database will be created and wp-config.php setup for you. You’ll be prompted for the password for the root account of MySQL before to run this command.

To deploy your WordPress site to your server

  • cap deploy

That’s it, seriously. Hit the server URL you setup in your Capfile, and run through the WordPress install process! If you update your themes / plugins, just commit and push them to GitHub, then run cap deploy again!

You can’t perform that action at this time.