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

# Application variables

> Learn more about configurable application variables, including gateway cluster ID and application mode.

## GATEWAY\_APPLICATION\_CA\_CERTIFICATE\_FILE

When using certificates with TLS, this variable allows you to set the application CA. This is set on the application level since the CA should be used for all runner, server, and client implementations.

### Environment Variable

`GATEWAY_APPLICATION_CA_CERTIFICATE_FILE`

### File

**Section:** `application`

**Key:** `ca_certificate_file`

### Default

No default value provided

---

## GATEWAY\_APPLICATION\_CLUSTER\_ID

The `ID` that uniquely identifies your gateway instance or a cluster of related gateway instances. This is also used to link a gateway controller node to Gateway Manager so that automations can be sent to a particular cluster.

### Environment Variable

`GATEWAY_APPLICATION_CLUSTER_ID`

### File

**Section:** `application`

**Key:** `cluster_id`

### Default

`cluster_1`

---

## GATEWAY\_APPLICATION\_MODE

Sets the operation mode that the application operates in. Gateway can run in four distinct modes. For more information, see [Application modes](./application-modes).

### File

**Section:** `application`

**Key:** `application_mode`

### Default

`local`

### Possible Values

`["local", "client", "server", "runner"]`

---

## GATEWAY\_APPLICATION\_VENV\_RETENTION\_PERIOD

Gateway 5.4+

Sets how long a virtual environment may be idle before the pruner removes it. An environment is considered idle when it has not been used for a duration exceeding this value. Accepts Go duration strings (`12h`, `720h`) or plain day values (`1d`, `30d`).

Setting this value too low can cause environments to be pruned between uses, forcing a full dependency reinstall on the next execution.

For more information, see [Python virtual environments](./python-virtual-environments).

### Environment Variable

`GATEWAY_APPLICATION_VENV_RETENTION_PERIOD`

### File

**Section:** `application`

**Key:** `venv_retention_period`

### Default

`30d`

---

## GATEWAY\_APPLICATION\_VENV\_SWEEP\_INTERVAL

Gateway 5.4+

Sets how often the background pruner scans for idle virtual environments and removes those that exceed the retention period. Accepts Go duration strings (`12h`, `720h`) or plain day values (`1d`, `30d`).

For more information on virtual environment pruning, see [Python virtual environments](./python-virtual-environments).

### Environment Variable

`GATEWAY_APPLICATION_VENV_SWEEP_INTERVAL`

### File

**Section:** `application`

**Key:** `venv_sweep_interval`

### Default

`24h`

---

## GATEWAY\_APPLICATION\_WORKING\_DIR

Sets the location where the gateway stores various working files. Examples include the database when `GATEWAY_STORE_BACKEND=local`, the `gateway.log` file when you run the gateway as a client, and the SSH `known_hosts` file.

### Environment Variable

`GATEWAY_APPLICATION_WORKING_DIR`

### File

**Section:** `application`

**Key:** `working_dir`

### Default

Home directory of user running gateway
`~/.gateway.d`