Deploying with Kamal and Docker

November 10, 2025

This blog is the first time I've deployed with Kamal and I'm pretty happy with the result. Kamal is a Rails deployment tool that makes it easy to deploy apps to a Docker host.

Combining Kamal with GitHub Actions I have a deploy pipeline that automatically deploys a new version every time I push changes to the Main branch. This is the same automatic deployments that I used to enjoy with DigitalOcean's app platform but at a fraction of the price.

Since this is my first time deploying with Kamal I did run into a few issues that took a bit of time to figure out. Two of the issues were Docker rather than Kamal related and specifically because I installed Docker in Rootless Mode

  1. Kamal was unable to map privileged ports because it wasn't running as root
  2. Docker would only run while the user session was active

To fix number 1 I bound port access to a specific socket:

sudo setcap cap_net_bind_service=ep $(which rootlesskit)

To fix number 2 I needed to enable linger on the user running Docker so that the process would keep running after the user logged out:

sudo loginctl enable-linger $(whoami)