kamal-deploy

jalen0x's avatarfrom jalen0x

Deploy Docker applications using Kamal 2 with zero-downtime and automatic SSL. Use this skill when (1) setting up new Kamal deployments, (2) generating deploy.yml configuration, (3) deploying apps that lack health endpoints (using Caddy workaround).

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 1, 2026

When & Why to Use This Skill

This Claude skill streamlines the deployment of Docker applications using Kamal 2, enabling developers to achieve zero-downtime updates and automatic SSL configuration with minimal manual effort. It automates the generation of essential configuration files and provides robust solutions for infrastructure challenges, such as managing health checks for legacy applications.

Use Cases

  • Initial Setup: Quickly bootstrapping a new production environment on a VPS using Kamal 2 for containerized applications.
  • Configuration Generation: Automatically creating and customizing 'deploy.yml' files based on specific domain, server IP, and registry details.
  • Health Check Workarounds: Deploying applications that lack native health endpoints by automatically configuring a Caddy-based proxy wrapper.
  • Zero-Downtime Updates: Executing seamless application deployments and rollbacks to ensure continuous service availability.
  • SSL Automation: Simplifying the provisioning and management of SSL certificates for secure web traffic.
namekamal-deploy
descriptionDeploy Docker applications using Kamal 2 with zero-downtime and automatic SSL. Use this skill when (1) setting up new Kamal deployments, (2) generating deploy.yml configuration, (3) deploying apps that lack health endpoints (using Caddy workaround).

Kamal 2 Deployment

Workflow

Ask user for:

  1. Domain — e.g., app.example.com (service name: app_example_com)
  2. Server IP(s)
  3. Health endpoint — Does app return 200 on /up without auth?

Generate config/deploy.yml

service: {{DOMAIN_UNDERSCORED}}
image: jalen0x/{{DOMAIN_UNDERSCORED}}

servers:
  web:
    hosts:
      - {{SERVER_IP}}

proxy:
  ssl: true
  host: {{DOMAIN}}

registry:
  username: jalen0x
  password:
    - KAMAL_REGISTRY_PASSWORD

ssh:
  user: ubuntu

builder:
  arch: amd64

Health Endpoint

App must respond 200 on /up at port 80 (default).

Custom path: Add healthcheck.path to proxy config.

No health endpoint: Use Caddy. Copy templates from assets/ and customize:

  • assets/Caddyfile → project Caddyfile
  • assets/start.sh → project start.sh

Generate Dockerfile:

FROM {{BASE_IMAGE}}
RUN apk add --no-cache caddy
COPY Caddyfile /Caddyfile
COPY start.sh /start.sh
RUN chmod +x /start.sh
ENTRYPOINT ["/bin/sh", "/start.sh"]

Commands

kamal setup   # First-time
kamal deploy  # Deploy