// This skill should be used when the user asks about "Kamal", "Kamal 2", "deployment", "deploying Rails", "Docker deployment", "VPS deployment", or zero-downtime deployments. Load this skill when setting up or troubleshooting Kamal deployments.
| name | Kamal 2 Deployment |
| description | This skill should be used when the user asks about "Kamal", "Kamal 2", "deployment", "deploying Rails", "Docker deployment", "VPS deployment", or zero-downtime deployments. Load this skill when setting up or troubleshooting Kamal deployments. |
| version | 0.1.0 |
Kamal 2 is Rails' official deployment tool for zero-downtime deployments to any server. This skill covers Kamal setup, configuration, and deployment workflows.
Install:
gem install kamal
Initialize:
kamal init
Generates: config/deploy.yml and .kamal/secrets
# config/deploy.yml
service: myapp
image: myapp
servers:
web:
hosts:
- 192.168.1.1
labels:
traefik.http.routers.myapp.rule: Host(`myapp.com`)
registry:
server: ghcr.io
username: myusername
password:
- KAMAL_REGISTRY_PASSWORD
env:
secret:
- RAILS_MASTER_KEY
# Initial deploy
kamal setup
# Regular deploy
kamal deploy
# Rollback
kamal rollback
# View logs
kamal app logs
# SSH into container
kamal app exec -i bash
# Run console
kamal app exec rails console
Kamal handles SSL automatically via Let's Encrypt:
# In config/deploy.yml
traefik:
options:
publish:
- "443:443"
volume:
- "/letsencrypt/acme.json:/letsencrypt/acme.json"
args:
entryPoints.web.address: ":80"
entryPoints.websecure.address: ":443"
certificatesResolvers.letsencrypt.acme.email: "you@example.com"
docker build .Kamal makes deployment simple while keeping you in control.
Working examples in examples/:
examples/deploy.yml - Complete Kamal 2 configuration with multi-server setup, SSL/HTTPS, health checks, workers, and accessories