> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/gateway/reference/configuration.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# Configuration file (gateway.json)

Every Devolutions Gateway gateway.json setting: type, default, allowed values, validation errors, file location and environment variables.

***Devolutions Gateway*** reads all its settings from one JSON file, `gateway.json`. This page lists every setting of that file with its type, default value and allowed values, the errors Devolutions Gateway reports when a value is wrong, and the environment variables that change where Devolutions Gateway looks for its files.

{% hint style="warning" %}
`gateway.json` and the files next to it hold private keys and passwords. Only administrators and the account that runs the Devolutions Gateway service should be able to read the folder.
{% endhint %}

## Where the file is

<table><thead><tr><th width="200">PLATFORM</th><th>FOLDER OF gateway.json</th></tr></thead><tbody><tr><td><strong>Windows</strong></td><td><code>%ProgramData%\Devolutions\Gateway\</code>, usually <code>C:\ProgramData\Devolutions\Gateway\</code></td></tr><tr><td><strong>Linux</strong></td><td><code>/etc/devolutions-gateway/</code>. The packages create the folder with mode <code>750</code> and <code>gateway.json</code> with mode <code>600</code>.</td></tr><tr><td><strong>Docker container</strong></td><td><code>/tmp/devolutions-gateway/</code>, set by <code>DGATEWAY_CONFIG_PATH</code> in the image. The container rewrites the file from its environment variables at every start.</td></tr></tbody></table>

The same folder is the Devolutions Gateway data folder: every relative path in `gateway.json` (certificate, keys, recordings, logs, databases, users file) is resolved from it. An absolute path is used as written.

## How the file is created and changed

