> 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/for-administrators/install/linux.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# Install on Linux

Install Devolutions Gateway on Linux from the .deb, .rpm or tar.xz package (x64, arm64), then configure and start the systemd service.

Devolutions Gateway runs on Linux as a systemd service named `devolutions-gateway`. Packages exist for Debian-based distributions (`.deb`) and RPM-based distributions such as Red Hat Enterprise Linux and Rocky Linux (`.rpm`), each for x64 and arm64, plus a self-contained `.tar.xz` archive. The package installs the service but doesn't start it: Devolutions Gateway needs its provisioner key and certificate first.

## Prerequisites

* A 64-bit Linux machine with systemd, on x64 or arm64. The `.deb` package requires `libc6` 2.27 or later. Supported distributions: [System requirements](https://docs.devolutions.net/gateway/reference/system-requirements.md).
* `sudo` rights.
* The provisioner public key of Devolutions Server or Devolutions Cloud: ***Administration*** – ***Devolutions Gateway*** – ***More*** – ***Download public key***.
* A certificate and its private key in PEM format, for a name clients can resolve. See [Certificates and TLS](https://docs.devolutions.net/gateway/guides/certificates.md).
* DNS resolution, from the Linux machine, of the hosts that sessions will connect to. Devolutions Gateway resolves target names itself.

## Download the package

<table><thead><tr><th width="300">DISTRIBUTION</th><th>FILE</th></tr></thead><tbody><tr><td><strong>Debian, Ubuntu (x64)</strong></td><td><code>devolutions-gateway-&#x3C;version>-x64.deb</code></td></tr><tr><td><strong>Debian, Ubuntu (arm64)</strong></td><td><code>devolutions-gateway-&#x3C;version>-arm64.deb</code></td></tr><tr><td><strong>Red Hat Enterprise Linux, Rocky Linux and other RPM distributions (x64)</strong></td><td><code>devolutions-gateway-&#x3C;version>-x64.rpm</code></td></tr><tr><td><strong>RPM distributions (arm64)</strong></td><td><code>devolutions-gateway-&#x3C;version>-arm64.rpm</code></td></tr><tr><td><strong>Any distribution with systemd</strong></td><td><code>devolutions-gateway-&#x3C;version>-linux-x64.tar.xz</code>, <code>devolutions-gateway-&#x3C;version>-linux-arm64.tar.xz</code></td></tr></tbody></table>

Download the file from the [Devolutions Gateway download page](https://devolutions.net/gateway/download/) (releases accepted by quality assurance) or from the [GitHub releases](https://github.com/Devolutions/devolutions-gateway/releases) of Devolutions Gateway (every release, published before quality assurance acceptance), then copy it to the Linux machine.

## Install the package

On Debian or Ubuntu:

```shell
sudo apt install ./devolutions-gateway-<version>-x64.deb
```

On Red Hat Enterprise Linux, Rocky Linux and similar:

```shell
sudo dnf install ./devolutions-gateway-<version>-x64.rpm
```

The package:

* Installs `/usr/bin/devolutions-gateway`, the standalone web application and recording player in `/usr/share/devolutions-gateway/webapp/`, and the video processing library `/usr/lib/devolutions-gateway/libxmf.so`.
* Creates `/etc/devolutions-gateway` (mode `750`) and, when it doesn't exist yet, a default `/etc/devolutions-gateway/gateway.json` (mode `600`).
* Installs the `devolutions-gateway.service` systemd unit and enables it, but doesn't start it on a first installation. It shows:

```
Devolutions Gateway has been installed.
Edit /etc/devolutions-gateway/gateway.json, then run:
  systemctl start devolutions-gateway
```

The default `gateway.json` contains a new random `Id`, `"ProvisionerPublicKeyFile": "provisioner.pem"`, `"TlsVerifyStrict": true`, a TCP listener `tcp://*:8181` and an HTTP listener `http://*:7171` advertised as `https://*:7171`.

The service runs as `root`. Its unit file:

```ini
[Unit]
Description=Devolutions Gateway
After=network-online.target

[Service]
ExecStart=/usr/bin/devolutions-gateway --service
Restart=on-failure

[Install]
WantedBy=multi-user.target
```

## Configure Devolutions Gateway

1. Copy the provisioner public key downloaded from Devolutions Server or Devolutions Cloud to the configuration folder, with the name `provisioner.pem`:

```shell
sudo cp gateway_public_key.pem /etc/devolutions-gateway/provisioner.pem
```

2. Copy the certificate and its private key, and protect the key:

```shell
sudo cp fullchain.pem /etc/devolutions-gateway/server.crt
sudo cp privkey.pem /etc/devolutions-gateway/server.key
sudo chmod 600 /etc/devolutions-gateway/server.key
```

3. Edit `/etc/devolutions-gateway/gateway.json` (for example with `sudo nano`) to add the certificate, the host name, and an `https` HTTP listener. Keep the generated `Id`.

```json
{
  "Id": "<keep the generated ID>",
  "Hostname": "gateway.contoso.com",
  "ProvisionerPublicKeyFile": "provisioner.pem",
  "TlsCertificateFile": "server.crt",
  "TlsPrivateKeyFile": "server.key",
  "TlsVerifyStrict": true,
  "Listeners": [
    { "InternalUrl": "tcp://*:8181", "ExternalUrl": "tcp://*:8181" },
    { "InternalUrl": "https://*:7171", "ExternalUrl": "https://*:7171" }
  ]
}
```

In listener URLs, `*` in `InternalUrl` listens on every IPv4 and IPv6 address, and `*` in `ExternalUrl` is replaced by `Hostname`. All settings: [Configuration file (gateway.json)](https://docs.devolutions.net/gateway/reference/configuration.md).

4. Start the service and check its status:

```shell
sudo systemctl start devolutions-gateway
sudo systemctl status devolutions-gateway
```

5. Check that it answers: `curl https://gateway.contoso.com:7171/jet/health` returns `Devolutions Gateway "gateway.contoso.com" is alive and healthy.`

You can also configure Devolutions Gateway with the DevolutionsGateway PowerShell module, after installing PowerShell 7 and running `Install-Module DevolutionsGateway`. The module removes the configuration keys it doesn't know, including `TlsVerifyStrict`, when it saves the file. See [Manage Devolutions Gateway with PowerShell](https://docs.devolutions.net/gateway/for-administrators/powershell.md).

## Open the firewall

Open the ports of your listeners. With the default configuration:

```shell
# Ubuntu with UFW
sudo ufw allow 7171/tcp
sudo ufw allow 8181/tcp
sudo ufw allow 4433/udp   # only if the agent tunnel is enabled

# Red Hat Enterprise Linux and Rocky Linux with firewalld
sudo firewall-cmd --permanent --add-port=7171/tcp --add-port=8181/tcp
sudo firewall-cmd --permanent --add-port=4433/udp   # only if the agent tunnel is enabled
sudo firewall-cmd --reload
```

Details: [Ports and firewall](https://docs.devolutions.net/gateway/reference/ports-and-firewall.md).

## Link Devolutions Gateway to Devolutions Server or Devolutions Cloud

Register the gateway with its HTTPS URL, for example `https://gateway.contoso.com:7171`, and its TCP host name and port. See [Register and configure the gateway in Devolutions Server](https://docs.devolutions.net/gateway/guides/devolutions-server/register-and-configure.md) or [Register and configure the gateway in Devolutions Cloud](https://docs.devolutions.net/gateway/guides/devolutions-cloud/register-and-configure.md).

## Install from the tar.xz archive

The archive contains `devolutions-gateway`, `libxmf.so` and the `webapp` folder (`client` and `player`), with no installation script. To run it as a service, put the files where the service expects them:

```shell
mkdir dgw && tar -xJf devolutions-gateway-<version>-linux-x64.tar.xz -C dgw
sudo install -m 755 dgw/devolutions-gateway /usr/bin/devolutions-gateway
sudo install -d /usr/lib/devolutions-gateway /usr/share/devolutions-gateway
sudo install -m 644 dgw/libxmf.so /usr/lib/devolutions-gateway/libxmf.so
sudo cp -r dgw/webapp /usr/share/devolutions-gateway/
sudo install -d -m 750 /etc/devolutions-gateway
sudo /usr/bin/devolutions-gateway --config-init-only
sudo /usr/bin/devolutions-gateway service register
```

`--config-init-only` writes the default `gateway.json` when it doesn't exist and prints it. `service register` creates the `devolutions-gateway` systemd unit (`service unregister` removes it). Then configure Devolutions Gateway as for a package installation, and enable and start the service with `sudo systemctl enable --now devolutions-gateway`.

To run the files from another folder, set the environment variables `DGATEWAY_WEBAPP_PATH` (web application folder) and `DGATEWAY_LIB_XMF_PATH` (path of `libxmf.so`). Without `libxmf.so`, Devolutions Gateway logs "Failed to load XMF native library, features requiring video processing such as remuxing and shadowing are disabled". The variable `DGATEWAY_CONFIG_PATH`, or the option `--config-path <folder>`, changes the configuration folder.

## Upgrade

Install the newer package over the existing one with the same command (`apt install ./…deb` or `dnf install ./…rpm`). The configuration in `/etc/devolutions-gateway` is kept. The service is restarted only if it was running.

Devolutions Agent doesn't update Devolutions Gateway on Linux. See [Update Devolutions Gateway](https://docs.devolutions.net/gateway/for-administrators/install/update.md).

## Logs

* Log files: `/etc/devolutions-gateway/gateway.*.log` (3 MB per file, 10 files kept, files older than 90 days deleted).
* Service output: `journalctl -u devolutions-gateway`.
* Important events: syslog, identifier `devolutions-gateway`.
* Startup failures: `/etc/devolutions-gateway/boot.stacktrace`.

See [Logs and event IDs](https://docs.devolutions.net/gateway/help/troubleshooting/logs-and-events.md).

## Next

* [Change the Devolutions Gateway certificate](https://docs.devolutions.net/gateway/guides/certificates/change-certificate.md)
* [Harden Devolutions Gateway](https://docs.devolutions.net/gateway/for-administrators/hardening.md)
* [Uninstall Devolutions Gateway](https://docs.devolutions.net/gateway/for-administrators/install/uninstall.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/for-administrators/install/linux.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.
