> ## Documentation Index
> Fetch the complete documentation index at: https://www.edgee.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Compose

> Run the Edgee AI Gateway with Docker Compose, connected or headless.

Run the gateway on a single host with Docker Compose. Save the compose file as `compose.yml`, put a `.env` beside it, then run:

```bash theme={"dark"}
docker compose up -d
```

The gateway listens on port `8080`. Check that it is healthy:

```bash theme={"dark"}
curl http://localhost:8080/status
```

Pick the mode that matches your deployment. Connected is the default once `LICENSE_KEY` is set. Get `LICENSE_KEY` (and, in connected mode, `EDGEE_SIGNATURE_KEY`) from the Edgee Console under **Org settings → On-Premise → Reveal deployment secrets**.

> [tab] Connected
>
> The gateway fetches its configuration from Edgee on startup and keeps it in sync, and exports usage metering automatically — see below.
>
> ```yaml compose.yml theme={"dark"}
> services:
>   gateway:
>     image: ghcr.io/edgee-ai/gateway:latest
>     ports:
>       - "8080:8080"
>     environment:
>       ENV: prod
>       # Identifies your org and authorizes the gateway to pull its config from Edgee.
>       LICENSE_KEY: ${LICENSE_KEY}
>       EDGEE_SIGNATURE_KEY: ${EDGEE_SIGNATURE_KEY}
>     restart: unless-stopped
> ```
>
> ```bash .env theme={"dark"}
> LICENSE_KEY=<reveal in console>
> EDGEE_SIGNATURE_KEY=<reveal in console>
> ```
>
> In connected mode the gateway also exports usage metering to Edgee at `https://onprem-logs.edgee.ai/v1/logs`, authenticated with your `LICENSE_KEY`, so usage shows up in the team dashboard. Override the destination with `USAGE_OTLP_ENDPOINT` (and `USAGE_OTLP_HEADERS`) to send it to your own collector instead — the license-key auth is still sent by default to that custom collector too; set `USAGE_OTLP_USE_LICENSE_AUTH: "false"` in `environment` to opt out.

> [tab] Headless
>
> Air-gapped. The gateway runs with your own `gateway.toml`, mounted read-only. Nothing is fetched from or sent to Edgee. The license is still required.
>
> ```yaml compose.yml theme={"dark"}
> services:
>   gateway:
>     image: ghcr.io/edgee-ai/gateway:latest
>     ports:
>       - "8080:8080"
>     volumes:
>       # Your own config, authored locally — never fetched from Edgee.
>       - ./gateway.toml:/etc/edgee/gateway.toml:ro
>     environment:
>       ENV: prod
>       CONFIG_FILE: /etc/edgee/gateway.toml
>       # Opt out of the default connected mode.
>       EDGEE_API_SYNC: "false"
>       # Validated locally against the embedded key — no outbound calls.
>       LICENSE_KEY: ${LICENSE_KEY}
>       TELEMETRY_ENABLED: "false"
>     restart: unless-stopped
> ```
>
> ```bash .env theme={"dark"}
> LICENSE_KEY=<reveal in console>
> ```
>
> Author your `gateway.toml` next to the compose file. See [Headless configuration](https://www.edgee.ai/docs/self-hosting/configuration.md) for the file structure, credentials, and verification steps.

> [!WARNING]
>
> Keep `LICENSE_KEY` and `EDGEE_SIGNATURE_KEY` out of version control. Store them in the `.env` file (add it to `.gitignore`) or inject them from your secret manager.

> [!NOTE]
>
> For production, pin the image to a released tag (for example `ghcr.io/edgee-ai/gateway:1.9.0`) instead of `latest`, so upgrades are deliberate.

## Verify model traffic

After the health check, send an authenticated [test model request](https://www.edgee.ai/docs/self-hosting/configuration.md#verify-a-real-request). Then configure the [CLI gateway endpoint](https://www.edgee.ai/docs/cli/configuration.md) and verify an agent request. A healthy process does not prove that provider credentials or the model registry are correct.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.