Relay Last verified:

Run Relay on Linux

Install and run Viaalink Relay as a systemd service on a dedicated Linux server or VPS.

Overview

This guide explains how to install and configure Viaalink Relay on a Linux server (Ubuntu, Debian, or Rocky Linux) using a systemd service unit.

Prerequisites

  • A Linux server running an x86-64 (amd64), ARM64, or 32-bit ARMv6 distribution. The ARMv6 build covers Raspberry Pi Zero and Raspberry Pi 1, and also runs on a 32-bit Raspberry Pi OS on later models.
  • Root or sudo privileges.
  • A registered domain name pointing at your server’s IP address (see DNS Configuration).
  • Firewall or router rules allowing traffic on ports 2222/tcp, 80/tcp, 443/tcp, and optionally 3478/udp (see Requirements and Network Architecture).

Installation

1. Obtain the binary

Linux release archives (viaalink-relay-1.40.6.linux-amd64.tar.gz, viaalink-relay-1.40.6.linux-arm64.tar.gz, and viaalink-relay-1.40.6.linux-armv6.tar.gz) are publicly available at GitHub releases.

Verify the downloaded archive using the checksums file:

bash

The release archive contains the viaalink-relay binary, templates/, and deploy/. The Relay loads templates from disk relative to its working directory. Keep templates/ and deploy/ in the Relay working directory (/var/lib/viaalink-relay as configured in the systemd unit below). Moving only the binary without templates makes it crash at start.

Extract the archive and move the binary to your system PATH:

bash

Verify that the binary runs:

bash

2. Create the system user and directories

Create a dedicated, unprivileged system user and group to run the Relay:

bash

Create persistent directories for server host keys, authorized public keys, TLS certificates, license files, and configuration, and copy templates/ and deploy/ from the extracted archive into the Relay working directory:

bash

3. Create the configuration file

Create an initial configuration file at /var/lib/viaalink-relay/config.yml. License mode is always on in release builds. Setting license-key-file specifies the path to your license file:

yaml

Note: Behind a TLS-terminating reverse proxy (such as Caddy on the same machine), run the Relay with --domain=relay.example.com --http-address=127.0.0.1:8080 --proxy-ssl-termination --trusted-proxies=127.0.0.1. The --https-port-override flag is only needed if the proxy does not listen on port 443. Router port translation (80 -> 8080, 443 -> 8443) without a reverse proxy is a different setup; keep http-address: :8080 and https-address: :8443 without proxy flags. If the Linux host binds ports 80 and 443 directly with AmbientCapabilities=CAP_NET_BIND_SERVICE, set http-address: :80, https-address: :443, https: true, https-ondemand-certificate: true, https-ondemand-certificate-accept-terms: true, and https-ondemand-certificate-email: admin@example.com.

Set appropriate file ownership:

bash

Systemd service configuration

The Relay server does not ship with a pre-installed systemd service. Below is an example unit file that configures automatic startup, restart on failure, and file limit tuning.

Create /etc/systemd/system/viaalink-relay.service:

ini

Reload the systemd manager configuration, enable the service, and start it:

bash

First start and setup page

On first boot, the Relay generates an initial setup code, writes it to /var/lib/viaalink-relay/license/setup-token.txt, and logs it to the systemd journal (Setup dashboard token: <setup-code>).

Inspect the service logs using journalctl or read setup-token.txt to retrieve your setup code:

bash

Open the browser setup interface over HTTPS (when TLS is configured on your domain):

text

Or connect directly to the HTTP listener on port 8080:

text

After the first visit with ?x-authorization=<setup-code>, the browser stores your session cookie and subsequent visits to /_relay/dashboard open directly. From the setup dashboard, you can:

  • Activate a license (from your browser, with an activation code, or by uploading a license file) or operate under the Free plan (3 connected devices (up to 10 connections)).
  • Add custom domains and choose TLS validation methods.
  • Authorize connecting client devices by adding public keys.

The dashboard described here is in Relay v1.36.0 and later, and in the ASUSTOR package 0.62.7 and later.

Settings saved in /_relay/dashboard that need a restart cause the Relay to stop itself after a short delay, relying on systemd (Restart=always) to bring it back. Flags in the systemd unit (--domain, --ssh-address, --http-address, --https-address, and so on) override config.yml, so a domain or port changed in the dashboard is written to config.yml but ignored after the restart. Keep those settings in config.yml and remove the flags from the unit. In Relay v1.36.0 and later, and in the ASUSTOR package 0.62.7 and later, settings changes that need a restart show a restart bar with options: Restart now, Tonight at …, or Undo.

Verifying server health

Viaalink Relay does not expose a plain HTTP health URL. Server operational health is confirmed when:

  1. The SSH listener on port 2222 responds to connection attempts:
    bash
  2. The browser setup dashboard loads at http://<server-ip>:8080/_relay/dashboard or https://relay.example.com/_relay/dashboard.

Next steps