Skip to content

Environment Variables ​

All configuration is done through environment variables. None are required — sensible defaults are provided for everything.

Reference ​

VariableDefaultDescription
HOMEGANTRY_PORT3000Port 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_TITLEHomeGantryDashboard title shown in the header
HOMEGANTRY_DOCKER_SOCKET/var/run/docker.sockPath to the Docker socket
HOMEGANTRY_POLL_INTERVAL60Seconds between full Docker rescans. Real-time events are always active; this is a safety-net rescan.
HOMEGANTRY_SHOW_STOPPEDfalseShow stopped containers on the dashboard
HOMEGANTRY_HOMEPAGE_COMPATtrueRead homepage.* Docker labels (for migration from Homepage)
HOMEGANTRY_EXCLUDE_SELFtrueHide the HomeGantry container from its own dashboard
HOMEGANTRY_COMPOSE_ONLYtrueOnly show containers that belong to a Docker Compose project
HOMEGANTRY_DATA_DIR/dataDirectory for persistent JSON data (overrides, settings, manual services)
HOMEGANTRY_LOG_LEVELinfoLog level: debug, info, warn, error
HOMEGANTRY_DEMOfalseDemo mode: a made-up example lab instead of Docker and Traefik, no health-check requests, always read-only.

Icons ​

VariableDefaultDescription
HOMEGANTRY_ICON_SOURCEcdncdn (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.

VariableDefaultDescription
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_READONLYfalseDisable 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.

VariableDefaultDescription
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_TIMEOUT5Seconds 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.

VariableDefaultDescription
HOMEGANTRY_HEALTHCHECKtrueEnable HTTP health checks
HOMEGANTRY_HEALTHCHECK_INTERVAL60Seconds between check rounds (minimum 5)
HOMEGANTRY_HEALTHCHECK_TIMEOUT5Seconds before a request counts as timed out
HOMEGANTRY_HEALTHCHECK_CONCURRENCY8Maximum simultaneous checks
HOMEGANTRY_HEALTHCHECK_INSECURE_TLSfalseAccept 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).

SettingDefaultValuesDescription
dashboardTitleHOMEGANTRY_TITLEtextTitle in the header
columns41-6Maximum grid columns on wide screens (phones always use one)
showStatustruetrue, falseShow the status on each card
showStoppedHOMEGANTRY_SHOW_STOPPEDtrue, falseShow (and search) stopped containers
layoutgridgrid, listCards or rows
groupBycategorycategory, stack, hostHow 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 ​

bash
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-token

HOMEGANTRY_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:

  1. homegantry.url label on the container (explicit)
  2. homepage.href label (if HOMEGANTRY_HOMEPAGE_COMPAT is enabled)
  3. Traefik API router (if HOMEGANTRY_TRAEFIK_API_URL is set)
  4. Traefik Host() rule in the container's labels
  5. http://{HOMEGANTRY_HOST}:{container_port} (fallback, localhost when HOMEGANTRY_HOST is empty)

If none of the above apply, the service has no link. Only http(s) URLs are used, and user:pass@ is removed.

Released under the MIT License.