> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Configuration variables

> Learn more about configurable environment vairables in Gateway.

You can set configuration variables for each gateway using an environment variable or a configuration file. The system reads configuration variables in the following priority order:

1. Environment variable (for example, `GATEWAY_APPLICATION_WORKING_DIR`)
2. A single configuration file. The system uses the following location precedent:
   1. Path passed using `--config <path>` from the CLI when you launch the gateway
   2. Path set using `GATEWAY_CONFIG` environment variable\

   3. `~/.gateway.d/gateway.conf`\

   4. `/etc/gateway/gateway.conf`\

3. Default value

To view loaded configuration variables in a gateway, run:

```bash
iagctl version --show-config
```

## Example configuration file

When you create a configuration file, reference this example as a starting point:

```bash
[application]
mode                = local
ca_certificate_file = 
cluster_id          = cluster_1
working_dir         = ~/.gateway.d
venv_sweep_interval     = 24h
venv_retention_period   = 30d

[client]
certificate_file =
host             =
port             = 50051
private_key_file =
use_tls          = true
 
# Named client profiles — override individual client settings per cluster.
# Profiles inherit unset values from the base [client] section.
# Use with: iagctl --profile <profile_name> <command>
# For more information, see Configure client profiles.
[client:production]
host             = gw.prod.example.com
certificate_file = ~/.gateway.d/certs/prod.crt
private_key_file = ~/.gateway.d/certs/prod.key
 
[client:staging]
host             = gw.staging.example.com
 
[connect]
certificate_file     = /etc/gateway/gw-manager.pem
private_key_file     = /etc/gateway/gw-manager-key.pem
enabled              = true
server_ha_enabled    = false
server_ha_is_primary = false
hosts                = 
 
[features]
ansible_enabled  = true
hostkeys_enabled = true
mcp_enabled      = true
opentofu_enabled = true
python_enabled   = true
 
[log]
console_json       = false
file_enabled       = true
file_json          = false
level              = INFO
server_dir         = /var/log/gateway
timestamp_timezone = utc

[metrics]
collection_enabled = false
endpoint_enabled   = false
listen_address     = 127.0.0.1
port               = 9091

[registry]
default_overridable = true

[runner]
announcement_address =
certificate_file     =
listen_address       = 127.0.0.1
port                 = 50051
private_key_file     =
runtime_data_dir     = /var/lib/gateway
use_tls              = true
 
[registry]
default_overridable = true
 
[secrets]
encrypt_key_file =
 
[server]
api_key_expiration     = 1440
certificate_file       =
distributed_execution  = true
listen_address         = 127.0.0.1
port                   = 50051
private_key_file       =
runtime_data_dir       = /var/lib/gateway
use_tls                = true
 
[store]
backend                  = local
etcd_hosts               = "localhost:2379" # space separated list
etcd_use_tls             = true
etcd_ca_certificate_file =
etcd_certificate_file    =
etcd_client_cert_auth    = false
etcd_private_key_file    =
 
[terminal]
no_color           = false
timestamp_timezone = utc
```

## Learn more

For more detailed information on the available configuration variables, see:

* [Application variables](./gateway-application-variables)
* [Client variables](./gateway-client-variables)
* [Connect variables](./gateway-connect-variables)
* [Features variables](./gateway-feature-variables)
* [Log variables](./gateway-log-variables)
* [Metrics variables](./gateway-metrics-variables)
* [Registry variables](./gateway-registry-variables)
* [Runner variables](./gateway-runner-variables)
* [Secrets variables](./gateway-secrets-variables)
* [Server variables](./gateway-server-variables)
* [Store variables](./gateway-store-variables)
* [Terminal variables](./gateway-terminal-variables)