This guide walks you through deploying a Rails app to DigitalOcean using Kamal.
deploy.yml
– Main deployment configuration.secrets
– Stores sensitive credentials (never commit this to Git!).In your secrets
file:
Variable | Description |
---|---|
KAMAL_REGISTRY_PASSWORD |
Your Docker Hub personal access token (generate it in Docker Hub settings). |
RAILS_MASTER_KEY |
Found in config/master.key in your Rails app. This is required to decrypt Rails credentials. |
Example:
bash
CopyEdit
# From your password manager — never commit this!
KAMAL_REGISTRY_PASSWORD=your_dockerhub_token
RAILS_MASTER_KEY=your_master_key
⚠️ Security Tips:
config/master.key
or .env
files to GitHub.deploy.yml
Set this to your app name:
yaml
CopyEdit
service: twitterclone