Cadditor — a minimal web editor for Caddyfile

Cadditor — a minimal web editor for Caddyfile

Hi everyone,

I use Caddy in my homelab, and one of the things I like most about it is how simple the Caddyfile syntax is.

For me, the configuration format itself was never the problem. The friction was the workflow around making a small change:

SSH → edit → format → verify → reload

I looked at existing Caddy web interfaces, but most of them solve a much broader problem: dashboards, monitoring, health information, form-based configuration, multiple instances, and so on.

Those are useful features, but for my homelab I wanted something much smaller.

I wanted to keep using the Caddyfile directly and only remove the repetitive work around editing and applying it.

So I built Cadditor.

Cadditor is a small web application served by Caddy itself. It provides a browser-based editor for the actual Caddyfile, with:

  • Caddyfile syntax highlighting

  • code folding

  • indicators for changed lines

  • formatting before apply

  • configuration verification

  • reload only after verification succeeds

The main design principle is that the Caddyfile remains the source of truth.

Cadditor does not generate another configuration format and does not try to turn Caddy into a form-based GUI.

I also wanted the application itself to stay small. I run Caddy in an Alpine LXC, so I did not want to add Docker, Node.js or another application runtime just for the editor.

Caddy serves the frontend, while the backend consists of small CGI scripts behind fcgiwrap.

Installation, updates and removal are handled by a shell installer. Cadditor’s internal Caddy configuration lives in its own imported snippet, while the actual Caddyfile remains user-owned.

I built it for my own homelab, but I am quite happy with how it turned out, so I have published the first release.

If you prefer working directly with Caddyfiles and have a similar use case, I would be very interested in feedback.

GitLab:

Live demo:

The demo uses the real Cadditor frontend. Since it runs as a static GitLab Page, it cannot actually run Caddy formatting, verification or reload.

AI disclosure:
I used ChatGPT throughout the project as a development assistant for architecture discussions, implementation support, code review, documentation and writing assistance. I made the product and architecture decisions, reviewed and tested the resulting implementation, and maintain the project.

2 Likes

Hey. Cool idea.

Here is an alternative workflow:

The “SSH” and “Edit” part can be merged into one simple Pyinfra/Ansible script. You can also write a additional step that “verifies” the caddyFile syntax. Using an interactive shell and manually editing files is indeed repetitive.

Also, your editor might be able to help you to write the Caddyfile syntax more effectively with correct formatting. For example, there is an package for Emacs users:

Yeah, that’s a cool idea. It makes your editor smarter while keeping Caddy itself untouched.

My use case is quite the opposite, though. I edit my Caddyfile from multiple devices (phone, laptop, and desktop) so having a web UI available directly on the server is extremely convenient for me.

Regarding the syntax, Cadditor already supports Caddyfile syntax highlighting, along with formatting and validation before applying the configuration.

The workflow gap you describe—SSH, edit, format, verify, reload—is the real friction for small homelab tweaks, so keeping the Caddyfile as source of truth rather than generating another format makes sense. The decision to avoid Docker and Node by serving the frontend through Caddy with small CGI scripts behind fcgiwrap fits an Alpine LXC well. I’m curious how you handle verification failures: does the editor keep the previous config active and surface Caddy’s output, or just block the reload? Also, does the installer manage fcgiwrap setup or assume it’s present?

Yes, exactly. On a verification failure, Cadditor shows Caddy’s output directly in the UI and stops there. The currently running configuration and the saved /etc/caddy/Caddyfile remain unchanged.

The editor keeps the formatted version in place, and it also highlights changes compared to the currently applied configuration, so it is usually fairly easy to spot what changed and track down the problem before trying again.

The backend is deliberately conservative about applying changes. It first writes the new configuration to a separate candidate Caddyfile and performs the validation and reload against that file. Only after Caddy successfully accepts the candidate does Cadditor atomically replace the original /etc/caddy/Caddyfile with it.

So even if verification or reload fails, the original Caddyfile is never overwritten and the currently running configuration stays untouched. One of my main goals was to make sure Cadditor cannot break your Caddyfile, so only changes that Caddy has actually accepted can become the persistent configuration.

And the installer takes care of fcgiwrap as well. On Alpine it installs and configures fcgiwrap/OpenRC, sets up the socket, and starts the service, so it does not assume an existing fcgiwrap setup.