> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/agentgateway/agentgateway/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Agentgateway from source, pre-built binaries, or Docker.

Agentgateway is a single binary written in Rust. Choose the installation method that fits your environment.

<Tabs>
  <Tab title="Build from source">
    Building from source gives you the latest code and the ability to customize the build.

    ## Requirements

    | Dependency   | Minimum version    |
    | ------------ | ------------------ |
    | Rust + Cargo | 1.86+              |
    | npm          | 10+                |
    | make         | Any recent version |

    Install Rust via [rustup](https://rustup.rs):

    ```bash theme={null}
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    ```

    Install Node.js and npm via [nodejs.org](https://nodejs.org) or your system package manager.

    ## Clone the repository

    ```bash theme={null}
    git clone https://github.com/agentgateway/agentgateway.git
    cd agentgateway
    ```

    ## Build the UI

    Agentgateway ships with a built-in admin UI. Build it first so it can be embedded into the binary:

    ```bash theme={null}
    cd ui
    npm install
    npm run build
    cd ..
    ```

    ## Build the binary

    ```bash theme={null}
    export CARGO_NET_GIT_FETCH_WITH_CLI=true
    make build
    ```

    The compiled binary is placed at:

    ```
    ./target/release/agentgateway
    ```

    <Tip>
      For faster incremental builds during development, use the `quick-release` profile:

      ```bash theme={null}
      cargo build --profile quick-release
      ```

      This trades some optimization for faster compile times — suitable for development but not production.
    </Tip>

    ## Verify the installation

    ```bash theme={null}
    ./target/release/agentgateway --version
    ```
  </Tab>

  <Tab title="Pre-built binary">
    Pre-built binaries are available for Linux and macOS on the [GitHub Releases](https://github.com/agentgateway/agentgateway/releases) page.

    ## Download and install

    <CodeGroup>
      ```bash Linux (x86_64) theme={null}
      # Download the latest release
      curl -LO https://github.com/agentgateway/agentgateway/releases/latest/download/agentgateway-linux-amd64

      # Make it executable and move to your PATH
      chmod +x agentgateway-linux-amd64
      sudo mv agentgateway-linux-amd64 /usr/local/bin/agentgateway
      ```

      ```bash Linux (arm64) theme={null}
      # Download the latest release
      curl -LO https://github.com/agentgateway/agentgateway/releases/latest/download/agentgateway-linux-arm64

      # Make it executable and move to your PATH
      chmod +x agentgateway-linux-arm64
      sudo mv agentgateway-linux-arm64 /usr/local/bin/agentgateway
      ```

      ```bash macOS (Apple Silicon) theme={null}
      # Download the latest release
      curl -LO https://github.com/agentgateway/agentgateway/releases/latest/download/agentgateway-darwin-arm64

      # Make it executable and move to your PATH
      chmod +x agentgateway-darwin-arm64
      sudo mv agentgateway-darwin-arm64 /usr/local/bin/agentgateway
      ```
    </CodeGroup>

    ## Verify the installation

    ```bash theme={null}
    agentgateway --version
    ```

    <Note>
      Always check the [releases page](https://github.com/agentgateway/agentgateway/releases) to confirm the exact binary names for each release, as naming conventions may vary between versions.
    </Note>
  </Tab>

  <Tab title="Docker">
    The official Agentgateway Docker image is published to the GitHub Container Registry.

    ## Pull the image

    ```bash theme={null}
    docker pull ghcr.io/agentgateway/agentgateway:latest
    ```

    ## Run with a config file

    Mount your `config.yaml` into the container and pass it via the `-f` flag:

    ```bash theme={null}
    docker run --rm \
      -p 3000:3000 \
      -p 15000:15000 \
      -v $(pwd)/config.yaml:/config.yaml \
      ghcr.io/agentgateway/agentgateway:latest \
      -f /config.yaml
    ```

    This exposes:

    * **Port 3000** — the MCP/A2A proxy listener (matches the basic example config)
    * **Port 15000** — the admin API and UI

    ## Build the image locally

    The project includes a multi-stage `Dockerfile` that builds both the UI and the Rust binary:

    ```bash theme={null}
    docker build -t agentgateway:local .
    ```

    The image uses a [Chainguard](https://chainguard.dev) `glibc-dynamic` base for a minimal, hardened runtime layer. Targets for both `linux/amd64` and `linux/arm64` are supported via the `TARGETARCH` build argument.

    <Tip>
      To build for a specific architecture:

      ```bash theme={null}
      docker buildx build --platform linux/arm64 -t agentgateway:arm64 .
      ```
    </Tip>

    ## Compose example

    ```yaml docker-compose.yml theme={null}
    services:
      agentgateway:
        image: ghcr.io/agentgateway/agentgateway:latest
        command: ["-f", "/config.yaml"]
        ports:
          - "3000:3000"
          - "15000:15000"
        volumes:
          - ./config.yaml:/config.yaml
    ```
  </Tab>
</Tabs>

## Running Agentgateway

Once installed, start the gateway by pointing it at a config file:

<CodeGroup>
  ```bash Binary theme={null}
  ./target/release/agentgateway -f config.yaml
  ```

  ```bash Installed in PATH theme={null}
  agentgateway -f config.yaml
  ```

  ```bash cargo run theme={null}
  cargo run -- -f config.yaml
  ```
</CodeGroup>

With no config file provided, Agentgateway starts with an empty configuration and exposes only the admin interface.

## Admin UI

Agentgateway includes a built-in admin UI available at:

```
http://localhost:15000/ui
```

The UI lets you inspect the running configuration, browse connected backends, and view active listeners and routes — without restarting the process.

<Note>
  The admin interface listens on port **15000** by default. This is separate from your proxy listener port (e.g., 3000 in the basic example). Do not expose port 15000 publicly in production.
</Note>

## Environment variables

| Variable                       | Description                                                                                                                                  |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `CARGO_NET_GIT_FETCH_WITH_CLI` | Set to `true` when building from source to use the system `git` for fetching dependencies. Required in some restricted network environments. |
| `RUST_LOG`                     | Controls log verbosity. Example: `RUST_LOG=info agentgateway -f config.yaml`. Accepts `error`, `warn`, `info`, `debug`, `trace`.             |
| `VERSION`                      | Embedded at build time to set the version string reported by `--version`.                                                                    |
| `GIT_REVISION`                 | Embedded at build time alongside `VERSION` for traceability.                                                                                 |

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Run the basic MCP proxy example end-to-end.
  </Card>

  <Card title="MCP Proxy Guide" icon="plug" href="/guides/mcp-proxy">
    Configure authentication, authorization, and observability for MCP.
  </Card>

  <Card title="Docker deployment" icon="docker" href="/deployment/docker">
    Production Docker deployment patterns and best practices.
  </Card>

  <Card title="Kubernetes deployment" icon="dharmachakra" href="/deployment/kubernetes">
    Deploy Agentgateway on Kubernetes using the Gateway API.
  </Card>
</CardGroup>
