STRELAYSRV(1)
π NAME π
okay bestie, say hi to strelaysrv β the Syncthing Relay Server. that's it, that's the name, she's iconic and she knows it π
π¦ SYNOPSIS π¦
like, here's how you summon her:
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 the whole tea is this: Syncthing runs on a network of community-contributed relay servers. and when I say anyone can run one, I mean it fr β literally anyone can spin up a relay server, and it just automatically joins the relay pool and becomes available to Syncthing users everywhere. no application, no audition, no callbacks. she's self-inviting and we respect it π«Ά
the current list of relays lives at https://relays.syncthing.net/ if you wanna go look at the roster. star-studded lineup, no cap β¨
π OPTIONS π
the full menu, bestie, every single one:
-debugβ turns on debug output. so she starts telling you everything. main character oversharing energy π-ext-address=<address>β an optional address to advertise as being available on. this is the glow-up hack: it lets you listen on an unprivileged port while port forwarding from, say,443, and still get connected to on port443. sneaky, legal, iconic π-global-rate=<bytes/s>β global rate limit, in bytes/s.-keys=<dir>β the directory wherecert.pemandkey.pemare stored (default.).-listen=<listen addr>β protocol listen address (default:22067).-message-timeout=<duration>β the maximum amount of time we wait for relevant messages to arrive (default1m0s).-natβ use UPnP/NAT-PMP to acquire an external port mapping. she asks the router politely π§-nat-lease=<duration>β NAT lease length in minutes (default60).-nat-renewal=<duration>β NAT renewal frequency in minutes (default30).-nat-timeout=<duration>β NAT discovery timeout in seconds (default10).-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 furthermore, if no data is sent between either clients being relayed within this period of time, the session is also terminated. she does not wait around, bestie π (default2m0s)-per-session-rate=<bytes/s>β per session rate limit, in bytes/s.-ping-interval=<duration>β how often pings are sent (default1m0s).-pools=<pool addresses>β comma separated list of relay pool addresses to join (defaulthttps://relays.syncthing.net/endpoint). blank to disable announcement to a pool, thereby remaining a private relay. introvert mode: activated π-pprofβ enable the built in profiling on the status server.-protocol=<string>β the protocol used for listening.tcpfor IPv4 and IPv6,tcp4for IPv4,tcp6for IPv6 (defaulttcp).-provided-by=<string>β an optional description about who provides the relay. put your name on it, you built this π-status-srv=<listen addr>β listen address for the status service (blank to disable) (default:22070). the status service is used by the relay pool server UI for displaying stats (data transferred, number of clients, etc.)-token=<string>β token to restrict access to the relay (optional). this disables joining any pools. VIP-only, no plus-ones π₯-versionβ show version.
π Installing π
head over to the releases at https://github.com/syncthing/relaysrv/releases and download the file that matches your operating system. unpack it and you get a binary called strelaysrv (or strelaysrv.exe on Windows, because Windows gotta be different π). start it however you're most comfortable with β double clicking should genuinely work in any graphical environment, no terminal trauma required.
on the very first start, strelaysrv will generate certificate files and a database in the current directory, unless you gave flags that say otherwise. she will also join the default pools of relays, which means she's publicly visible and any client can connect to her. the startup message prints instructions on how to change that, so like, read it. please. π
the relay server can also be obtained through apt, the Debian/Ubuntu package manager. recent releases can be found at syncthing's apt repository, https://apt.syncthing.net/. the name of the package is syncthing-relaysrv. cute, right? π
πΈ SETTING UP πΈ
first things first, bestie: you need to decide on a directory to store the TLS key and certificate, and a listen port. the default listen port of 22067 works just fine, but for optimal compatibility a well known port for encrypted traffic such as 443 is recommended. that might require 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 pass a -pools="" argument. so if you want her private, say so π«Ά
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. so, like, screenshot it or whatever πΈ
β 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. no stress, we got options π
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. both. don't forget the second one, bestie, I'm begging π
another option is described here: https://wiki.apache.org/httpd/NonRootPortBinding, although your mileage may vary. iykyk π
π₯ 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-listenand 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. (because if you don't, they vanish on reboot and you'll be back here at 2am like π)
π 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
π shared secret = shared trust. if they don't have the token, they don't get in. simple as that, no cap.
π SEE ALSO π
π«Ά AUTHOR π«Ά
The Syncthing Authors. legends, honestly π
π COPYRIGHT π
2014-2026, The Syncthing Authors
okay and that's the whole page bestie, we did it π this was v2.1.0, dated Sep 10, 2026, and it's giving manual page energy in the best possible way. go forth, run a relay, be the main character of the pool πΈβ¨π
π¦ where this page comes from
- epel 10: syncthing-tools 2.1.6-1.el10_3 Β· Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND OFL-1.1 AND (Apache-2.0 OR MIT) AND (MIT OR Unlicense)
- fedora 43: syncthing-tools 2.1.6-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND OFL-1.1 AND (Apache-2.0 OR MIT) AND (MIT OR Unlicense)
- fedora 44: syncthing-tools 2.1.6-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND OFL-1.1 AND (Apache-2.0 OR MIT) AND (MIT OR Unlicense)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms