STRELAYSRV(1)

πŸ“¦ version 2.1.7, in arch rolling

πŸ’… STRELAYSRV(1) β€” the Syncthing Relay Server glow-up

okay bestie, this is the man page for strelaysrv, straight out of the Syncthing family. buckle up, it's actually so good 🫢


✨ SYNOPSIS ✨

strelaysrv [-debug] [-ext-address=<address>] [-global-rate=<bytes/s>] [-keys=<dir>] [-listen=<listen addr>]
           [-message-timeout=<duration>] [-nat] [-nat-lease=<duration>] [-nat-renewal=<duration>]
           [-nat-timeout=<duration>] [-network-timeout=<duration>] [-per-session-rate=<bytes/s>]
           [-ping-interval=<duration>] [-pools=<pool addresses>] [-pprof] [-protocol=<string>]
           [-provided-by=<string>] [-status-srv=<listen addr>] [-token=<string>] [-version]

🌸 DESCRIPTION 🌸

so Syncthing runs on a whole network of relay servers that the community just… contributes πŸ’– literally anyone can spin one up, and it'll automatically hop into the relay pool and be there for Syncthing users everywhere. the current list of relays lives at https://relays.syncthing.net/. no cap, that's the whole vibe.


πŸŽ€ OPTIONS πŸŽ€

  • -debug β€” turns on debug output. the receipts, if you will πŸ•΅οΈβ€β™€οΈ
  • -ext-address=<address> β€” an optional address to advertise yourself as being available on. it's giving "listen on an unprivileged port but get port-forwarded from, like, 443, and then people connect to you on 443." iconic.
  • -global-rate=<bytes/s> β€” global rate limit, in bytes/s.
  • -keys=<dir> β€” the directory where cert.pem and key.pem are stored (default ".").
  • -listen=<listen addr> β€” the protocol listen address (default ":22067").
  • -message-timeout=<duration> β€” the max amount of time we wait for relevant messages to arrive (default 1m0s).
  • -nat β€” use UPnP/NAT-PMP to acquire an external port mapping ✨
  • -nat-lease=<duration> β€” NAT lease length in minutes (default 60).
  • -nat-renewal=<duration> β€” NAT renewal frequency in minutes (default 30).
  • -nat-timeout=<duration> β€” NAT discovery timeout in seconds (default 10).
  • -network-timeout=<duration> β€” timeout for network operations between the client and the relay. if no data is received between the client and the relay in this period of time, the connection is terminated. and on top of that, if no data is sent between either clients being relayed within this period of time, the session is also terminated. (default 2m0s) πŸ’€
  • -per-session-rate=<bytes/s> β€” per session rate limit, in bytes/s.
  • -ping-interval=<duration> β€” how often pings are sent (default 1m0s).
  • -pools=<pool addresses> β€” a comma separated list of relay pool addresses to join (default "https://relays.syncthing.net/endpoint"). leave it blank to disable announcement to a pool, which keeps you a private relay 🧚
  • -pprof β€” enable the built in profiling on the status server.
  • -protocol=<string> β€” the protocol used for listening. 'tcp' for IPv4 and IPv6, 'tcp4' for IPv4, 'tcp6' for IPv6 (default "tcp").
  • -provided-by=<string> β€” an optional description about who provides the relay. put your name on it, main character energy πŸ‘‘
  • -status-srv=<listen addr> β€” listen address for the status service (blank to disable) (default ":22070"). the status service is what the relay pool server UI uses for displaying stats (data transferred, number of clients, etc.).
  • -token=<string> β€” token to restrict access to the relay (optional). disables joining any pools. πŸ”’
  • -version β€” show version.

πŸ¦‹ Installing πŸ¦‹

head over to releases <https://github.com/syncthing/relaysrv/releases> and download whichever file matches your operating system. unpack it and you get a binary called strelaysrv (or strelaysrv.exe on Windows). start it however you're most comfy with β€” honestly, double clicking works in any graphical environment. on first start, strelaysrv will generate certificate files and a database in the current directory unless you pass flags that say otherwise. it will also join the default pools of relays, which means it's publicly visible and literally any client can connect to it. the startup message prints instructions on how to change that, so read it πŸ‘€

