Dokku vs Kamal

Dokku and Kamal are both open source deployment tools to run web applications on Docker. They both offer a simple way of building and running your Docker containers. Here's what they have in common and where they differ.

What's Dokku

Dokku is a long standing project that sells itself as an open source PAAS alternative to Heroku. It's built with Heroku buildpacks compatibility in mind and runs the application using Docker containers. It offers lots of plugins out-of-the-box to deploy what you need on a single server. Dokku doesn't provision servers but can bootstrap itself with a single script.

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

The main similarities are the heavy reliance on Docker and easy-of-use. You can start with and learn both tools in very short time. They both target smaller deployments than those of Kubernetes.

Dokku vs Kamal

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

Design

The main design differences are that Kamal is designed for a multi-server deployment while Dokku for a single server. Kamal doesn't concern itself with single-server requirements such as SSL renewal; servers managed by Kamal are expected to be run behind a load balancers. Another difference is that Kamal will always run just one container of the application on a given server while Dokku can scale to more containers for higher concurrency.

Features

Dokku focuses on a fast and painless single-server setup so it supports SSL configuration, one-off tasks, CRON, DNS, and more. It also supports many proxies like Caddy, HAProxy, NGINX or Traefik. Kamal on the other hand 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.

Dokku also supports scaling containers within one host while Kamal doesn't, but deploys the application and its databases across an entire fleet of servers.

Workflow

Dokku can be set up on the server with a single Bash command and then managed with dokku executable. By default Dokku supports git-push style of deployments where the container is built directly on the server. That might need some additional resources.

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?

Dokku and Kamal are great options for deploying web applications, and they both reduce the complexity by a large margin. It's important to note that you can run on a single server with Kamal, and higher concurrency on a single server can be achieved within the container by running more processes of the application server. Similarly one can make Dokku run a multi-server deployment with some work. If you need a more complete single-server deployment, look at Dokku. If you need more servers, consider Kamal.