Kamal vs Capistrano

Kamal and Capistrano are both open source deployment tools to run web applications on multiple servers. Capistrano gives you a Ruby DSL to run remote commands while Kamal handles deployments using Docker and Traefik. Here's what they have in common and where they differ.

What's Capistrano

Capistrano is a simple deployment tool from before Linux containers became really popular. At it's core Capistrano is a Ruby library and DSL that let's you provision servers and deploy web applications on them. It doesn't use Docker, but runs pre-defined SSH commands. Everything is basically an SSH command run as a Ruby's Rake task.

What's Kamal

Kamal is a simple deployment tool inspired by Capistrano for the container era. At it's core Kamal is a way to build and run your application using Docker containers. Apart from Docker, it also utilizes Traefik for providing zero-downtime deployments. It doesn't provision servers, but can automatically preinstall Docker. Kamal is made and used by 37signals, authors of Basecamp and Hey.

Similarities

Both tools handle most common lifecycle operations around deploying web applications, can run commands on multiple servers, and they both handle zero downtime deployments.

Dokku vs Kamal

So what are the differences in terms of th overall design, features, and basic workflows?

Design

The main design differences are that Kamal is using Docker. Neither Kamal or Capistrano don't concern themselves with single-server requirements such as SSL renewal; servers managed by them are expected to be run behind a load balancers. Capistrano does have a way to configure the servers while Kamal doesn't. Instead, Kamal configures Docker and Traefik for you.

Features

Kamal stays away from doing more than the very basics -- cross compiling Docker, deploying the application and its accessories and setting up Traefik as a proxy. Kamal tries not to know much about anything apart from running Docker containers.

Capistrano too stays away from the details on the surface, but it's a Ruby DSL that can provision and configure anything you'll need.

Workflow

The standard Capistrano workflow is to prepare a server by installing your application runtime, web server and configuring user roles. Once the servers are provisioned, Capistrano lets you run your predefined recipes for deploying and redeploying your application.

The standard Kamal workflow is to run initially kamal setup and later kamal deploy. Kamal cross-compiles the Docker container, uploads it to a container registry and then pulls it on servers to replace the latest running version.

Which one to choose?

Kamal is a spiritual successor to Capistrano for the container era. Most will be better off by trying Kamal today.