* **Created automatically.** When `gateway.json` doesn't exist, Devolutions Gateway writes a default one at startup. The Windows installer and the Linux packages create it by running `devolutions-gateway --config-init-only`, which never overwrites an existing file.
* **Default content.** A new file has a random `Id`, `"ProvisionerPublicKeyFile": "provisioner.pem"`, `"TlsVerifyStrict": true` and two listeners: `tcp://*:8181` (external URL `tcp://*:8181`) and `http://*:7171` (external URL `https://*:7171`). The HTTP listener listens without TLS until you configure a certificate and change its internal URL to `https://*:7171`.
* **Edited by hand or with PowerShell.** Edit the file in a text editor, or use the [Devolutions Gateway PowerShell module](https://docs.devolutions.net/gateway/reference/powershell-module.md). Restart the Devolutions Gateway service after a change: Devolutions Gateway reads the file when the service starts.
* **Changed by Devolutions Server and Devolutions Cloud.** The Devolutions Gateway configuration API accepts changes to three settings only: `Id`, `SubProvisionerPublicKey` and `Subscriber`; any other setting is refused with "patch request contains a key that is not allowed". ***Publish Gateway configuration*** in Devolutions Server or Devolutions Cloud uses it to write the `Id` they expect. Devolutions Gateway validates the new configuration, saves it and applies it without a restart.
* **Unknown settings are kept.** When Devolutions Gateway rewrites the file, it keeps root settings it doesn't recognize.
* **Names are case sensitive.** Setting names use PascalCase, as in this page.

{% hint style="warning" %}
The Devolutions Gateway PowerShell module rewrites `gateway.json` with only the settings it knows. When a cmdlet such as `Set-DGatewayConfig`, `Set-DGatewayHostname`, `Set-DGatewayListeners`, `Import-DGatewayCertificate` or `New-DGatewayProvisionerKeyPair` saves the file, these settings are removed: `TlsVerifyStrict`, `CredSspCertificateFile`, `CredSspPrivateKeyFile`, `CredSspPrivateKeyPassword`, `MinRecordingStorageFreeSpace`, `Proxy`, `LogFile`, `JrlFile`, `JobQueueDatabase`, `TrafficAuditDatabase`, the inline `*Data` keys and `Plugins`. When `WebApp` contains a key the module doesn't know, such as `StaticRootPath`, the whole `WebApp` section is removed and the standalone web application turns off. Check the file after running a cmdlet and add these settings back, in particular `"TlsVerifyStrict": true`. See [Manage Devolutions Gateway with PowerShell](https://docs.devolutions.net/gateway/for-administrators/powershell.md). Without `TlsVerifyStrict`, Devolutions Gateway falls back to non-strict certificate checks.
{% endhint %}

## Identity

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Id</strong></td><td>Unique ID of this Devolutions Gateway, a UUID such as <code>123e4567-e89b-12d3-a456-426614174000</code>. Generated at random when the file is created. Devolutions Server and Devolutions Cloud store the same ID and issue tokens for it: a token issued for another ID is refused with "gateway ID scope mismatch". <em><strong>Publish Gateway configuration</strong></em> writes the ID that Devolutions Server or Devolutions Cloud expects.</td></tr><tr><td><strong>Hostname</strong></td><td>Host name of this Devolutions Gateway. Replaces <code>*</code> in the <code>ExternalUrl</code> of listeners, names the self-signed CredSSP certificate, and is compared with <code>TlsCertificateSubjectName</code>. Default: the computer name, or <code>localhost</code> when it can't be read.</td></tr></tbody></table>

## Keys

Devolutions Gateway checks every session token with the provisioner public key. Devolutions Server and Devolutions Cloud sign the tokens with the matching private key.

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>ProvisionerPublicKeyFile</strong></td><td>Path of the provisioner public key, PEM format. Required unless <code>ProvisionerPublicKeyData</code> is set. Default in a new file: <code>provisioner.pem</code>. With Devolutions Server or Devolutions Cloud, this is the public key downloaded from their Devolutions Gateway page. Error when neither setting is present: "provisioner public key is missing (no path nor inlined data provided)".</td></tr><tr><td><strong>ProvisionerPublicKeyData</strong></td><td>The provisioner public key written in the file instead of a path: an object with <code>Value</code>, <code>Format</code> (<code>Spki</code>, the default, or <code>Pkcs1</code>, also accepted as <code>Rsa</code>) and <code>Encoding</code> (<code>Multibase</code>, the default, <code>Base64</code>, <code>Base64Pad</code>, <code>Base64Url</code> or <code>Base64UrlPad</code>). When both are set, <code>ProvisionerPublicKeyFile</code> wins.</td></tr><tr><td><strong>ProvisionerPrivateKeyFile</strong></td><td>Path of the provisioner private key, PEM format. Used only by the standalone web application, to issue its own session tokens. Required when <code>WebApp.Enabled</code> is <code>true</code>: "provisioner private key must be specified when the standalone web application is enabled".</td></tr><tr><td><strong>ProvisionerPrivateKeyData</strong></td><td>The provisioner private key written in the file: <code>Value</code>, <code>Format</code> (<code>Pkcs8</code>, the default, <code>Pkcs1</code> also accepted as <code>Rsa</code>, or <code>Ec</code>) and <code>Encoding</code> (same values as above).</td></tr><tr><td><strong>SubProvisionerPublicKey</strong></td><td>Additional public key that can only verify session tokens: an object with <code>Id</code>, <code>Value</code>, <code>Format</code> and <code>Encoding</code>. Tokens signed with this key are refused when they are valid for more than 2 hours. Can also be set through the Devolutions Gateway configuration API.</td></tr><tr><td><strong>DelegationPrivateKeyFile</strong></td><td>Path of the delegation private key, PEM format. Devolutions Gateway uses it to decrypt credentials sent inside a token, for proxy-based credential injection. Without it, a token that carries encrypted credentials is refused with "delegation key is missing".</td></tr><tr><td><strong>DelegationPrivateKeyData</strong></td><td>The delegation private key written in the file: <code>Value</code>, <code>Format</code> and <code>Encoding</code>, as for <code>ProvisionerPrivateKeyData</code>.</td></tr></tbody></table>

## TLS certificate

The TLS certificate secures the `https` and `wss` listeners. A listener whose internal URL starts with `https://` or `wss://` needs one.

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>TlsCertificateSource</strong></td><td>Where the certificate comes from: <code>External</code> (default, a file) or <code>System</code> (the Windows certificate store). <code>System</code> works on Windows only; elsewhere: "system certificate store not supported for this platform".</td></tr><tr><td><strong>TlsCertificateFile</strong></td><td>Certificate file, with <code>TlsCertificateSource</code> = <code>External</code>. Either a PEM file with the certificate chain (labels <code>CERTIFICATE</code>, <code>X509 CERTIFICATE</code> or <code>TRUSTED CERTIFICATE</code>) or a <code>.pfx</code> / <code>.p12</code> file, from which Devolutions Gateway takes the server certificate and its private key. The older name <code>CertificateFile</code> is also accepted. Required for an HTTPS listener: "TLS usage implied, but TLS certificate file is missing".</td></tr><tr><td><strong>TlsPrivateKeyFile</strong></td><td>Private key of a PEM certificate, PEM format (labels <code>PRIVATE KEY</code>, <code>RSA PRIVATE KEY</code> or <code>EC PRIVATE KEY</code>). Not used with a <code>.pfx</code> or <code>.p12</code> file. The older name <code>PrivateKeyFile</code> is also accepted. Error when missing: "TLS private key file is missing".</td></tr><tr><td><strong>TlsPrivateKeyPassword</strong></td><td>Password of an encrypted <code>.pfx</code> or <code>.p12</code> file. The password is stored in clear text in <code>gateway.json</code>, so Devolutions Gateway logs at startup: "Detected TlsPrivateKeyPassword option. This option doesn’t inherently enhance security beyond using a plain, unencrypted private key."</td></tr><tr><td><strong>TlsCertificateSubjectName</strong></td><td>Subject name of the certificate to take from the Windows certificate store, with <code>TlsCertificateSource</code> = <code>System</code>. Required for an HTTPS listener: "TLS usage implied, but TLS certificate subject name is missing". When it doesn't match <code>Hostname</code>, Devolutions Gateway logs "Hostname doesn't match the TLS certificate subject name configured; not necessarily a problem if it is instead matched by an alternative subject name".</td></tr><tr><td><strong>TlsCertificateStoreName</strong></td><td>Windows certificate store to search. Default: <code>My</code> (the <em><strong>Personal</strong></em> store).</td></tr><tr><td><strong>TlsCertificateStoreLocation</strong></td><td>Location of that store: <code>CurrentUser</code> (default), <code>CurrentService</code> or <code>LocalMachine</code>. The account that runs the Devolutions Gateway service must be able to read the private key of the certificate.</td></tr><tr><td><strong>TlsVerifyStrict</strong></td><td><code>true</code> or <code>false</code>. When <code>true</code>, Devolutions Gateway refuses a certificate without the Subject Alternative Name (SAN) extension or without the Extended Key Usage (EKU) <code>serverAuth</code>: a certificate file fails at startup, and the Windows certificate store skips such certificates. A new <code>gateway.json</code> sets it to <code>true</code>. When the setting is absent, Devolutions Gateway uses <code>false</code> and logs "TlsVerifyStrict option is not set, defaulting to false. This may hide latent issues."; when it is <code>false</code>, it logs "TlsVerifyStrict option is explicitly set to false. This may hide latent issues." Devolutions recommends <code>true</code>: browsers such as Google Chrome and macOS refuse certificates that fail these checks.</td></tr></tbody></table>

How Devolutions Gateway picks a certificate in the Windows certificate store: among the certificates that match `TlsCertificateSubjectName` in the chosen store, it skips those that aren't valid yet and, with `TlsVerifyStrict` = `true`, those without SAN or EKU `serverAuth`, then takes the one that expires last and whose private key it can use. It looks again during TLS handshakes (at most every 45 seconds), so a renewed certificate with the same subject name is used without restarting the service. A certificate file is read when the service starts: restart the service after replacing it. See [Use the Windows certificate store](https://docs.devolutions.net/gateway/guides/certificates/windows-certificate-store.md).

## CredSSP certificate (credential injection)

These settings choose the certificate Devolutions Gateway shows to Remote Desktop Manager during proxy-based credential injection for RDP. They are optional.

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>CredSspCertificateFile</strong></td><td>Certificate file, PEM or <code>.pfx</code> / <code>.p12</code>, like <code>TlsCertificateFile</code>. When absent, Devolutions Gateway uses the TLS certificate. When there is no TLS certificate either, it generates a self-signed RSA 2048-bit certificate for <code>Hostname</code>, valid 730 days, in memory only, the first time it needs one.</td></tr><tr><td><strong>CredSspPrivateKeyFile</strong></td><td>Private key of a PEM CredSSP certificate. Error when missing: "CredSSP private key file is missing".</td></tr><tr><td><strong>CredSspPrivateKeyPassword</strong></td><td>Password of an encrypted CredSSP <code>.pfx</code> or <code>.p12</code> file, stored in clear text.</td></tr></tbody></table>

## Listeners

`Listeners` is a list of objects with two settings each. Devolutions Gateway needs at least one HTTP-capable listener (`http`, `https`, `ws` or `wss`), or an ngrok HTTP tunnel: "at least one HTTP-capable listener is required".

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>InternalUrl</strong></td><td>Address and port Devolutions Gateway listens on, such as <code>https://*:7171</code> or <code>tcp://*:8181</code>. Schemes: <code>tcp</code> (raw TCP listener used by Remote Desktop Manager for native sessions), <code>http</code>, <code>https</code>, <code>ws</code> (same as <code>http</code>) and <code>wss</code> (same as <code>https</code>). Another scheme fails with "unsupported listener scheme: {scheme}". The host <code>*</code> listens on all IPv4 addresses, and on all IPv6 addresses when the computer supports IPv6.</td></tr><tr><td><strong>ExternalUrl</strong></td><td>Address clients use to reach this listener, for example through a reverse proxy or NAT: <code>https://gateway.example.com:7171</code>. The host <code>*</code> is replaced by <code>Hostname</code>. The external URL doesn't change what Devolutions Gateway listens on: it is reported to Devolutions Server and Devolutions Cloud, which use it for <em><strong>Auto-Detect</strong></em> of the TCP host name and port.</td></tr></tbody></table>

When a port is already in use, Devolutions Gateway logs "Failed to bind {url}; retrying in 10s", tries 10 times, then stops with "failed to bind listener: {external URL} -> {internal URL}".

```json
"Listeners": [
  { "InternalUrl": "tcp://*:8181", "ExternalUrl": "tcp://*:8181" },
  { "InternalUrl": "https://*:7171", "ExternalUrl": "https://*:7171" }
]
```

## Session recording

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>RecordingPath</strong></td><td>Folder where Devolutions Gateway stores session recordings, one subfolder per session. Default: <code>recordings</code> in the data folder. A network path works if the service account can write to it. See <a href="https://docs.devolutions.net/gateway/guides/recording/storage.md">Recording storage and path</a>.</td></tr><tr><td><strong>MinRecordingStorageFreeSpace</strong></td><td>Minimum free space, in bytes, on the recording volume. Below this value, Devolutions Gateway refuses new recordings with HTTP 507 Insufficient Storage ("recording storage below minimum free-space threshold"). Absent: no threshold. Devolutions Gateway also refuses recordings when the folder isn't writable, whatever this setting.</td></tr></tbody></table>

## Standalone web application (WebApp)

`WebApp` turns on the web client that Devolutions Gateway serves itself, at `https://<gateway>:7171/jet/webapp/client`, without Devolutions Server or Devolutions Cloud. See [Use the standalone web application](https://docs.devolutions.net/gateway/guides/standalone-web-app.md).

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Enabled</strong></td><td><code>true</code> or <code>false</code>. Required when <code>WebApp</code> is present. When <code>true</code>, <code>ProvisionerPrivateKeyFile</code> (or <code>ProvisionerPrivateKeyData</code>) is required. When <code>false</code> or absent, the address shows "standalone web application not enabled".</td></tr><tr><td><strong>Authentication</strong></td><td>Required when <code>WebApp</code> is present. <code>Custom</code>: users sign in with a user name and password from the users file. <code>None</code>: anyone who can reach the address can open sessions, without signing in.</td></tr><tr><td><strong>UsersFile</strong></td><td>Users file for <code>Custom</code> authentication. Default: <code>users.txt</code> in the data folder. One <code>user:hash</code> line per user; the hash is an Argon2 hash in PHC format. Blank lines and lines starting with <code>#</code> are ignored. Manage it with <code>Set-DGatewayUser</code>, <code>Get-DGatewayUser</code> and <code>Remove-DGatewayUser</code>. Errors: "failed to read file at {path}", "missing separator in users file".</td></tr><tr><td><strong>AppTokenMaximumLifetime</strong></td><td>Longest sign-in duration granted to the web application, in seconds. Default: <code>28800</code> (8 hours). Each session token the web application requests is valid for at most 2 hours.</td></tr><tr><td><strong>LoginLimitRate</strong></td><td>Maximum sign-in attempts per user name and client IP address, per minute, from 0 to 255. Default: <code>10</code>. After that, sign-in fails with "too many login attempts".</td></tr><tr><td><strong>StaticRootPath</strong></td><td>Folder of the web application files. Default: the <code>webapp</code> folder next to <code>DevolutionsGateway.exe</code> on Windows, <code>/usr/share/devolutions-gateway/webapp</code> on Linux. On other platforms it is required: "standalone web application path must be specified manually on this platform". The <code>DGATEWAY_WEBAPP_PATH</code> environment variable overrides it.</td></tr></tbody></table>

## Agent Tunnel (AgentTunnel)

`AgentTunnel` opens a QUIC listener that Devolutions Agent connects to, so Devolutions Gateway reaches networks behind the agent without inbound ports on that network. See [Agent tunnel](https://docs.devolutions.net/gateway/guides/connect/agent-tunnel.md).

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Enabled</strong></td><td><code>true</code> or <code>false</code>. Default: <code>false</code>. When <code>true</code> and the port can't be opened, the service doesn't start: "failed to bind agent tunnel listener". When <code>false</code>, Devolutions Server shows "Agent Tunnel is not enabled on this Gateway. In gateway.json, set AgentTunnel.Enabled = true and restart the Gateway."</td></tr><tr><td><strong>ListenPort</strong></td><td>UDP port of the listener, from 1 to 65535. Default: <code>4433</code>. The listener accepts IPv4 and IPv6.</td></tr></tbody></table>

```json
"AgentTunnel": { "Enabled": true, "ListenPort": 4433 }
```

## Outbound proxy (Proxy)

`Proxy` controls the HTTP or SOCKS proxy Devolutions Gateway uses for its own outbound requests.

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Mode</strong></td><td><code>System</code> (default): use the <code>HTTP_PROXY</code>, <code>HTTPS_PROXY</code> and <code>NO_PROXY</code> environment variables, then the operating system settings (Windows proxy settings with WinHTTP as fallback, <code>/etc/sysconfig/proxy</code> on Red Hat and SUSE-based Linux). <code>Off</code>: never use a proxy, environment variables included. <code>Manual</code>: use the URLs below.</td></tr><tr><td><strong>Http</strong></td><td>Proxy URL for HTTP requests, <code>Manual</code> mode only, for example <code>http://proxy.example.com:8080</code>.</td></tr><tr><td><strong>Https</strong></td><td>Proxy URL for HTTPS requests, <code>Manual</code> mode only.</td></tr><tr><td><strong>All</strong></td><td>Proxy URL for every protocol, used when <code>Http</code> or <code>Https</code> doesn't apply, <code>Manual</code> mode only. The scheme sets the proxy type: <code>http://</code>, <code>socks5://</code> or <code>socks4://</code>.</td></tr><tr><td><strong>Exclude</strong></td><td>Addresses that bypass the proxy, <code>Manual</code> mode only, with the same rules as <code>NO_PROXY</code>: host names, domain suffixes such as <code>.corp.example.com</code>, IP addresses, CIDR ranges, and <code>*</code> for all.</td></tr></tbody></table>

A proxy URL can contain a user name and password (`http://user:password@proxy.example.com:8080`); they are then stored in clear text in `gateway.json`.

## ngrok (Ngrok)

`Ngrok` publishes Devolutions Gateway on the internet through ngrok tunnels, without opening inbound ports. See [Ngrok](https://docs.devolutions.net/gateway/guides/reverse-proxies/ngrok.md).

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>AuthToken</strong></td><td>ngrok authentication token. Required. Stored in clear text.</td></tr><tr><td><strong>HeartbeatInterval</strong></td><td>Optional. Interval of the ngrok heartbeat, in seconds.</td></tr><tr><td><strong>HeartbeatTolerance</strong></td><td>Optional. Heartbeat tolerance, in seconds.</td></tr><tr><td><strong>Metadata</strong></td><td>Optional. Text shown in the ngrok dashboard for the session.</td></tr><tr><td><strong>ServerAddr</strong></td><td>Optional. Address of the ngrok server.</td></tr><tr><td><strong>Tunnels</strong></td><td>Named tunnels. Each tunnel has <code>Proto</code> = <code>http</code> (with <code>Domain</code>, the ngrok domain, and optional <code>CircuitBreaker</code>, a ratio from 0 to 1 of 5XX responses above which requests are refused, and <code>Compression</code>, <code>true</code> or <code>false</code>) or <code>Proto</code> = <code>tcp</code> (with <code>RemoteAddr</code>, such as <code>2.tcp.ngrok.io:21746</code>). Both have optional <code>Metadata</code>, <code>AllowCidrs</code> and <code>DenyCidrs</code>. Set <code>AllowCidrs</code>, for example to <code>0.0.0.0/0</code>, to accept connections.</td></tr></tbody></table>

When ngrok can't start, the service logs "couldn’t create ngrok session".

## Notifications (Subscriber)

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Subscriber</strong></td><td>Optional. Object with <code>Url</code>, an HTTP URL that receives session notification messages, and <code>Token</code>, the bearer token sent with them. Devolutions Gateway then makes outbound requests to that URL.</td></tr></tbody></table>

## Logs and data files

<table><thead><tr><th width="260">SETTING</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>VerbosityProfile</strong></td><td>Level of detail of the logs: <code>Default</code> (information, warnings and errors), <code>Debug</code> (more detail, recommended when Devolutions support asks for logs), <code>Tls</code> (detailed TLS traces, for certificate problems), <code>All</code> (everything; very large logs) or <code>Quiet</code> (warnings and errors only). See <a href="https://docs.devolutions.net/gateway/help/troubleshooting/logs-and-events.md">Logs and event IDs</a>.</td></tr><tr><td><strong>LogFile</strong></td><td>Folder and file name prefix of the log files. Default: <code>gateway</code> in the data folder, which gives files named <code>gateway.*.log</code>. Marked as subject to change by Devolutions.</td></tr><tr><td><strong>JrlFile</strong></td><td>Token revocation list file. Default: <code>jrl.json</code>. Devolutions Server writes it through <em><strong>Publish revocation list</strong></em>. Marked as subject to change.</td></tr><tr><td><strong>JobQueueDatabase</strong></td><td>Database of background jobs. Default: <code>job_queue.db</code>. Marked as subject to change.</td></tr><tr><td><strong>TrafficAuditDatabase</strong></td><td>Database of traffic events that Devolutions Server collects. Default: <code>traffic_audit.db</code>. Marked as subject to change.</td></tr></tbody></table>

The `__debug__` object is reserved for Devolutions development. Don't add it to a production Devolutions Gateway: Devolutions Gateway then logs "**DEBUG OPTIONS ARE ENABLED, PLEASE DO NOT USE IN PRODUCTION**" and writes event 9001.

## Errors when the file can't be used

The service doesn't start and writes the error to `boot.stacktrace` in the data folder and to event 1010 or 1020. See [Logs and event IDs](https://docs.devolutions.net/gateway/help/troubleshooting/logs-and-events.md).

<table><thead><tr><th width="320">ERROR</th><th>CAUSE AND FIX</th></tr></thead><tbody><tr><td>"invalid config file at {path}"</td><td><code>gateway.json</code> isn't valid JSON, or a setting has the wrong type or value. Check commas, quotes and backslashes (write <code>\\</code> in Windows paths) and the allowed values on this page.</td></tr><tr><td>"couldn't open config file at {path}"</td><td>The file exists but can't be read. Check the permissions of the data folder for the service account.</td></tr><tr><td>"invalid configuration file"</td><td>The JSON is valid but a value is refused. The rest of the message names the setting, for example "Listener at position 0".</td></tr><tr><td>"at least one HTTP-capable listener is required"</td><td>No listener uses <code>http</code>, <code>https</code>, <code>ws</code> or <code>wss</code>. Add one.</td></tr><tr><td>"unsupported listener scheme: {scheme}"</td><td>A listener <code>InternalUrl</code> uses another scheme. Use <code>tcp</code>, <code>http</code>, <code>https</code>, <code>ws</code> or <code>wss</code>.</td></tr><tr><td>"invalid internal URL" / "invalid external URL"</td><td>A listener URL can't be read. Write it as <code>scheme://host:port</code>.</td></tr><tr><td>"TLS usage implied, but TLS certificate file is missing"</td><td>An <code>https</code> or <code>wss</code> listener exists but <code>TlsCertificateFile</code> is absent.</td></tr><tr><td>"TLS usage implied, but TLS certificate subject name is missing"</td><td>Same, with <code>TlsCertificateSource</code> = <code>System</code> and no <code>TlsCertificateSubjectName</code>.</td></tr><tr><td>"TLS usage implied but TLS configuration is missing (certificate or/and private key)"</td><td>The TLS configuration is incomplete. Check the certificate and private key settings.</td></tr><tr><td>"TLS private key file is missing"</td><td>A PEM certificate is configured without <code>TlsPrivateKeyFile</code>.</td></tr><tr><td>"bad pem label (got {label}, expected one of {labels}) at position {n}"</td><td>The PEM file doesn't contain what the setting expects, for example a private key in <code>TlsCertificateFile</code>. Swap the files or convert them.</td></tr><tr><td>"couldn't parse first pem document"</td><td>The file isn't PEM. Convert it, or use a <code>.pfx</code> / <code>.p12</code> file with that extension.</td></tr><tr><td>"failed to decode PFX"</td><td>The <code>.pfx</code> / <code>.p12</code> file is damaged or <code>TlsPrivateKeyPassword</code> is wrong.</td></tr><tr><td>"leaf certificate not found" / "leaf private key not found"</td><td>The <code>.pfx</code> / <code>.p12</code> file has no server certificate or no matching private key. Export it again with the private key.</td></tr><tr><td>"found significant issues with the certificate: serial_number = …, subject = …, issuer = …, not_before = …, not_after = …, issues = … (you can set `TlsVerifyStrict` to `false` in the gateway.json configuration file if that's intended)"</td><td>With <code>TlsVerifyStrict</code> = <code>true</code>, the certificate file has no SAN or no EKU <code>serverAuth</code>. Replace it with a certificate that has both. See <a href="https://docs.devolutions.net/gateway/help/troubleshooting/general.md">Devolutions Gateway troubleshooting</a>.</td></tr><tr><td>"no usable certificate found in the system store; observed issues: …"</td><td>No certificate in the chosen Windows store matches <code>TlsCertificateSubjectName</code>, is valid, passes the strict checks and has a readable private key.</td></tr><tr><td>"system certificate store not supported for this platform"</td><td><code>TlsCertificateSource</code> = <code>System</code> on Linux or in a container. Use certificate files.</td></tr><tr><td>"provisioner public key is missing (no path nor inlined data provided)"</td><td>Add <code>ProvisionerPublicKeyFile</code> and the key file.</td></tr><tr><td>"provisioner private key must be specified when the standalone web application is enabled"</td><td>Add <code>ProvisionerPrivateKeyFile</code>, or set <code>WebApp.Enabled</code> to <code>false</code>.</td></tr><tr><td>"missing separator in users file"</td><td>A line of the users file has no <code>:</code>. Recreate the user with <code>Set-DGatewayUser</code>.</td></tr><tr><td>"failed to bind listener: {external URL} -> {internal URL}"</td><td>The listener port is used by another program, or the address doesn't exist on this computer.</td></tr><tr><td>"failed to bind agent tunnel listener"</td><td>The UDP port of <code>AgentTunnel.ListenPort</code> is in use.</td></tr></tbody></table>

## Environment variables

<table><thead><tr><th width="260">VARIABLE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><code>DGATEWAY_CONFIG_PATH</code></td><td>Folder (not file) that holds <code>gateway.json</code> and the data files. Replaces the default folder. The <code>--config-path &#x3C;folder></code> command-line option sets it for one run, and the PowerShell module always uses it when it is set.</td></tr><tr><td><code>DGATEWAY_WEBAPP_PATH</code></td><td>Folder of the standalone web application files. Wins over <code>WebApp.StaticRootPath</code>.</td></tr><tr><td><code>DGATEWAY_LIB_XMF_PATH</code></td><td>Path of the video processing library: <code>xmf.dll</code> next to the executable on Windows, <code>/usr/lib/devolutions-gateway/libxmf.so</code> on Linux by default. Without the library, Devolutions Gateway logs "Failed to load XMF native library, features requiring video processing such as remuxing and shadowing are disabled".</td></tr><tr><td><code>HTTP_PROXY</code>, <code>HTTPS_PROXY</code>, <code>NO_PROXY</code></td><td>Read when <code>Proxy.Mode</code> is <code>System</code> or <code>Proxy</code> is absent.</td></tr></tbody></table>

The Devolutions Gateway Docker image builds `gateway.json` from its own environment variables at each start: `HOSTNAME`, `WEB_SCHEME`, `WEB_PORT` (or `PORT`), `EXTERNAL_WEB_SCHEME`, `EXTERNAL_WEB_PORT`, `TCP_ENABLED`, `TCP_PORT`, `EXTERNAL_TCP_PORT`, `TCP_HOSTNAME`, `WEB_APP_ENABLED`, `WEB_APP_AUTHENTICATION`, `WEB_APP_USERNAME`, `WEB_APP_PASSWORD`, `RECORDING_PATH`, `VERBOSITY_PROFILE`, `PROVISIONER_PUBLIC_KEY_B64`, `PROVISIONER_PRIVATE_KEY_B64`, `TLS_CERTIFICATE_B64`, `TLS_PRIVATE_KEY_B64`, `TLS_CERTIFICATE_PASSWORD`, and `WEBSITE_HOSTNAME` on Azure. Their defaults and effects: [Run in Docker](https://docs.devolutions.net/gateway/for-administrators/install/docker.md).

## Command-line options

`DevolutionsGateway.exe` on Windows and `devolutions-gateway` on Linux accept these options:

<table><thead><tr><th width="260">OPTION</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>(none)</td><td>Runs Devolutions Gateway in the console, with logs on screen. Useful to see a startup error.</td></tr><tr><td><code>--service</code></td><td>Runs as a service. The Windows service and the Linux systemd unit use it.</td></tr><tr><td><code>--config-init-only</code></td><td>Writes a default <code>gateway.json</code> if none exists, prints the configuration as JSON, then exits. Never overwrites an existing file.</td></tr><tr><td><code>--config-path &#x3C;folder></code></td><td>Uses this folder instead of the default one, like <code>DGATEWAY_CONFIG_PATH</code>. Error without a value: "missing value for --config-path".</td></tr><tr><td><code>service register</code> / <code>service unregister</code></td><td>Registers or removes a service named <code>devolutions-gateway</code>. On Linux, it writes a systemd unit. The Windows installer registers its own service, <code>DevolutionsGateway</code>, instead.</td></tr></tbody></table>

Any other argument prints the help text, or "unexpected argument: {arg}".

## Next

* [PowerShell module reference](https://docs.devolutions.net/gateway/reference/powershell-module.md)
* [Files, folders, and services](https://docs.devolutions.net/gateway/reference/files-and-services.md)
* [Logs and event IDs](https://docs.devolutions.net/gateway/help/troubleshooting/logs-and-events.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/gateway/reference/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