you can also get the relay server through apt, the Debian/Ubuntu package manager. recent releases live at syncthing's apt repository <https://apt.syncthing.net/>. the name of the package is syncthing-relaysrv.


🌈 SETTING UP 🌈

first things first: you gotta decide on a directory to store the TLS key and certificate, plus a listen port. the default listen port of 22067 works, but for optimal compatibility a well known port for encrypted traffic such as 443 is recommended. that might need extra setup to work without running as root or a privileged user β€” see Running on port 443 as an unprivileged user below. in principle something similar to this should work on a Linux/Unix system:

$ sudo useradd strelaysrv
$ sudo mkdir /etc/strelaysrv
$ sudo chown strelaysrv /etc/strelaysrv
$ sudo -u strelaysrv /usr/local/bin/strelaysrv -keys /etc/strelaysrv

this creates a user strelaysrv and a directory /etc/strelaysrv to store the keys. the keys are generated on first startup. the relay will join the global relay pool β€” unless you give it a -pools="" argument. periodt.

to make the relay server start automatically at boot, use the recommended procedure for your operating system.

πŸ’œ Client configuration πŸ’œ

Syncthing can be configured to use specific relay servers (exclusively of the public pool) by adding the required servers to the Sync Protocol Listen Address field, under Actions and Settings. the format is as follows:

relay://<host name|IP>[:port]/?id=<relay device ID>

for example:

relay://private-relay-1.example.com:443/?id=ITZRNXE-YNROGBZ-HXTH5P7-VK5NYE5-QHRQGE2-7JQ6VNJ-KZUEDIU-5PPR5AM

the relay's device ID is output on start-up. write it down bestie, you'll need it πŸ“

🧚 Running on port 443 as an unprivileged user 🧚

it is recommended that you run the relay on port 443 (or another port which is commonly allowed through corporate firewalls), in order to maximise the chances that people are able to connect. however β€” and this is the annoying part β€” binding to ports below 1024 requires root privileges, and running a relay as root is not recommended. thankfully there are a couple of approaches available to you.

one option is to run the relay on port 22067, and use an iptables rule to forward traffic from port 443 to port 22067, for example:

iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 22067

or, if you're using ufw, add the following to /etc/ufw/before.rules:

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]

-A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 22067

COMMIT

you will need to start strelaysrv with -ext-address ":443". this tells strelaysrv that it can be contacted on port 443, even though it is listening on port 22067. you will also need to let both port 443 and 22067 through your firewall. don't forget, bestie πŸ™ˆ

another option is described here <https://wiki.apache.org/httpd/NonRootPortBinding>, although your mileage may vary.


πŸ”₯ FIREWALL CONSIDERATIONS πŸ”₯

the relay server listens on two ports by default. one for data connections and the other for providing public statistics at https://relays.syncthing.net/. the firewall, such as iptables, must permit incoming TCP connections to the following ports:

  • Data port: 22067/tcp overridden with -listen and advertised with -ext-address
  • Status port: 22070/tcp overridden with -status-srv

runtime iptables rules to allow access to the default ports:

iptables -I INPUT -p tcp --dport 22067 -j ACCEPT
iptables -I INPUT -p tcp --dport 22070 -j ACCEPT

please consult Linux distribution documentation to persist firewall rules. (fr fr, they vanish on reboot otherwise 😭)


πŸ”’ ACCESS CONTROL FOR PRIVATE RELAYS πŸ”’

added in version 1.22.1.

private relays can be configured to only accept connections from peers in possession of a shared secret. to configure this, use the -token option:

$ strelaysrv -token=mySecretToken

then configure your Syncthing devices to send the token when joining the relay:

relay://<host name|IP>[:port]/?id=<relay device ID>&token=mySecretToken

iykyk 🀫


⭐ SEE ALSO ⭐

syncthing-relay(7), syncthing-faq(7), syncthing-networking(7)


πŸ‘‘ AUTHOR πŸ‘‘

The Syncthing Authors


2014-2026, The Syncthing Authors


and that's the whole page, bestie πŸ’– this here was strelaysrv from v2.1.0, dated Oct 07, 2026 β€” go forth and relay, you absolute icon 🌟

πŸ“¦ where this page comes from