/kamal-skills:deployfrom kamal-skills
Run Kamal deploys end to end — a full `kamal deploy` (build, push, pull, boot, health-check on GET /up, zero-downtime cutover via kamal-proxy, then prune) and a faster `kamal redeploy` that skips bootstrapping, kamal-proxy startup, pruning, and registry login. Covers targeting with `--hosts`, `--roles`, `--version`, and `--primary`, plus `--skip-push` and `--skip-hooks`, and managing the deploy lock with `kamal lock acquire/release/status` and `--lock-wait`/`--lock-wait-timeout`/`--lock-wait-interval`. Use when the user says "deploy my app," "kamal deploy," "ship a release," "push to production," "redeploy," "deploy only to web/workers," "deploy a specific version," "skip the build," "skip hooks," "the deploy lock is stuck," or "lock deploys for a maintenance window." For building and pushing images, see build. For pre/post-deploy scripts, see hooks. For reverting a bad release, see rollback. For managing already-running containers, see app.
Ships in kamal-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in deploying applications with Kamal. Your goal is to run safe, predictable deploys: build and ship the right version to the right hosts, understand what each command does before running it, and manage the deploy lock so concurrent commands never collide.
Read the project's Kamal config before asking the user questions — it tells you the roles, hosts, and destinations you can target.
config/deploy.yml — the default config file. It defines your servers, roles, registry, and build settings.config/deploy.<destination>.yml — destination-specific config (for example config/deploy.staging.yml), selected with -d, --destination..kamal/secrets — where deploy secrets (registry password, env secrets) are read from.Kamal deploys the currently checked-out Git version by default, and only builds files committed to your Git repository. Commit your changes before deploying, or the deploy will ship stale code.
kamal deploy Doeskamal deploy builds and deploys your app to all servers, using kamal-proxy to move traffic from the old version to the new one without downtime. The sequence is:
200 OK to GET /up on port 80.If GET /up never returns 200 OK, traffic is not cut over to the new container — your health-check endpoint is what makes the deploy safe.
# 1. Make sure the version you want to ship is committed and checked out.
git status
# 2. Deploy the checked-out version to all servers.
kamal deploy
# 3. Watch the output. Kamal builds, pushes, pulls, boots the new
# container, waits for GET /up, cuts traffic over, and prunes.
The deploy takes a lock automatically while it runs (see Managing the Deploy Lock). If another deploy is already running, it fails immediately unless you pass --lock-wait.
First deploy to a fresh server? Use kamal setup instead — it installs Docker, boots accessories, and then runs the deploy. kamal redeploy can only be used after kamal deploy has succeeded at least once.
By default a deploy runs against all hosts and roles. Narrow it with these flags:
| Flag | Short | What it does |
|---|---|---|
--hosts=HOSTS | -h | Run only on these hosts (comma-separated, supports * wildcards) |
--roles=ROLES | -r | Run only on these roles (comma-separated, supports * wildcards) |
--primary | -p | Run only on the primary host instead of all |
--version=VERSION | Run commands against a specific app version | |
--destination=DESTINATION | -d | Use a destination config (staging → config/deploy.staging.yml) |
# Deploy only the web role
kamal deploy --roles=web
# Deploy to a subset of hosts by wildcard
kamal deploy --hosts='web-*'
# Deploy to the staging destination
kamal deploy -d staging
--version runs the command against a specific app version rather than the checked-out Git hash. To roll back to a previous image instead, use the rollback skill.
kamal redeploykamal redeploy deploys your app but skips bootstrapping servers, starting kamal-proxy, pruning, and registry login:
kamal redeploy
Use it for repeat deploys to servers that are already set up and already have kamal-proxy running — it's quicker because it does less. You must have run kamal deploy at least once first. redeploy accepts the same targeting flags as deploy.
| Flag | Short | What it does | Default |
|---|---|---|---|
--skip-push | -P | Skip the image build and push (deploy an already-built image) | false |
--skip-hooks | -H | Don't run hooks | false |
# Image is already built and pushed — just roll it out
kamal deploy --skip-push
# Deploy without running pre/post-deploy hooks
kamal deploy --skip-hooks
--skip-push is useful when the image for this version already exists in the registry (for example, built earlier in CI). For what hooks run and when, see the hooks skill.
For the full kamal deploy option list — including --verbose, --quiet, and --config-file — see references/deploy-options.md.
Commands that are unsafe to run concurrently take a deploy lock while they run. The lock is an atomically created directory in the .kamal directory on the primary server. Use kamal lock to inspect or manage it directly — for clearing a leftover lock from a failed command, or to block deploys during a maintenance window.
| Subcommand | What it does |
|---|---|
kamal lock status | Report lock status |
kamal lock acquire -m, --message=MESSAGE | Acquire the deploy lock |
kamal lock release | Release the deploy lock |
# See whether a lock is held
kamal lock status
# Block deploys during a maintenance window
kamal lock acquire -m "Maintenance in progress"
# Clear the lock when you're done
kamal lock release
When a lock is held, kamal lock status reports who holds it, the version, and the message:
Locked by: Deployer at 2024-04-05T08:32:46Z
Version: 75bf6fa40b975cbd8aec05abf7164e0982f185ac
Message: Maintenance in progress
kamal deploy and other commands that take the lock automatically fail immediately if the lock is already held. Pass --lock-wait to make them poll and retry until it's released:
kamal deploy --lock-wait
--lock-wait only waits on locks another command took automatically while running. A lock set manually with kamal lock acquire is not waited on — the command fails immediately with Deploy lock held manually, not waiting. This is by design: a manual lock means "humans, stay out."
Tune the wait with:
| Flag | Default | What it does |
|---|---|---|
--lock-wait-timeout | 900 | Maximum seconds to wait before giving up |
--lock-wait-interval | 15 | Seconds between polls |
kamal deploy --lock-wait --lock-wait-timeout 300 --lock-wait-interval 10
For the full lock reference and worked example, see references/lock-reference.md.
| Goal | Command |
|---|---|
| Full deploy of the checked-out version | kamal deploy |
| Faster repeat deploy (skip bootstrap/proxy/prune/login) | kamal redeploy |
| Deploy one role only | kamal deploy --roles=web |
| Deploy a subset of hosts | kamal deploy --hosts='web-*' |
| Deploy to staging | kamal deploy -d staging |
| Deploy without rebuilding | kamal deploy --skip-push |
| Deploy without hooks | kamal deploy --skip-hooks |
| Wait instead of failing on a busy lock | kamal deploy --lock-wait |
| Check / set / clear the deploy lock | kamal lock status / acquire -m / release |
kamal build), which kamal deploy and kamal redeploy call indirectly.--skip-hooks affects them.kamal rollback after a bad deploy.kamal app.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub donnfelker/kamal-skills --plugin kamal-skills25 skills in this plugin
/accessoriesRun and manage accessory services — databases, Redis, search, and other long-lived dependencies your app needs — through Kamal's `accessories:` configuration and the `kamal accessory` command. Use this when the user says things like "add a MySQL/Postgres/Redis accessory," "run a database with Kamal," "kamal accessory boot," "set up a sidecar/companion service," "my app needs a cache or search container," "persist accessory data with volumes," or "reboot/restart/remove an accessory." Covers defining the accessory (image, host/hosts/role/roles/tag/tags, port, env, files, directories, volumes, network, options, registry, proxy) and operating it with boot, reboot, restart, start, stop, details, logs, exec, and remove. For passing configuration and credentials into accessories, see env and secrets. For scheduled jobs, see cron./aliasesDefine custom command aliases under the top-level `aliases` key in `config/deploy.yml` so a long, repeated `kamal` invocation becomes a single `kamal <name>`. Use it when the user says "add a Kamal alias," "shortcut kamal app exec," "make `kamal console` open a Rails console," "create a one-liner to deploy staging," "I keep retyping the same kamal command," or asks about the `aliases` config key, alias naming rules, or a `deploy -d staging` shortcut. Covers how an alias expands into a `kamal` subcommand, the lowercase letters/numbers/dashes/underscores naming rule, and the documented examples `console: app exec -i --reuse "bin/rails console"`, `uname: app exec -p -q -r web "uname -a"`, and `staging_deploy: deploy -d staging`. For the rest of `config/deploy.yml` and DRYing it up with YAML anchors, see config. For the underlying app exec / console / logs commands the aliases wrap, see app./appOperate and inspect already-running Kamal apps without redeploying. Manage app containers with `kamal app` (boot, start, stop, containers, details, images, version, logs, exec, remove, stale_containers), set maintenance/live mode (`kamal app maintenance --message`, `kamal app live`, `error_pages_path`), see every container with `kamal details`, review what ran on each server with `kamal audit`, print the resolved config with `kamal config`, run one-off and interactive commands with `kamal app exec` (`--primary/-p`, `--interactive/-i`, `--reuse`, `--raw`), and check the installed CLI version with `kamal version`. Use when the user says "boot/start/stop the app," "show running containers," "exec into the app," "open a Rails console," "run a command on all servers," "put the app in maintenance mode," "show the audit log," or "print my Kamal config." For shipping releases, see deploy. For reverting a release, see rollback. For log-driver and OTel/file config, see logging. For kamal-proxy, see proxy./buildConfigure Kamal builders and build then push your app image. Use this skill when the user wants to set up the `builder` block in config/deploy.yml — choosing local, remote, multi-arch, or Docker Build Cloud builds, picking a `driver`, passing build `args`, build `secrets`, or `cache`, switching the `dockerfile`, `context`, or `target`, or building without a Dockerfile via buildpacks (`pack`) — and when they want to run `kamal build push`, `kamal build dev`, or other `kamal build` subcommands. Trigger phrases include "kamal build," "build my image," "push the image to the registry," "build for amd64/arm64," "remote builder," "Apple Silicon cross-build is slow," "speed up my builds with cache," "pass a build arg," "use a build secret," or "build without a Dockerfile." For configuring the container registry, see registry. For the one-step flow that builds and ships in a single command, see deploy. For managing the secret values that build secrets reference, see secrets./ci-deploySet up continuous deployment so every push to main runs `kamal deploy` from GitHub Actions once the tests pass — for any stack Kamal ships (Rails, Next.js, Phoenix, Rust, static sites, and more). Use when the user says "auto-deploy on push," "deploy from GitHub Actions," "continuous deployment with Kamal," "deploy when CI passes," "set up CD," "stop deploying from my laptop," or "use 1Password in GitHub Actions." Covers the deploy ssh key, secrets in a GitHub environment or read from 1Password with a service account, the workflow, the GHA build cache, and verifying the first run. For running a deploy by hand, see deploy. For the secrets file itself, see secrets. For build cache options, see build./configUnderstand and write your Kamal configuration in config/deploy.yml. Use when the user says "set up config/deploy.yml," "what goes in my deploy.yml," "what are the required keys," "add a staging destination," "deploy with -d staging," "DRY up my config with YAML anchors," "what does retain_containers / readiness_delay / primary_role / deploy_timeout do," "kamal init," or "kamal config." Covers the required service and image keys, destinations (-d) and merged per-destination files, x- extensions, every top-level option and its default, and reusing config with anchors and aliases. For configuring servers and roles, see servers. For env and secrets, see env. For command shortcuts, see aliases. For a first deployment, see setup.Other plugins' skills for the same job