Environment Variables
All configuration is done through environment variables. None are required — sensible defaults are provided for everything.
Reference
| Variable | Default | Description |
|---|---|---|
HOMEGANTRY_PORT | 3000 | Port the server listens on inside the container |
HOMEGANTRY_HOST | (empty) | Fallback host/IP for building service URLs (e.g. 192.168.1.100). Used when no Traefik rule or explicit URL label is present. |
HOMEGANTRY_TITLE | HomeGantry | Dashboard title shown in the header |
HOMEGANTRY_DOCKER_SOCKET | /var/run/docker.sock | Path to the Docker socket |
HOMEGANTRY_POLL_INTERVAL | 60 | Seconds between full Docker rescans. Real-time events are always active; this is a safety-net rescan. |
HOMEGANTRY_SHOW_STOPPED | false | Show stopped containers on the dashboard |
HOMEGANTRY_HOMEPAGE_COMPAT | true | Read homepage.* Docker labels (for migration from Homepage) |
HOMEGANTRY_EXCLUDE_SELF | true | Hide the HomeGantry container from its own dashboard |
HOMEGANTRY_COMPOSE_ONLY | true | Only show containers that belong to a Docker Compose project |
HOMEGANTRY_DATA_DIR | /data | Directory for persistent JSON data (overrides, settings, manual services) |
HOMEGANTRY_LOG_LEVEL | info | Log level: debug, info, warn, error |
HOMEGANTRY_DEMO | false | Demo mode: a made-up example lab instead of Docker and Traefik, no health-check requests, always read-only. |
Icons
| Variable | Default | Description |
|---|---|---|
HOMEGANTRY_ICON_SOURCE | cdn | cdn (dashboard-icons on jsDelivr), a self-hosted base URL (e.g. https://icons.example.com), or off (letter avatars only) |
A self-hosted base URL must serve the dashboard-icons layout: <base>/svg/<slug>.svg and <base>/png/<slug>.png. HomeGantry tries the SVG first, then the PNG, then shows a letter avatar.
With off the browser makes no external image request: the Content-Security-Policy allows only HomeGantry itself, and explicit icon URLs from labels or overrides are not sent to the client (they stay stored). An invalid value also turns icons off, so a typo cannot cause external requests.
Security
See the Security model for how these fit together.
| Variable | Default | Description |
|---|---|---|
HOMEGANTRY_ADMIN_TOKEN | (empty) | Token that unlocks editing (UI: "Unlock editing"; API: Authorization: Bearer <token>). Must be at least 24 characters, otherwise it is ignored. |
HOMEGANTRY_AUTH_HEADER | (empty) | Header set by your forward-auth proxy, e.g. Remote-User (Authelia) or X-authentik-username (Authentik). Any non-empty value allows editing. |
HOMEGANTRY_TRUSTED_PROXIES | (empty) | Comma-separated IPs/CIDRs of your reverse proxy. HOMEGANTRY_AUTH_HEADER, X-Forwarded-For and X-Forwarded-Host are only honoured from these. |
HOMEGANTRY_READONLY | false | Disable editing completely, even with a valid token or header |
HOMEGANTRY_CORS_ORIGINS | (empty) | Comma-separated origins allowed to call the API from another website (e.g. https://dash.example.com). CORS is off when empty. |
DOCKER_HOST | (empty) | Docker API endpoint, e.g. tcp://socket-proxy:2375 for a read-only socket proxy. Takes precedence over HOMEGANTRY_DOCKER_SOCKET. |
With neither HOMEGANTRY_ADMIN_TOKEN nor HOMEGANTRY_AUTH_HEADER + HOMEGANTRY_TRUSTED_PROXIES set, HomeGantry is read-only.
Traefik discovery
Optional. See Traefik Discovery for how to enable the API safely.
| Variable | Default | Description |
|---|---|---|
HOMEGANTRY_TRAEFIK_API_URL | (empty) | Traefik API base URL, e.g. http://traefik:8080. Discovery through the API is off when empty. |
HOMEGANTRY_TRAEFIK_API_USERNAME | (empty) | Basic-auth user for the API. Never logged or returned. |
HOMEGANTRY_TRAEFIK_API_PASSWORD | (empty) | Basic-auth password for the API. Never logged or returned. |
HOMEGANTRY_TRAEFIK_API_TOKEN | (empty) | Bearer token for the API; takes precedence over basic auth. Never logged or returned. |
HOMEGANTRY_TRAEFIK_TIMEOUT | 5 | Seconds before an API request is abandoned |
HOMEGANTRY_EXPOSURE_MAP | (empty) | Middleware-to-exposure mapping, e.g. my-sso=sso,office-*=private (details) |
Health checks
See Health Checks.
| Variable | Default | Description |
|---|---|---|
HOMEGANTRY_HEALTHCHECK | true | Enable HTTP health checks |
HOMEGANTRY_HEALTHCHECK_INTERVAL | 60 | Seconds between check rounds (minimum 5) |
HOMEGANTRY_HEALTHCHECK_TIMEOUT | 5 | Seconds before a request counts as timed out |
HOMEGANTRY_HEALTHCHECK_CONCURRENCY | 8 | Maximum simultaneous checks |
HOMEGANTRY_HEALTHCHECK_INSECURE_TLS | false | Accept self-signed certificates |
Dashboard settings
Set in the UI (settings drawer, editing unlocked) and stored in settings.json in the data directory. API: GET /api/settings, PATCH /api/settings (edit rights).
| Setting | Default | Values | Description |
|---|---|---|---|
dashboardTitle | HOMEGANTRY_TITLE | text | Title in the header |
columns | 4 | 1-6 | Maximum grid columns on wide screens (phones always use one) |
showStatus | true | true, false | Show the status on each card |
showStopped | HOMEGANTRY_SHOW_STOPPED | true, false | Show (and search) stopped containers |
layout | grid | grid, list | Cards or rows |
groupBy | category | category, stack, host | How services are grouped (details) |
Which groups are collapsed is not a setting: it is kept per browser in localStorage.
Per-service overrides
Set in the edit dialog, or with PUT /api/services/<id>/override (edit rights). Fields: displayName, url, icon, category, description, hidden, sortOrder and healthcheck (false turns health checks off). null for a field removes it from the override, so the service is back to its auto-detected value; for example {"url": null} returns to the URL from labels or Traefik. healthcheck: true is only stored when it is needed to beat a homegantry.healthcheck=false label; otherwise it removes the field, as checks are on by default. Manual services accept healthcheck in PUT /api/services/manual/<id>.
The edit dialog only sends the fields you changed, so saving it never pins the other auto-detected values. Clearing the name, URL, icon, category or description sends null for that field: the service is back to its auto-detected value.
Example .env File
HOMEGANTRY_PORT=3000
HOMEGANTRY_HOST=192.168.1.100
HOMEGANTRY_TITLE=My Homelab
HOMEGANTRY_POLL_INTERVAL=30
HOMEGANTRY_SHOW_STOPPED=false
HOMEGANTRY_HOMEPAGE_COMPAT=true
HOMEGANTRY_EXCLUDE_SELF=true
HOMEGANTRY_COMPOSE_ONLY=true
HOMEGANTRY_LOG_LEVEL=info
# Optional: enable editing (generate with: openssl rand -hex 32)
HOMEGANTRY_ADMIN_TOKEN=change-me-use-a-long-random-tokenHOMEGANTRY_HOST Explained
This is the most important variable for most setups. It tells HomeGantry what IP or hostname to use when building clickable URLs for services that don't have an explicit URL set.
URL resolution order:
homegantry.urllabel on the container (explicit)homepage.hreflabel (ifHOMEGANTRY_HOMEPAGE_COMPATis enabled)- Traefik API router (if
HOMEGANTRY_TRAEFIK_API_URLis set) - Traefik
Host()rule in the container's labels http://{HOMEGANTRY_HOST}:{container_port}(fallback,localhostwhenHOMEGANTRY_HOSTis empty)
If none of the above apply, the service has no link. Only http(s) URLs are used, and user:pass@ is removed.