This page is in English — onze technische documentatie voor ontwikkelaars en beheerders is in het Engels.

Relay Laatst gecontroleerd:

Run Relay on Synology or QNAP

Run Viaalink Relay on a Synology NAS with the Viaalink Relay package or Container Manager, or on a QNAP NAS with Container Station, using the Docker Compose setup.

Overview

On a Synology NAS you can install the Viaalink Relay package (.spk), which sets everything up for you; see Synology: the Viaalink Relay package. It is not in Package Center: you download it and install it by hand.

On a QNAP NAS, and on a Synology NAS without the package, you run the Viaalink Relay container image with the NAS’s own Docker app: Container Manager on Synology, Container Station on QNAP. You use the same Docker Compose setup as in Run Relay with Docker, with the changes on this page from Requirements on.

The container image is public on the GitHub Container Registry: ghcr.io/viaalink/relay (latest, or a version tag such as 1.39.0), and the same image on Docker Hub as viaalink/viaalink-relay. You can pull it without an account.

The package runs the same Relay container image through Container Manager. It carries the image inside the .spk, so the install needs no internet access.

Requirements

  • DSM 7.2 or later, with Container Manager 20.10.23-1432 or later from Package Center. If Package Center does not list Container Manager for your model, it cannot run the package.
  • A 64-bit processor: one .spk for x86-64 models (ViaalinkRelay-x86_64-<version>.spk) and one for ARM64 models (ViaalinkRelay-armv8-<version>.spk).
  • A domain you control with wildcard DNS (see DNS Configuration).

Download

Every Viaalink Relay release comes with the Synology package. Download it here, or from the public releases page, github.com/viaalink/relay/releases. For Viaalink Relay 1.40.5 (Synology package 1.40.5-0001):

The package is not in Synology’s Package Center: you install it by hand, as below.

Install

  1. Install Container Manager from Package Center.
  2. In Package Center, click Manual Install, choose the .spk for your NAS’s processor, and click Next. DSM asks you to confirm installing a package that Synology has not signed.
  3. Accept the license agreement and finish the installation.
  4. When the installation finishes, open the viaalink-relay shared folder in File Station and open CREDENTIALS.txt. It holds the dashboard address and the setup code.
  5. Open Viaalink Relay from the DSM main menu. It opens the Relay dashboard at http://<your-NAS>:28081/_relay/dashboard. Enter the setup code, then add your domain and activate the license as described in Relay Licensing.

Ports

The package registers its ports with DSM, so they appear under Control Panel › Security › Firewall and in the router port forwarding wizard (Control Panel › External Access › Router Configuration):

PortProtocolFor
28022TCPDevices connecting to the Relay
28081TCPThe Relay dashboard and web traffic
28443TCPHTTPS
3478UDPCalls through firewalls

Forward the ones you use from your router to the NAS.

Keys and license

The Relay’s keys, certificates and license are kept in the package’s own data folder, readable only by the package. The viaalink-relay shared folder holds CREDENTIALS.txt only.

Updating the package

The package is not in Package Center, so DSM does not offer updates for it. The Relay’s dashboard shows when a newer version exists. To update, download the newer .spk from the releases page and install it with Manual Install over the installed one. The keys, devices, domain, license and ports are kept (checked from 1.39 to 1.40.3 on a DS920+). The update steps the dashboard prints are for a Docker Compose install; on the package, use Manual Install.

Uninstalling

Do not count on an uninstall to wipe the Relay: on DSM 7.4.1, uninstalling left the package’s data folder in place, and a new install came back with the old keys, license and settings.

Requirements

  • Synology: DSM 7.2 or later with the Container Manager package. Projects (Docker Compose) are part of Container Manager, which needs DSM 7.2. Open Package Center and search for Container Manager. If it is not listed, your model cannot run containers. Many value and “j” models with an ARM processor do not have it.
  • QNAP: QTS or QuTS hero with Container Station from App Center. If App Center does not list Container Station for your model, it cannot run containers.
  • A 64-bit processor: x86-64 (amd64) or ARM64. The image is built for amd64 and arm64 only. NAS models with a 32-bit ARM processor cannot run it.
  • A domain you control with wildcard DNS (see DNS Configuration).
  • At least 128 MB of free RAM (256 MB recommended).
  • SSH access to the NAS for one check in step 3 (DSM: Control Panel › Terminal & SNMP; QTS: Control Panel › Network & File Services › Telnet / SSH).

1. Prepare a folder on the NAS

Create a shared folder for the Relay, for example docker/viaalink-relay, with these subfolders:

text

Put the files from Run Relay with Docker in the viaalink-relay folder: docker-compose.yml, Dockerfile.caddy, Caddyfile, and data/config.yml.

2. Ports: Caddy on 8080 and 8443

DSM and QTS use ports 80 and 443 for their own web server, so Caddy cannot take them on the NAS. Publish Caddy on NAS ports 8080 and 8443 instead. In docker-compose.yml, change the caddy service:

yaml

Then set these port forwarding rules on your router:

External portTo the NASWhat it is for
80/tcpport 8080HTTP and the redirect to HTTPS
443/tcpport 8443HTTPS for every published address
2222/tcpport 2222Clients that connect to the Relay
3478/udpport 3478Call control (optional)

