Skip to content

Import and Export

X4Applegate edited this page Sep 10, 2026 · 1 revision

Import and Export

Import from a running Caddy

Import from Caddy (/import) pulls the live JSON config over the admin API and lets you pick which routes to adopt as proxy hosts, redirections or advanced routes. Imports are non-destructive: CaddyUI creates its own rules alongside the existing ones. Delete the originals once everything works.

Paste a Caddyfile

Paste Caddyfile (/caddyfile-import) takes a whole Caddyfile, previews what it will create and lets you accept. A classifier routes each site block to the right table: plain reverse proxies become proxy hosts, redir-only blocks become redirections, and everything else (custom matchers, odd ports, respond blocks) becomes an advanced route that keeps its listen port. If CADDYFILE_PATH points at a mounted Caddyfile, snippet definitions are loaded from it automatically. Re-classify on the Advanced Routes page rescues older imports.

See the Proxy Hosts table when you would rather rebuild a block by hand and understand every field.

Export

  • Export Caddyfile on the Proxy Hosts page downloads every enabled proxy host, redirection and advanced route on the active server as one Caddyfile, sorted by hostname so two exports diff cleanly. A per-host # Notes: block lists settings that have no Caddyfile spelling (maintenance windows, basic-auth users) so nothing is silently lost on a round trip. Custom certificates render as real tls <cert> <key> lines; Advanced-config reverse_proxy sub-directives render inside the generated block.
  • Export JSON downloads the same as Caddy JSON.
  • Each proxy host's editor has per-host Export as Caddyfile or JSON.
  • Same RBAC as everything else: admins get the whole server, users only their own resources.
  • Caddy Config (/caddy-config) shows the complete live config Caddy is running, read-only, which is the fastest way to see what a form toggle actually emits.
  • Analytics and the Activity log export CSV.

Clone this wiki locally