explaingit

basecamp/kamal

14,211RubyAudience · ops devopsComplexity · 3/5LicenseSetup · moderate

TLDR

Kamal deploys any Docker-based web app to any server over SSH with zero downtime, switching traffic from the old version to the new one without taking the site offline.

Mindmap

mindmap
  root((kamal))
    What it does
      Zero-downtime deploy
      SSH-based server control
      Traffic switching
    How it works
      Docker containers
      kamal-proxy
      No server agent needed
    Use cases
      VPS deployment
      Rails apps
      Any Docker app
    Audience
      DevOps engineers
      Solo founders
      Backend developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Deploy a Rails or any Docker app to a cheap bare-metal server or VPS without downtime

USE CASE 2

Roll out updates automatically using kamal-proxy to switch traffic between old and new app versions

USE CASE 3

Set up a production server without installing any special agent software, just SSH access and Docker

USE CASE 4

Manage deployments to multiple servers from a single config file

Tech stack

RubyDockerSSH

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires Docker on both your local machine and the target server, plus SSH access with a user that has Docker permissions.

Use freely for personal or commercial projects, including modifying and redistributing, as long as you keep the copyright notice (MIT).

In plain English

Kamal is a deployment tool for web applications. It lets you push your app to any server, whether that is a cheap bare-metal machine you rent directly or a virtual machine from a cloud provider, without the app going offline during the update. The README is brief and points to an external documentation site for full details. The way zero-downtime updates work is through a companion tool called kamal-proxy, which sits in front of your app and switches incoming requests from the old version of the app to the new version once the new one is running and ready. Kamal communicates with your servers over SSH, so no special agent needs to be installed on each server in advance. The tool was originally created by Basecamp, the company behind the Ruby on Rails web framework, and it works naturally with Rails apps. It is not limited to Rails, though: any web application that can be packaged as a Docker container can be deployed with it. Kamal is written in Ruby and is released under the MIT license, which allows use in both personal and commercial projects.

Copy-paste prompts

Prompt 1
I have a Rails app packaged as a Docker container. Write me a Kamal deploy.yml config to deploy it to a single Ubuntu VPS at a given IP address.
Prompt 2
Show me the step-by-step Kamal commands to do a first deployment of my app, then roll out an update with zero downtime.
Prompt 3
My Kamal deployment is failing with this error: [paste error]. What is likely wrong with my deploy.yml?
Prompt 4
Compare Kamal vs Capistrano for deploying a Rails app to a single server. Which should I use and why?
Open on GitHub → Explain another repo

← basecamp on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.