Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture

The Nginx frontend proxies API requests to the Node.js/Express backend, which talks to Caddy’s admin API.

Docker mode uses the socket for container discovery and file operations. Local mode supports Caddy outside Docker. The backend’s persistent config directory holds credentials, settings and instance data.

Request flow

flowchart LR
    accTitle: Request flow
    accDescr: The frontend proxies API requests to the backend. The backend communicates with Caddy's admin API.
    FE["caddy/ui frontend<br/>React + nginx<br/>:9877"]
    BE["caddy/ui backend<br/>Node.js + Express<br/>:9876"]
    CA["Caddy<br/>:2019 Admin API<br/>:80 / :443"]

    FE -->|"/api/*"| BE
    BE -->|"Admin API"| CA
    BE -->|"upstream TCP checks + passive health pool"| CA
    BE -->|"Prometheus metrics"| CA
    BE -->|"/adapt validation"| CA
    BE -->|"/pki/ca/local"| CA

The frontend serves the interface and proxies API requests. The backend handles Caddy operations, application settings, and instance data.

Files and persistent data

flowchart TB
    accTitle: Files and persistent data
    accDescr: In Docker mode the backend accesses Caddy container files through the Docker Engine. In local mode it accesses mounted files directly. Application data is stored separately.
    BE["caddy/ui backend"]
    DOCKER["Docker Engine"]
    LOCAL["Mounted Caddy files<br/>Local mode"]
    DATA[("caddy/ui data<br/>/etc/caddy-ui")]
    FILES["Caddy container files<br/>Caddyfile, logs, certificates"]

    BE -->|"Docker socket"| DOCKER
    DOCKER -->|"exec / stream"| FILES
    BE -->|"Direct access"| LOCAL
    BE -->|"Read / write"| DATA

Docker mode uses container discovery and commands inside the selected Caddy container. Local mode reads and writes paths mounted into the backend and uses its bundled Caddy binary. Both modes communicate with the instance’s admin API. See the instance guide for setup and file permissions.

Responsibilities

Connection or storagePurpose
Frontend → backendForward /api/* requests from the browser.
Backend → Caddy admin APIRead configuration, validate through /adapt, reload through /load, inspect the upstream health pool, and download the root CA through /pki/ca/local.
Backend → metrics and upstreamsRead Prometheus metrics; run TCP health checks and optional HTTP route checks.
Backend → Docker EngineDiscover Caddy containers and access their Caddyfiles, logs, and certificates through the Docker socket.
Backend → mounted Caddy filesAccess files directly in local mode.
Backend → /etc/caddy-uiPersist instance registrations, configuration history, route notes, settings, and application configuration.

See the API reference, configuration, and integrations for individual endpoints and settings.