Deploy with Kamal
msend is packaged as a Docker image and deploys to any Linux server with SSH access using Kamal . config/deploy.yml reads configuration from environment variables, so the exact same setup works for self-hosting and app.msend.dev.
Prepare Your Server & DNS
- Point a DNS
Arecord for your domain (e.g.,msend.yourcompany.com) at your server’s IP. - Create persistent data directories on the server (or set
DATA_DIRto another folder):/mnt/data/postgres(owner UID999)/mnt/data/storage(owner UID1000)
Configure Environment Variables
Set the variables required by config/deploy.yml in your shell:
export SERVER_IP="203.0.113.10"
export APP_HOST="msend.yourcompany.com"
export KAMAL_REGISTRY_USERNAME="your-registry-user"
export KAMAL_REGISTRY_PASSWORD="your-registry-password"
export POSTGRES_PASSWORD="strong-postgres-password"Edit image: and registry: in config/deploy.yml if you push to your own container registry.
Deploy
bin/kamal setup # first deploy
bin/kamal deploy # subsequent deploysDay-2 Operations
bin/kamal console # Rails console (add --sandbox for read-only inspection)
bin/kamal logs # Follow application logs
bin/kamal dbc # PostgreSQL console
bin/kamal shell # Bash inside the app containerLast updated on