| title | Router Environment Variable Configuration Reference |
|---|---|
| subtitle | |
| description | Reference of YAML configuration properties for Apollo GraphOS Router and Apollo Router Core. |
This reference covers the environment variables for configuring an Apollo Router.
This section lists and describes the environment variables you can set when running the router binary.
These environment variables apply only if your supergraph schema is managed by GraphOS.
When running Apollo Router locally with a schema fetched from Uplink, the API key must have at least the Observer role; keys with lower privileges cannot retrieve the schema.
| Environment Variable | Description |
|---|---|
|
The graph ref for the GraphOS graph and variant that the router fetches its supergraph schema from (e.g., Required when using managed federation, except when using an offline license to run the router. |
|
|
The graph API key that the router should use to authenticate with GraphOS when fetching its supergraph schema. Required when using managed federation, except when using an offline license to run the router or when using |
|
|
A path to a file containing the graph API key that the router should use to authenticate with GraphOS when fetching its supergraph schema. Required when using managed federation, except when using an offline license to run the router or when using |
|
|
An OCI reference to a graph artifact that contains the supergraph schema. The reference must use a SHA256 digest format. When you set this option, the router uses the schema from the specified graph artifact instead of Apollo Uplink. The router still fetches entitlements and persisted queries from Uplink. For information on finding graph artifact references, see Graph Artifacts. |
|
|
A comma-separated list of registry hostnames to use HTTP instead of HTTPS when fetching graph artifacts. When this variable is not set, Router defaults to allowing HTTP for When this variable is set to a non-empty value, only the specified hosts use HTTP and the defaults are replaced. For example, to allow HTTP for a custom internal registry and APOLLO_GRAPH_ARTIFACT_UNSECURE_HOSTS="internal.registry.corp,localhost"When this variable is set to an empty string ( |
To use environment variables when running router, you must set them before the router command:
APOLLO_KEY="..." APOLLO_GRAPH_REF="..." ./routerAPOLLO_KEY="..." APOLLO_GRAPH_ARTIFACT_REFERENCE="artifact.api.apollographql.com/my-graph-a50b9d546b298e5a@sha256:14409db3d8a8d74ff9e9a0b5712c0aa8d574bcacc3656e1bc0c55ecf97cd9264" ./router