ScriptsApr 15, 2026·3 min read

Kamal — Zero-Downtime Docker Deploys to Any Server

Kamal is Basecamp's deploy tool that ships Docker containers to bare metal or cloud VMs with a single command, giving you Heroku-like workflows on servers you actually own.

TL;DR
Kamal ships Docker containers to bare metal or cloud VMs with zero-downtime deploys in a single command.
§01

What it is

Kamal is Basecamp's deploy tool that ships Docker containers to bare metal servers or cloud VMs with a single command. It provides Heroku-like deployment workflows on servers you actually own. Kamal handles Docker image building, pushing to registries, rolling deploys with zero downtime via a reverse proxy, and multi-server orchestration.

Kamal targets developers and teams who want simple deployments without Kubernetes complexity. If you have a few servers and want push-button deploys, Kamal bridges the gap between manual SSH deployment and full container orchestration.

§02

How it saves time or tokens

Kamal replaces manual deployment scripts with a single declarative config file and one command. It installs Docker and the kamal-proxy reverse proxy on your servers automatically. Rolling deploys ensure zero downtime by starting the new version before stopping the old one. Multi-server support deploys to an entire fleet simultaneously.

§03

How to use

  1. Install Kamal:
gem install kamal
  1. Initialize configuration:
cd my-app
kamal init
# Edit config/deploy.yml with your servers, registry, and image settings
  1. First-time setup and deploy:
kamal setup    # Installs Docker and kamal-proxy on all servers
kamal deploy   # Build, push, and deploy your app
§04

Example

# config/deploy.yml
service: my-app
image: myregistry/my-app

servers:
  web:
    hosts:
      - 192.168.1.10
      - 192.168.1.11
  worker:
    hosts:
      - 192.168.1.12
    cmd: bundle exec sidekiq

registry:
  server: ghcr.io
  username: my-github-user
  password:
    - KAMAL_REGISTRY_PASSWORD

env:
  clear:
    RAILS_ENV: production
  secret:
    - DATABASE_URL
    - REDIS_URL
§05

Related on TokRepo

This tool integrates with standard development workflows and requires minimal configuration to get started. It is available as open-source software with documentation and community support through the official repository. The project follows semantic versioning for stable releases.

For teams evaluating this tool, the key advantage is reducing manual work in repetitive tasks. The automation provided by the built-in features means less custom code to maintain and fewer integration points to manage. This translates directly to lower maintenance costs and faster iteration cycles.

§06

Common pitfalls

  • Kamal requires SSH access to target servers and Docker registry credentials; ensure SSH keys and registry auth are configured before running setup.
  • The deploy.yml file contains secrets references; use environment variables or .env files rather than committing credentials to version control.
  • Kamal installs its own reverse proxy (kamal-proxy); if you already have Nginx or Traefik on your servers, configure port mapping to avoid conflicts.

Frequently Asked Questions

How does Kamal achieve zero downtime?+

Kamal uses kamal-proxy (a lightweight reverse proxy) to route traffic. During deployment, the new container starts alongside the old one. Once health checks pass, kamal-proxy switches traffic to the new container and stops the old one. Users experience no interruption.

Does Kamal require Kubernetes?+

No. Kamal deploys directly to servers via SSH and Docker. It is designed as a simpler alternative to Kubernetes for teams that do not need the complexity of container orchestration.

What registries does Kamal support?+

Kamal works with Docker Hub, GitHub Container Registry (ghcr.io), AWS ECR, Google Container Registry, and any Docker-compatible registry. Configure the registry in deploy.yml.

Can Kamal deploy to multiple servers?+

Yes. Define multiple hosts in deploy.yml and Kamal deploys to all of them in parallel. You can also define different server roles (web, worker) with different commands.

Is Kamal production-ready?+

Yes. Kamal is used by Basecamp (37signals) to deploy their production applications including HEY and Basecamp itself. It is actively maintained and used in production by many teams.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets