Simple rsync based deployment.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Deploy is an rsync deployment tool built using Ruby
Essentially acts as a wrapper for the rsync utility, providing a simple YAML based configuration file.


To install just run:

gem install rsync-deploy

Once you've installed the gem, just navigate to your project directory and run:

deploy install

This will create a deploy.yml file that controls how the deployment should take place.

Fill in your server details. For example:

    host: ""
    user: "user"
    sync: true
        local: "deploy/"
        remote: "www/"
        - ".DS_Store"
        - "resources/"

Once your deploy.yml is set up, simply deploy by running:



deploy install

Will create an template deploy.yml file in the current directory.

deploy [env...]

Will deploy to the environment(s) listed in the command. This can be used to deploy to a single server, like this:

deploy production

Or to multiple servers, like this:

deploy dev staging production

deploy download [env...]

Will download from the environment(s) listed. This works in reverse, so files from path.remote will go into path.local. This will never delete files that aren't on the server, but will likely overwrite your local copies, so be careful.

This command is also aliased as down and d, so it can be run like:

deploy down staging

deploy list

Will list all configured environments.

deploy config NAME

Will change the name of deployment configuration files. By default they are named deploy.yml, but this can be changed to names such as .deploy which makes them hidden files. Keep in mind that this is a global setting and will be applied to all deployments.

deploy help

Will output a list of all commands.


Configuration options are specified in a YAML file called deploy.yml created by running deploy install in your project directory.


  host: ""
  user: "username"
  sync: true
  verbose: false
    local: "/"
    remote: "www/
    - ".DS_Store"
    - "resources/"
    - "deploy.yml"

Below is a list of all available configuration options.


  • Type: String
  • Default: none
  • Required: Yes

The server that the files should be deployed to.


  • Type: Number
  • Default: 22
  • Required: Yes

The port that the connection should happen over


  • Type: String
  • Default: none

The username to login to the server. If no username is set, your computer account username will be used.


  • Type: String
  • Default: none

The path to an alternative SSH key. This only needs to be set if your key isn't one of the following:



  • Type: Boolean
  • Default: true

Whether or not to delete files on the server that aren't present locally.


  • Type: Boolean
  • Default: false

Whether or not to run the uploads verbosely.


  • Type: String
  • Default: none

The local folder that you want to upload to the server. If you don't set anything, the entire folder of your project will be uploaded.


  • Type: String
  • Default: none

The remote folder where your files will be uploaded. If you don't set anything, your files will be uploaded to the user root of your server. Setting this is highly recommended!


  • Type: Array
  • Default: none

Exclude files that you don't want on your server. You can target files, directories and file types.

Individual files: exclude: ["", "package.json", "path/to/file.js"]
Directories: exclude: ["resources/", "test/", "path/to/dir/"]
File types: exclude: ["*.yml", "*.json", "path/to/*.txt"]

Deploying to multiple servers/locations

You can create as many different deploy locations as you'd like by adding them to the deploy.yml file. For example:

# Development server
    host: ""
    user: "staging-username"
        local: "build/"
        remote: "www/"

# Production server
    host: ""
    user: "prod-username"
        local: "build/"
        remote: "www/"

You can deploy them by setting the environment(s) that you want to upload to:

deploy staging production

If you don't specify an environment, it's assumed that the first environment in deploy.yml should be used. So, with the above configuration, running deploy would upload to staging by default.


To enable tab-completion based for commands and the current directory's environments, put in your ~/.bash_profile the following code:

# Add tab completion for `deploy` configurations in current directory
  local cur=${COMP_WORDS[COMP_CWORD]}
  local file=$(cat $(ruby -e "puts Gem::Specification.find_by_name('rsync-deploy').gem_dir + '/lib/config.yml'") | awk '{print $2}')
  if [ -f $file ]; then
    ENVS=$(ls $PWD | grep ":$" $file | sed '/^  /d' | tr -d ':')
  COMPREPLY=($(compgen -W "${ENVS} install config list help version" -- $cur))
complete -o "default" -F _dply deploy


Deploy is almost identical to DPLOY, which was in turn inspired by dandelion. However, Deploy doesn't require that you use git (or any version control for that matter). Separating deployments and version control helps avoid littering your commit history with messages like bug fix and dang, forgot to adjust the config and another typo and so on.


To uninstall Deploy, just run:

gem uninstall rsync-deploy