Hub Installation
The hub is the central server hosting the backend API and the frontend.
Prerequisites
- Docker and Docker Compose
- An external Docker network named
caddy
bash
docker network create caddydocker-compose.yml
yaml
services:
caddy-manager-api:
image: cletus/caddy-manager-api:latest
restart: unless-stopped
environment:
DATABASE_URL: /data/caddy-manager.db
CADDY_API_URL: http://caddy:2019
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET}
FRONTEND_URL: https://cadmin.example.com
volumes:
- caddy_manager_data:/data
- /var/log/caddy:/var/log/caddy:ro
networks:
- caddy
caddy-manager-ui:
image: cletus/caddy-manager-ui:latest
restart: unless-stopped
environment:
- VITE_API_URL=https://api.cadmin.example.com
networks:
- caddy
volumes:
caddy_manager_data:
networks:
caddy:
external: trueEnvironment Variables
Backend (API)
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | Path to the SQLite database | /data/caddy-manager.db |
CADDY_API_URL | Caddy admin API URL | http://caddy:2019 |
BETTER_AUTH_SECRET | Session secret (required) | A long random string |
FRONTEND_URL | Frontend URL (for CORS) | https://cadmin.example.com |
Frontend (UI)
| Variable | Description | Example |
|---|---|---|
VITE_API_URL | Backend API URL | https://api.cadmin.example.com |
First Launch
- Start the services:
bash
docker compose up -d- Create the administrator account:
bash
docker compose exec caddy-manager-api node dist/db/seed.jsWARNING
Change the default password after the first login.
Reverse Proxy
Cadmin must be accessible behind a reverse proxy for HTTPS. Example Caddy configuration:
nginx
cadmin.example.com {
reverse_proxy caddy-manager-ui:80
}
api.cadmin.example.com {
reverse_proxy caddy-manager-api:3001
}