> ## 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. Get `LICENSE_KEY` (and, in connected mode, `EDGEE_SIGNATURE_KEY`) from the Edgee Console under **Org settings → On-Premise → Reveal deployment secrets**.

<Tabs>
  <Tab title="Connected">
    The gateway fetches its configuration from Edgee on startup and keeps it in sync, and reports telemetry to your own OTLP collector.

    ```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}
          # Telemetry: export usage to Edgee for the team dashboard.
          TELEMETRY_ENABLED: "true"
          OTEL_EXPORTER_OTLP_ENDPOINT: https://onprem-logs.edgee.ai/v1/logs
        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.
  </Tab>

  <Tab title="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
          # 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. The full config schema lives in the open-source repo: [`edgee-ai/edgee`](https://github.com/edgee-ai/edgee).
  </Tab>
</Tabs>

<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.
</Warning>

<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.
</Note>
