docs/installation/index.md
If you have a Ruby environment available, you can install Kamal globally with:
gem install kamal
If you do not have Ruby installed you can run Kamal in a docker container, though this has some limitations.
Then, inside your app directory, run kamal init. Now edit the new file config/deploy.yml. It could look as simple as this:
service: hey
image: 37s/hey
servers:
- 192.168.0.1
- 192.168.0.2
registry:
username: registry-user-name
password:
- KAMAL_REGISTRY_PASSWORD
builder:
arch: amd64
env:
secret:
- RAILS_MASTER_KEY
Set your KAMAL_REGISTRY_PASSWORD in your environment and edit your .kamal/secrets file to read it (and your RAILS_MASTER_KEY for production with a Rails app).
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
RAILS_MASTER_KEY=$(cat config/master.key)
Now you're ready to deploy to the servers:
kamal setup
This will:
200 OK to GET /up.Voila! All the servers are now serving the app on port 80. If you're just running a single server, you're ready to go. If you're running multiple servers, you need to put a load balancer in front of them. For subsequent deploys, or if your servers already have Docker installed, you can just run kamal deploy.