Prerequisites
To build from source you need:- Rust 1.86+ — install via rustup
- npm 10+ — required to build the admin UI
Build from source
Build the admin UI
The UI is a separate npm project that gets embedded into the binary at compile time.
Build the binary
Return to the repository root and build a release binary with the This runs
ui feature enabled.cargo build --release --features ui and places the binary at ./target/release/agentgateway.Running Agentgateway
- Release binary
- cargo run
Pass a configuration file with the
-f flag:http://localhost:15000/ui to access the admin UI.
Configuration file
Agentgateway accepts a JSON or YAML configuration file. The example below is frommanifests/localhost-config.json in the repository — it starts an SSE listener on port 8080 with JWT authentication and connects to a local XDS control plane:
localhost-config.json
Static configuration options
The following fields under theconfig key control the server’s built-in listeners. All values are strings in ip:port format.
| Field | Description | Default |
|---|---|---|
config.adminAddr | Admin UI address | 0.0.0.0:15000 |
config.statsAddr | Prometheus metrics address | 0.0.0.0:15020 |
config.readinessAddr | Readiness probe address | 0.0.0.0:15021 |
config.workerThreads | Number of Tokio worker threads | CPU count |
Example static config block
config.yaml
Environment variables
Several settings can be overridden with environment variables without changing the config file:| Variable | Description |
|---|---|
CARGO_NET_GIT_FETCH_WITH_CLI | Use git CLI for Cargo dependency fetches (required in some corporate networks) |
DNS_EDNS0 | Enable or disable EDNS0 in the DNS resolver (true / false) |
VERSION | Version string embedded in the binary at build time |
GIT_REVISION | Git revision string embedded in the binary at build time |
Session encryption
To enable encrypted session tokens, generate a 32-byte key and add it to your configuration:config.yaml
Signal handling and graceful shutdown
Agentgateway responds to standard POSIX signals:SIGTERM— begins a graceful shutdown, waiting for in-flight requests to complete before exitingSIGINT(Ctrl+C) — same asSIGTERM; safe for interactive use
config.yaml
Configuration file watching
When running in static (non-XDS) mode, Agentgateway watches the config file for changes and reloads dynamically without restarting the process. This means you can update routing rules, policies, or backend addresses and have them take effect within seconds.Production considerations
Use the release build
Always run
make build (which sets --release) in production. Debug builds are significantly slower and produce much larger binaries.Set worker threads
Set
config.workerThreads to match the number of CPU cores available to the process, especially when running inside a container with a CPU limit.Secure the admin UI
Bind
config.adminAddr to a loopback address (127.0.0.1:15000) or an internal network interface in production environments. The admin UI has no built-in authentication.Enable session encryption
Generate a
config.session.key with openssl rand -hex 32 and store it in a secrets manager. Rotate the key during scheduled maintenance windows.