Visitors still use the normal ports 80 and 443. The Compose file already tells the Relay that Caddy handles HTTPS (VIAALINK_RELAY_PROXY_SSL_TERMINATION) and which addresses Caddy sends from (VIAALINK_RELAY_TRUSTED_PROXIES). Because the public port stays 443, you do not need --https-port-override.

The call media port range 49152–49167/udp is not published by this Compose file, so calls through firewalls do not work with this setup. See Requirements and Network Architecture and Relay Ports.

3. Tie the license to the NAS

A license is activated on one machine. The Relay needs a stable ID of the NAS for that. Pick one of the two ways below.

Check for a machine ID

Some NAS systems do not have /etc/machine-id. Check it over SSH:

bash

Do not mount /etc/machine-id when this says no machine ID. Docker then creates an empty folder in its place, and license activation fails.

Way A: the machine ID (the NAS has one)

The Compose file from Run Relay with Docker already has this line under volumes: of the relay service. Keep it:

yaml

Way B: the network card, with host networking (no machine ID)

With VIAALINK_RELAY_HOST_ID_SOURCE=nic (or --host-id-source=nic), the Relay ties the license to the factory addresses of the NAS’s network cards. It can only see those cards with host networking. On the relay-net network, activation fails with no physical (PCI) network card. If you replace or add a network card later, you activate again.

Replace the relay service with this one. It has no ports: and no networks:, because with host networking the Relay listens on the NAS itself:

yaml

The Relay’s HTTP listener is on NAS port 8081, because Caddy already uses 8080. Caddy stays on relay-net and reaches the Relay through the NAS. Add this to the caddy service:

yaml

In the Caddyfile, change reverse_proxy relay:8080 { to:

nginx

In data/config.yml, change http-address: :8080 to http-address: :8081.

If the log still says no physical (PCI) network card, the NAS’s network port is not a PCI card. Then use an ID file. Create it once with cat /proc/sys/kernel/random/uuid > data/license/host-id and keep it with your backups. Set VIAALINK_RELAY_HOST_ID_FILE: "/app/deploy/license/host-id" instead of VIAALINK_RELAY_HOST_ID_SOURCE. Never change that file after activation.

4. Pick a free network range

The Compose file gives relay-net the fixed range 172.24.0.0/24. If another network on the NAS already uses that range, the project does not start. See the ranges in use in Container Manager under Network, or over SSH with docker network ls and docker network inspect <name>.

To use another range, for example 172.30.99.0/24, change it in three places:

  • subnet: under networks: in docker-compose.yml.
  • VIAALINK_RELAY_TRUSTED_PROXIES in docker-compose.yml.
  • trusted-proxies: in data/config.yml.

5a. Synology: Container Manager

  1. Open Container Manager and go to Project.
  2. Click Create, give the project a name (for example viaalink-relay), and set Path to the viaalink-relay folder.
  3. Choose to use the existing docker-compose.yml in that folder, review the settings, and finish the wizard. Container Manager builds the Caddy image and starts both containers.
  4. Open the log of the viaalink-relay container and find the setup code (see step 6).

5b. QNAP: Container Station

  1. Open Container Station and go to Applications.
  2. Click Create, name the application (for example viaalink-relay), and paste the contents of your docker-compose.yml.
  3. Relative paths such as ./data/keys are not guaranteed to point at your shared folder when you paste the file. Replace each ./data/..., ./Caddyfile and the build context: . with the absolute path of your viaalink-relay folder (on QNAP shared folders live under /share/, for example /share/Container/viaalink-relay/data/keys).
  4. Click Create. Open the log of the viaalink-relay container and find the setup code (see step 6).

6. Find the setup code

The Relay writes the setup code to its container log, in a line that starts with:

text

The code follows on the same line. The Relay makes a new code each time it starts, so use the newest line. The code is also written to data/license/setup-token.txt, but only root can read that file, so File Station cannot open it.

7. Open the setup dashboard

You can sign in to the dashboard in two ways.

On your own network, before DNS and the router are ready. The Compose file does not publish the Relay’s HTTP port on the NAS. To sign in from a computer on your network first, add a port to the relay service:

yaml

Then open http://<nas-ip>:8081/_relay/dashboard?x-authorization=<setup-code>. With Way B (host networking) the Relay already listens on NAS port 8081, so open the same address without adding a port. Do not forward port 8081 on your router. You can remove the extra port again after setup.

Over the internet. This works once DNS, the router rules from step 2, Caddy and its certificate are in place. Open:

text

Settings that need a restart (ports, domain, HTTPS, IP and country rules) make the Relay stop itself; the restart: unless-stopped policy in the Compose file starts it again within seconds. The dashboard shows a restart bar with options: Restart now, Tonight at …, or Undo. Restart now stops the Relay and Compose starts it again. Settings in config.yml that the Compose file also sets as environment variables are overridden by those variables, so keep domain and ports in config.yml only.

Updating

Pull the new image first, then recreate the containers. Recreating alone can keep using the image that is already on the NAS.

  • Container Manager: download the new ghcr.io/viaalink/relay image (under Registry or Image), then select the project and use Action to stop it and build it again.
  • Container Station: pull the new image, then recreate the application.
  • Over SSH, in the viaalink-relay folder: docker compose pull && docker compose up -d.

Your data/ folder is kept, including host keys, approved keys, and the license.

Next steps