Server
1. Publishing & Directory Permissions
On your build machine, run scripts/publish.ps1 -RuntimeIdentifier linux-x64 -Component Server, then place the published output in /opt/relaylink/server. Store the Server configuration, client directory, and TLS private keys under /etc/relaylink using a dedicated relaylink system account with strict permissions:
/etc/relaylink,/etc/relaylink/clients, and/var/lib/relaylinkmust be0700(accessible only torelaylink).server.json, client JSON files, and TLS private keys must be0600.- When RelayLink Server writes client JSON files, server config, or SQLite files, it restricts permissions to owner read/write only. If group or world read permissions are detected on startup, it writes a
SECURITYwarning to the error log andstderr. - Newly created database directories use
0700. The Server refuses to open a database inside/tmp, system temp directories, or existing world-writable directories without modifying their permissions. - Database paths are resolved across symlinks before opening: startup refuses if the file itself is a symlink, if it resolves to the filesystem root, or if file permissions on a newly created database cannot be tightened.
relaylink-server.serviceenforcesUMask=0077.
Create the directories and install server.json:
sudo install -d -o relaylink -g relaylink -m 0700 /etc/relaylink /etc/relaylink/clients /var/lib/relaylink /var/lib/relaylink/logs
sudo install -o relaylink -g relaylink -m 0600 ./server.json /etc/relaylink/server.json
2. Logging & systemd Service
relaylink-server.service configures /var/lib/relaylink/logs as the runtime log directory:
server-*.jsonlis retained for 14 days andserver-error-*.jsonlis retained indefinitely; both rotate daily or at 10 MiB.journalctl -u relaylink-servercaptures startup output andstderrdiagnostics.--check-configdoes not create log files. Existing deployments upgrading from older versions must updateExecStartandUMaskin the systemd unit and runsystemctl daemon-reload.
Validate and start the service:
sudo -u relaylink /opt/relaylink/server/RelayLink.Server --config /etc/relaylink/server.json --check-config
sudo install -m 0644 deploy/linux/relaylink-server.service /etc/systemd/system/relaylink-server.service
sudo systemctl daemon-reload
sudo systemctl enable --now relaylink-server
3. Networking & Protocol Compatibility
- Restarting the Server drops all active control sessions and proxy connections.
- Agents must be able to reach the control port
tunnel.portand the separate data porttunnel.dataPort(defaults totunnel.port + 1). If Server-hosted STUN (peerDirect.stunListenPort) is enabled, also allow that UDP port in your firewall. - Proxy listener ports and the Admin Dashboard port should only be reachable on private/intranet interfaces. Standard data tunnels (
tunnel.dataPort) are currently unencrypted—restrict access to trusted Agent source IPs and protect them with an isolated link or network-layer encryption. Security groups provide ACLs only, not confidentiality. - The current Server accepts wire protocol v3, v4, and v5 Agents: you can upgrade the Server first while keeping v3 Agents for raw TCP, whereas unicast UDP requires v4 and HTTP/HTTPS reverse proxy or
preferDirectrequires v5. See UDP Forwarding and HTTP Reverse Proxy.
Agent
The Linux Agent shares the same configuration schema, protocol, peer channels, and local read-only status UI as the Windows and macOS Agents.
1. Building & Installing
Build or download the linux-x64 self-contained Agent package:
pwsh ./scripts/publish.ps1 -RuntimeIdentifier linux-x64 -Component Agent
Create a dedicated non-login system account (relaylink-agent). Because the Agent persists per-server identities, port allocations, and diagnostic logs under state/<profileId>/ inside its configuration directory, the configuration directory must be owned and writable only by relaylink-agent, while the binary directory is owned by root and kept read-only to the service user. Legacy single-server configs must first be converted by RelayLink.Agent.ConfigMigrator.
sudo useradd --system --home-dir /var/lib/relaylink-agent --shell /usr/sbin/nologin relaylink-agent
sudo install -d -o root -g root -m 0755 /opt/relaylink/agent
sudo tar -xzf RelayLink-Agent-linux-x64-<version>.tar.gz -C /opt/relaylink/agent
sudo chown -R root:root /opt/relaylink/agent
sudo chmod 0755 /opt/relaylink/agent/RelayLink.Agent
sudo chmod 0755 /opt/relaylink/agent/RelayLink.Agent.ConfigMigrator
sudo install -d -o relaylink-agent -g relaylink-agent -m 0700 /var/lib/relaylink-agent
sudo install -o relaylink-agent -g relaylink-agent -m 0600 ./relaylink-agent-<clientId>.json /var/lib/relaylink-agent/agent.json
sudo -u relaylink-agent /opt/relaylink/agent/RelayLink.Agent.ConfigMigrator --config /var/lib/relaylink-agent/agent.json
sudo -u relaylink-agent /opt/relaylink/agent/RelayLink.Agent --config /var/lib/relaylink-agent/agent.json --check-config
sudo install -m 0644 deploy/linux/relaylink-agent.service /etc/systemd/system/relaylink-agent.service
sudo systemctl daemon-reload
sudo systemctl enable --now relaylink-agent
2. Status, Logs & Local Dashboard
- Check process status with
systemctl status relaylink-agent; inspect launcher,RelayLink.Agent.ConfigMigrator, andstderrlogs viajournalctl -u relaylink-agent. - Runtime logs live in
/var/lib/relaylink-agent/logs/:agent-*.jsonlis retained for 14 days anderror-*.jsonlindefinitely, rotating daily or at 10 MiB (see Installation & Usage Guide). - The local Agent status UI listens by default on
http://127.0.0.1:18081/(configured viadashboardPort; set to0to disable). - relaylink-agent.service runs
RelayLink.Agent.ConfigMigratorinExecStartPreon every start (new-format configs are validated in place; migration errors prevent startup). During upgrades, replace only binaries in/opt/relaylink/agentand restart the service—never overwrite/var/lib/relaylink-agent. Keep the Agent state directory outside/var/lib/relaylink/so Server directory permissions do not block traversal.
3. preferDirect & the libmsquic Dependency
For authorized raw TCP and unicast UDP channels configured with preferDirect, the Linux Agent requires the native MsQuic runtime library (libmsquic) (for example, libmsquic 2.x from Microsoft's Linux package repository or your distribution packages) to establish encrypted QUIC direct connections.
If libmsquic is not installed on the host:
- The Agent still starts normally, automatically degrades
peerDirectQuicReadytofalseduring capability negotiation, and falls back gracefully to encrypted Server relay. - If a raw channel explicitly disables inner encryption and both sides are reachable over TCP, plaintext ICE-TCP direct (or plaintext relay) remains independently available. See Peer Direct & Relay Fallback.
Accessing the Server Admin UI via Peer Tunnel
No separate management protocol is required. Run a standard Linux Agent on the same host as RelayLink Server and expose the dashboard through an authorized peer channel:
- Keep the Server's
dashboard.listenAddressset to127.0.0.1andportset to18080(the default in example and Docker starter configs). The dashboard serves plaintext HTTP and does not host TLS directly; binding to a non-loopback address logs aSECURITYwarning to error logs andstderr. - Create an enabled authorized peer channel on the co-located Linux Agent targeting
127.0.0.1:18080(for example with channel IDserver-dashboard), with "Authorized clients only" enabled. - Add a peer access mapping for the authorized operator's client pointing to that Linux Agent and the
server-dashboardchannel. - Read the assigned local entry port in the caller Agent's local status UI and open
http://127.0.0.1:<entry-port>/from a browser on the caller machine.
Security Boundaries: Browser-to-caller-Agent traffic stays on local loopback; the two Agents communicate over inner TLS with target certificate fingerprint pinning and access-key proofs; the co-located Linux Agent connects to the Server dashboard over server-side loopback. Never rebind the caller's entry point to a LAN or public address. If the co-located Agent connects to the Server's TLS domain name, ensure that hostname resolves locally to a reachable address matching the certificate SAN—do not replace serverHost with 127.0.0.1 just to bypass name validation.
Upgrading with Verified Release Packages
- Inspect the target update and host upgrade commands under Version Status in the Server Admin UI or local Agent UI.
- Copy the verified archive and checksum files to a
root-owned staging directory (the generated commands stage under/var/tmp), verify the copy withsha256sum -c, and extract/validate the entrypoint before stopping the service. - Back up state before swapping binaries:
- Server: Stop the service, then back up
server.json,clients/, the SQLite database, and any-wal/-shmfiles (excluding update caches and logs). - Agent: Configuration, E2E identity, and port state remain intact in
/var/lib/relaylink-agent.
- Server: Stop the service, then back up
- Update cache directories are owned by the service account with
0700permissions (alongside the audit database for Server, and alongside the configuration directory for Agent). - Stop the appropriate
systemdunit while retaining the previous binary tree for rollback. After replacing/opt/relaylink/serveror/opt/relaylink/agent, runRelayLink.Agent.ConfigMigrator(for Agent) followed by--check-configunder the service account. - Start the service and verify the reported version and active tunnel connectivity. For foreground processes not managed by
systemd, follow the manual stop workflow shown in the version details panel.