Skip to Content

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

  1. Point a DNS A record for your domain (e.g., msend.yourcompany.com) at your server’s IP.
  2. Create persistent data directories on the server (or set DATA_DIR to another folder):
    • /mnt/data/postgres (owner UID 999)
    • /mnt/data/storage (owner UID 1000)

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 deploys

Day-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 container
Last updated on