DEV Community

Alex Spinov
Alex Spinov

Posted on

Kamal Has a Free API: The Deployment Tool from Basecamp That Deploys Docker Apps Without Kubernetes

Kubernetes is overkill for most apps. Heroku is too expensive. Kamal (formerly MRSK) from Basecamp deploys Docker containers to any server with zero-downtime rolling deploys — no orchestrator needed.

What Is Kamal?

Kamal is a deployment tool that ships Docker containers to bare servers. Built by the team behind Basecamp and HEY, it handles zero-downtime deploys, SSL certificates, rolling restarts, and multi-server deployments. It uses Traefik as a reverse proxy and requires nothing but SSH access to your servers.

The Free Tool

Kamal is completely free and open source:

  • Zero-downtime deploys: Rolling deploys with health checks
  • Multi-server: Deploy to multiple servers simultaneously
  • Accessories: Deploy databases, Redis, etc. alongside your app
  • SSL: Automatic Let's Encrypt via Traefik
  • Environment management: Encrypted .env files
  • Hooks: Custom scripts at each deploy stage
  • No Kubernetes: Just Docker + SSH

Quick Start

Install Kamal:

gem install kamal
Enter fullscreen mode Exit fullscreen mode

Initialize your project:

kamal init
Enter fullscreen mode Exit fullscreen mode

Configure config/deploy.yml:

service: my-app
image: my-user/my-app

servers:
  web:
    - 192.168.1.1
    - 192.168.1.2
  workers:
    hosts:
      - 192.168.1.3
    cmd: bin/jobs

registry:
  username: my-user
  password:
    - KAMAL_REGISTRY_PASSWORD

env:
  clear:
    DATABASE_HOST: db.example.com
  secret:
    - RAILS_MASTER_KEY
    - DATABASE_URL

traefik:
  options:
    publish:
      - 443:443
    volume:
      - /letsencrypt:/letsencrypt
  args:
    entryPoints.websecure.address: ':443'
    certificatesResolvers.letsencrypt.acme.email: admin@example.com
    certificatesResolvers.letsencrypt.acme.storage: /letsencrypt/acme.json

accessories:
  db:
    image: postgres:16
    host: 192.168.1.4
    port: 5432
    env:
      secret:
        - POSTGRES_PASSWORD
    volumes:
      - /var/lib/postgresql/data:/var/lib/postgresql/data
  redis:
    image: redis:7
    host: 192.168.1.4
    port: 6379
Enter fullscreen mode Exit fullscreen mode

Deploy:

# First deploy
kamal setup

# Subsequent deploys
kamal deploy

# Rolling restart
kamal app restart

# View logs
kamal app logs

# Run console
kamal app exec -i 'bin/rails console'
Enter fullscreen mode Exit fullscreen mode

Why Teams Choose Kamal

Basecamp migrated HEY (300K+ users) from Kubernetes to Kamal. They went from a team of 3 managing K8s to zero infrastructure specialists. Deploys became faster, debugging became simpler, and their cloud bill dropped significantly. The entire HEY email service runs on Kamal deployed to bare metal servers.

Who Is This For?

  • Rails developers wanting Heroku simplicity on their own servers
  • Small teams who find Kubernetes overkill
  • Companies wanting to deploy to bare metal or VPS
  • Anyone deploying Docker containers who wants zero-downtime deploys

Start Deploying

Kamal proves you do not need Kubernetes for production Docker deployments. SSH + Docker + Traefik = zero-downtime deploys on any server.

Need help with deployment strategy or infrastructure? I build custom DevOps solutions — reach out to discuss your project.


Found this useful? I publish daily deep-dives into developer tools and APIs. Follow for more.

Top comments (0)