caddy-tui: a terminal interface to look after Caddy in Docker

·

Also available in Spanish: leer en castellano.

There is a particular kind of boredom that only server owners know: opening the same configuration file, again, to add one more line.

Caddy is a joy. It gets and renews HTTPS certificates by itself, and its configuration is a few readable lines. But I run it in Docker in front of several services, and every change meant the same ritual: edit the Caddyfile by hand, hope it was valid, reload, hope nothing dropped. I was tired of it. And what bothered me even more was the silence afterwards. Was the site up? Was the certificate close to expiring? Who was hitting my server at three in the morning asking for /.env? Caddy did its job quietly, and I had no good way to see it.

So I did what any bored and slightly frustrated person with a terminal does: I wrote the tool I wished existed. caddy-tui is a terminal interface that edits the configuration for me, safely, and watches over Caddy so I do not have to. It finds your Caddy container, your Caddyfile and your compose project on its own, and gives you one place to edit, check and watch it.

What it does

  • Safe editing: every change is validated before it is saved, backed up first, and applied with a reload that does not drop connections. One key undoes the last change.
  • Add-service wizard: reverse proxy, reverse proxy with paths, redirect or maintenance page. It writes the block, validates it, shows a preview and appends it. The same forms edit existing blocks.
  • Diagnostics and repair: ports not published, a Caddyfile that is out of date inside the container, unreachable upstreams, undefined variables, plain HTTP served where HTTPS is expected. It probes every site and tells you the status, the response time and the certificate validity.
  • Certificates: names, issuer and expiry of everything Caddy has stored, with a warning before one runs out or when Let’s Encrypt is failing.
  • Live traffic and statistics: requests per second, status codes, latency, busiest domains and addresses, and history over 24 hours, 7, 30 and 90 days.
  • Scanner banning: block an address or a range with one key, or let it ban the obvious scanners automatically, fail2ban-style, with an allow list and expiring bans.
  • Alerts on Telegram: a periodic check that tells you when something fails or recovers.
  • Updating Caddy: it compares your image with the registry and offers to pull and recreate Caddy, validating your configuration with the new version first so a bad release never takes the site down.
  • Moving house: --export and --import carry your configuration, and optionally the certificates, to another server.
  • No Caddy yet? It can install Docker and set up a first Caddy for you, after asking.

It has no dependencies beyond Python 3.8 and Docker. The interface is available in English and Spanish, and you switch with one key.

Install

On Debian, Ubuntu, Raspberry Pi OS or Armbian, add the signed apt repository once, and apt upgrade keeps it up to date:

curl -fsSL https://mgoreiro.github.io/caddy-tui/apt/caddy-tui.gpg | sudo tee /usr/share/keyrings/caddy-tui.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/caddy-tui.gpg] https://mgoreiro.github.io/caddy-tui/apt stable main" | sudo tee /etc/apt/sources.list.d/caddy-tui.list
sudo apt update && sudo apt install caddy-tui
sudo caddy-tui

The package is architecture independent, so it works on x86-64 and on ARM boards alike. You can also download the .deb from the releases page. The key fingerprint and a full installation guide are in the repository.

If you want to see it working on something concrete, it pairs naturally with Tossbox, whose HTTPS variant uses Caddy and which caddy-tui detects without any configuration.

Standing on good shoulders

caddy-tui does not replace Caddy; it only looks after it. All the real work is done by Caddy, created by Matt Holt and developed by its community of contributors, and by Let’s Encrypt, which makes free certificates something we take for granted. Thank you.

caddy-tui is an independent project and is not affiliated with, or endorsed by, the Caddy project.

The code is on GitHub under the MIT license. Issues, ideas and pull requests are welcome.