A single bash script that manages Caddy for you: automatic TLS, a web panel, and it refuses to leave your server broken. It validates every change before applying it and rolls back if anything is wrong.
curl -fsSL https://github.com/Plus98ir/Smart-Caddy/releases/latest/download/smart_caddy.sh -o smart_caddy.sh && sudo bash smart_caddy.sh
Every item below is a thing the script does on its own — not a thing you configure.
The second argument to add can be any of these. The script works out which one it is.
On most servers port 443 is taken by Xray or x-ui, so a normal Caddy install simply refuses to start. With --behind-xray, Caddy listens on a free loopback port as plain HTTP with PROXY protocol and h2c, and the script prints the exact fallback row to paste into x-ui.
Xray terminates TLS and routes by SNI, so your real visitor IP survives via PROXY protocol. The script reads Xray's own config to verify the fallback actually exists before telling you it works.
One command puts a real admin page on a domain of your choosing. It is a small Python service using only the standard library — no Node, no pip, nothing to keep updated.
smart-caddy panel caddy.example.com smart-caddy panel caddy.example.com --behind-xray smart-caddy passwd smart-caddy panel status
The password is changed from the terminal, never from the web page — so losing access to the page never locks you out of the server.
These are the guarantees, in the order they matter.
The full set. Run smart-caddy with no arguments for the same list plus every option.
| command | what it does |
|---|
The ones that come up first.
Works on a single-IP VPS or a multi-IP server. Nothing is tailored to any particular setup.
Open on GitHub