---
title: "Deploy to Capistrano"
description: "Use this example CircleCI configuration to run Capistrano deployment commands from a job once your project is set up to use Capistrano."
platform: "Cloud, Server"
doc_version: "Server"
last_updated: "2026-10-06"
---

> For current CircleCI product defaults, deprecated patterns, and Cloud/Server differences, see [AGENTS.md](https://circleci.com/docs/AGENTS.md).
>
> For the complete documentation index and site structure, see [llms.txt](https://circleci.com/docs/llms.txt).

# Deploy to Capistrano

This how-to guide covers an example CircleCI configuration to deploy to Capistrano.

## Introduction

This page provides a configuration example for deployment to Capistrano. Once your project is set up to use Capistrano, you can run [deployment commands](https://github.com/capistrano/capistrano/blob/master/README.md#command-line-usage) within your CircleCI job as required.

## Configuration example

```yaml
version: 2.1

workflows:
  build-deploy:
    jobs:
      - build-job
      - deploy-job:
          requires:
            - build-job # Only run deploy job once build job has completed
          filters: pipeline.git.branch == "main" # only run the deploy-job job on the main branch

jobs:
  #  build and test jobs go here - not included for brevity
  deploy-job:
    docker:
      - image: <docker-image-name-tag>
    working_directory: ~/repo
    steps:
      - checkout
      - run:
          name: Bundle Install
          command: bundle check || bundle install
      - run:
          name: Deploy if tests pass and branch is Main
          command: bundle exec cap production deploy
```