Run Your Own Relay (Beta)
Beta. By default your machines meet on nfltr.xyz. You can instead run the relay on a VM or machine of your own and join your machines to it, so the path between them stays on your network. It is the same nfltr binary: nfltr relay serve. You bring the TLS certificate (or let the relay make a self-signed one); each machine enrols with a single-use code and holds a certificate of the relay's own machine CA. This tutorial goes from an empty Linux VM to your machines connected through it. Everything else on this site describes nfltr.xyz.
nfltr.xyz or your own relay
The relay carries traffic between your machines' agents and clients. Machines connect out to the relay, so only the relay needs an open port.
| nfltr.xyz | Your own relay (beta) | |
|---|---|---|
| Who runs it | We do: updates, certificates, uptime. | You do: a VM, its firewall, its certificate, upgrades and backups. |
| Where traffic goes | Through nfltr.xyz. | Through your relay. Your machines need to reach it; nothing else does. |
| Accounts and machines | Your account; each machine enrols with its own certificate. | The first start makes machine admin's enrolment code; each machine you add enrols with a code of its own, in admin's account or as an account of its own (section 4). |
| Dashboard | Yes, with Google sign-in. | No. Everything below works from the CLI. |
| SSH and TCP tunnels | Yes. | Yes. |
| Share links | Yes, on nfltr.xyz. | Yes, on a domain of yours, with a wildcard certificate (section 7). |
| Availability | Our service. | One process on one machine: no failover. Agents reconnect by themselves after a restart. |
| Software | The same closed-source nfltr binary. | |
Use your own relay when the requirement is that traffic between your machines does not leave your network, and the features in the next table are the ones you need. If you need the dashboard, use nfltr.xyz.
What works on your own relay
Checked on 2026-10-03 with four Linux containers on one Docker network, each standing in for a machine: a relay with a self-signed certificate (pinned by the others), two machines, and a second relay with a certificate from a private CA (no pin). Every command below ran with no relay flags, only the relay saved at enrolment.
| Use | Result | What was checked |
|---|---|---|
nfltr status | Works | Answers from your relay. |
| A certificate from your CA | Works | Enrolled without a pin; messages across it. |
A share link from nfltr up, with a password | Works, with --share-domain | Checked on 2026-11-01 with a test CA's wildcard certificate: the link on the relay's share domain answered 401 without the password and the page with it, and its TLS ended on the sharing machine, with the wildcard certificate given to it. Without --share-domain the relay refuses share links with a reason. |
nfltr serve / forward, nfltr serve ssh --ssh with nfltr ssh | Works | Checked on 2026-10-26 with a relay, agents and clients on one machine, each with only the relay saved at enrolment: bytes through a forwarded service, and ssh through the embedded SSH server ran a command. |
A second account (a machine enrolled without --account) | Works | A client of that account reached its agent; neither account reached the other's agents. A machine added or revoked while the relay runs takes effect without a restart. |
nfltr up with tcp services and connect:, nfltr pipe | Works | Checked on 2026-11-01: bytes through a connect: mapping to a tcp service, and nfltr pipe to an end-to-end encrypted one. |
| Backup and restore, upgrade | Works | Checked on 2026-11-01: the data directory copied with the relay stopped, deleted, restored: the same machines and share link. The previous release's data directory read by the new relay: its share link. |
| Health check and metrics | Works | Checked on 2026-11-01: GET /healthz on the HTTPS port; Prometheus metrics on the loopback port named with --metrics-port (section 1). |
| Certificate files replaced | Works | Checked on 2026-11-01: new files written over --tls-cert and --tls-key were served within seconds, with no restart; clients kept working unchanged. |
1. Prepare a Linux VM
Any small Linux VM or machine that your other machines can reach, amd64 or arm64. Install the CLI with the relay (--with relay adds nfltr-relay, which nfltr relay serve runs), copy both where every user can run them, and give the relay its own user and data directory:
$ curl -fsSL https://nfltr.xyz/install.sh | sh -s -- --with relay
$ sudo install -m 755 ~/.local/bin/nfltr ~/.local/bin/nfltr-relay /usr/local/bin/
$ sudo useradd --system --create-home --home-dir /var/lib/nfltr-relay nfltr-relay
$ sudo chmod 00700 /var/lib/nfltr-relay
The relay listens on two TCP ports: 8443 (gRPC: agents and clients) and 8444 (HTTPS: API, artifacts). Open them to your machines only, for example with ufw:
$ sudo ufw allow from 10.0.0.0/8 to any port 8443,8444 proto tcp
Nothing else needs to be reachable: the internal API and the Prometheus metrics (/metrics) listen on 127.0.0.1, on ports the relay picks at each start and writes to <data-dir>/ports.json. To scrape the metrics at a fixed port, name it: --metrics-port 9464 (still on 127.0.0.1). For a health check, GET /healthz on the HTTPS port answers 200 while the relay serves. --grpc-port and --http-port change the two public ports; --listen binds one address instead of all.
2. Choose the TLS certificate
The relay does not listen on the network without TLS. Pick one:
- A certificate your machines already trust (your company CA, or a public one such as Let's Encrypt via certbot) for the name your machines use, for example
relay.example.com. Your machines need no pin. Put the PEM files where the relay user can read them, e.g./etc/nfltr-relay/fullchain.pemandprivkey.pem(mode 0640, groupnfltr-relay). - A self-signed certificate that the relay creates once and keeps in
<data-dir>/tls(ten years). Your machines pin its SHA-256 fingerprint: they trust exactly that certificate, and any other host is verified as before. List every name and IP your machines use with--tls-name.
3. Start the relay
Start it once in the foreground as the relay user to create the first machine's enrolment code and see the banner. With your certificate:
$ sudo -u nfltr-relay nfltr relay serve --data-dir /var/lib/nfltr-relay \
--tls-cert /etc/nfltr-relay/fullchain.pem --tls-key /etc/nfltr-relay/privkey.pem
Or self-signed:
$ sudo -u nfltr-relay nfltr relay serve --data-dir /var/lib/nfltr-relay --tls-self-signed --tls-name relay.lan,192.168.1.10
nfltr-relay (beta): gRPC 0.0.0.0:8443, HTTPS 0.0.0.0:8444, data /var/lib/nfltr-relay
Enrolment code of the first machine (admin): /var/lib/nfltr-relay/admin-enrol-code (created now, single use, valid 24 h; it is not printed); nfltr-relay machines code --data-dir /var/lib/nfltr-relay --code-file /var/lib/nfltr-relay/admin-enrol-code prints it as the relay code that machine's nfltr join takes
Another machine: nfltr-relay machines code --data-dir /var/lib/nfltr-relay --name <machine> --account admin (one code per machine, one account; admitted without a restart), or nfltr machines add on the admin machine
TLS certificate SHA-256: 3f1c…9a07
On each machine: nfltr join, and paste its code (it carries this relay's address, URL and certificate pin)
Secure defaults, with no flags to turn them off: every client presents a certificate of the relay's machine CA; the relay always serves TLS (on loopback with neither flag it makes a self-signed certificate); a data directory other users can read is refused. Stop it with Ctrl+C and run it as a service:
# /etc/systemd/system/nfltr-relay.service
[Unit]
Description=nfltr relay (beta)
After=network-online.target
[Service]
User=nfltr-relay
ExecStart=/usr/local/bin/nfltr relay serve --data-dir /var/lib/nfltr-relay --tls-cert /etc/nfltr-relay/fullchain.pem --tls-key /etc/nfltr-relay/privkey.pem
Restart=on-failure
[Install]
WantedBy=multi-user.target
$ sudo systemctl enable --now nfltr-relay
$ journalctl -u nfltr-relay | grep 'TLS certificate SHA-256'
For the self-signed form, use the --tls-self-signed --tls-name … flags in ExecStart instead of the certificate files. Ports below 1024 need extra capabilities; keep the defaults.
The relay limits each agent to 1000 requests per second, with bursts up to twice that. The start-up log prints the limit, and a request over it is answered 429 with a body naming --agent-rate-limit. Change it with --agent-rate-limit N, or turn it off with --agent-rate-limit 0 (which also turns off the per-visitor limit on share links) when every machine on the relay is yours. The number of connected agents is not limited unless you set --max-agents N; an agent above it stops with an error naming the limit.
4. Machines and accounts
The relay authenticates every machine by a certificate of its own machine CA (<data-dir>/machine-ca/, its key 0600). A machine enrols once with a single-use code: it makes its key itself (never sent), the relay signs its certificate, and the certificate lasts 24 hours and renews itself. The first start wrote machine admin's code to /var/lib/nfltr-relay/admin-enrol-code (mode 0600, single use, valid 24 hours); it is never printed, logged or put on a command line. Enrol the first machine with it (section 5).
nfltr relay machines code prints each code as one relay code: the single-use code with the relay's gRPC address, HTTPS URL and, for a self-signed certificate, its pin (from --tls-name, or a --listen address, and the bound ports; --relay host:port --proxy-url https://host:port set the address a machine reaches when it is another, such as behind a port forward). For the first machine, --code-file /var/lib/nfltr-relay/admin-enrol-code prints the first start's code that way. Each other machine gets a code of its own, printed once (one hour; --ttl changes it; --json prints the bare code for scripts):
$ sudo -u nfltr-relay nfltr relay machines code --data-dir /var/lib/nfltr-relay --name laptop --account admin
With --account, naming a machine of an account (its id, or a name only one machine holds), the new machine joins that account: machines of one account reach each other by <machine>/<service> (nfltr pipe laptop/chat to nfltr serve chat on laptop). Files and commands (--recv, --exec) need an organisation's end-to-end encrypted sessions (section 6). Without --account the machine is an account of its own (a person or a group of machines whose agents the others must not reach); a machine of another account never reaches it. A running relay admits the new machine without a restart. nfltr relay machines list --data-dir … lists the machines; nfltr relay machines revoke --data-dir … <machine id> removes one, and the relay refuses it from then on: its connections end at once, and so do the sessions open on them. A client's open session ends with reason ERROR_REASON_UNAUTHENTICATED, and nfltr pipe exits 2 (auth). A revoked machine's name is free again at once.
5. Point each machine at the relay
On every machine, nfltr join reads its relay code at a prompt (or --code-file FILE|-), saves the relay and the pin it carries, and enrols the machine:
$ nfltr join --code-file - < admin.relaycode
Relay relay.lan:8443 saved (/home/you/.config/nfltr/nfltr.json)
This machine is enrolled at relay relay.lan:8443.
$ rm admin.relaycode
$ nfltr status
The admin machine by signing in, with no code. Start the relay with your IdP: --sign-in <issuer URL> --client-id <id> --admin-email <address> (all three; register <id> at the IdP as a public client with a loopback redirect). nfltr relay machines link --data-dir /var/lib/nfltr-relay then prints the relay's sign-in link: its address, URL, pin, IdP and client id, all public. On the admin machine, nfltr join <link> makes the machine's key, opens the IdP's sign-in in the browser and sends the ID token with a request for that key; the relay takes it only from <address> (verified), for <id>, unexpired, and with its nonce naming that key, and then spends the first start's code for it. It works once: a second sign-in, or the same token again, is refused (403); an IdP the relay cannot reach answers 503 and spends nothing. After the first start's 24 hours, mint the admin a code instead (machines code --name admin). The sign-in admits a relay machine only: the organisation's root still decides who is a member.
The machine enrolled with the first start's code is the relay's admin machine: there, nfltr machines add and nfltr people invite mint the next machines' codes over the relay's API (one hour, single use, in the admin's account; any other machine is refused with 403). Provisioning scripts can keep nfltr login --relay <host:port> --proxy-url <url> [--cert-sha256 <fp>] --code-file -, which takes a bare code or a relay code.
Copy each code to its machine the way you copy any secret (scp, your secrets manager) and keep it out of shell history and chat; a code works once. Leave out --cert-sha256 for a certificate your machines trust. From now on every nfltr command on that machine uses your relay, unless NFLTR_SERVER or NFLTR_PROXY_URL in the environment names another one. NFLTR_RELAY_CERT_SHA256 overrides the saved pin. nfltr login --relay hosted goes back to nfltr.xyz. A config directory (NFLTR_CONFIG) is one machine: a second identity on the same host is a second directory with its own code. A machine that already holds a certificate that has not expired (for nfltr.xyz or another relay) is not enrolled over: nfltr join says so and changes nothing. To enrol it here anyway, nfltr login --relay <host:port> --proxy-url <url> [--cert-sha256 <fp>] --code-file - --replace, then revoke the old machine where it was enrolled.
6. Messages and files between your machines
Files, messages and commands between your machines go through nfltr cp and nfltr pipe across your relay as in Send files and messages: cp to a serve --recv service, pipe to a serve service. They are end-to-end encrypted organisation sessions (Organisations), so both machines are enrolled, and your relay carries only ciphertext.
7. Share links on your domain
nfltr up gives an http service a link that a browser opens, with a password if you set one (Share a local app). On your own relay the links are names under a domain of yours:
- Choose the domain, for example
share.example.com, and point a wildcard DNS record,*.share.example.com, at the relay. - Get a wildcard certificate for
*.share.example.comthat your visitors' browsers trust: from your company CA, or a public CA for a public domain. Let's Encrypt cannot issue one for a private domain. - Start the relay with
--share-domain share.example.com(add it toExecStart). That one flag is the relay's domain: share links<code>.share.example.com, each agent at<agent>.share.example.comfor requests from its account's machines, and, with TLS, end-to-end encrypted links on the gRPC port. TCP tunnels need no flag. - Give the wildcard certificate and key to each machine that shares, in its
nfltr upfile (e2ee_cert,e2ee_key) or asNFLTR_E2EE_CERTandNFLTR_E2EE_KEYin its environment.
services:
web: { http: 8080, share_auth: "friend:${FRIEND_PASS}", e2ee_cert: /etc/nfltr/share.pem, e2ee_key: /etc/nfltr/share.key }
$ FRIEND_PASS=… nfltr up -c nfltr.yaml
The link is end to end encrypted: TLS ends on the sharing machine with that certificate, and the relay forwards the encrypted bytes on its gRPC port. The link therefore names that port unless it is 443, for example https://k3x9….share.example.com:8443/, and your visitors need to reach it. A machine that shares without the certificate gets a link whose TLS the relay ends with its own certificate, on its HTTPS port (--http-port), so the relay can read that link's traffic.
What your relay stores
On disk, under the data directory: the machine CA, the machines file and shares.db (share codes and the messages not yet received). Which agents are connected is kept in memory only.
What leaves your network
With your own relay, nfltr contacts nothing but your relay on its own: not nfltr.xyz, and no other service of ours or anyone else's. Checked on 2026-10-03 with the same containers as the table above, on a Docker network with no route out. Their only DNS server and gateway was a logger that recorded every name looked up and every connection attempt, while every row of that table ran:
- The relay and the machines (
nfltrcommands, agent-to-agent messages) looked up no name but the relay's own, and attempted no connection out of the network.
What still goes out, and only because you set it up:
- Let's Encrypt, only when a machine shares a link without the wildcard certificate (section 7).
nfltr updatedownloads releases fromstorage.googleapis.com/nfltr-downloads, only when you run it, and says so first when your own relay is configured. Nothing in nfltr checks for updates by itself. To keep the relay's VM offline, copy the binary to it instead.nfltr loginsigns in to nfltr.xyz; you do not need it with your own relay.
Restart, upgrade, back up
- Restart (
sudo systemctl restart nfltr-relay): the machines and the self-signed certificate stay the same, share codes and messages not yet received stay (in the data directory'sshares.db), and agents reconnect by themselves (in the check above, within 12 seconds). Certificate files you replace in place (--tls-cert,--tls-key, for example after a renewal) need no restart: the relay checks them at most every 10 seconds and serves the new pair; a pair that does not load is ignored and the current one kept. - Upgrade:
sudo nfltr update --apply(or the two install commands again), then restart. Upgrade the machines' CLIs the same way. - Back up: stop the relay and copy
/var/lib/nfltr-relay(machine-ca/,machines,shares.dbwith its-waland-shmfiles, andtls/when self-signed). To restore, put the copy back with the relay stopped and start it: the same machines and share codes. - New machine CA: stop the relay, delete
machine-ca/,machinesandadmin-enrol-code, start it, and enrol each machine again with a new code. New self-signed certificate: deletetls/the same way; machines need the new pin.
Not supported in the beta
- Share links without
--share-domain: the relay refuses them with HTTP 400 and its reason,shares need http.share_domain(section 7). - The dashboard and Google sign-in; high availability, failover or several relays; automatic certificates (ACME): you bring and renew the certificate files; Windows as the relay host.
Troubleshooting
| The CLI prints | Cause and fix |
|---|---|
relaytrust: certificate 623f…c7c9 is not the pinned relay certificate and does not verify: x509: certificate signed by unknown authority | The saved pin (or NFLTR_RELAY_CERT_SHA256) is not the relay's certificate, e.g. after tls/ was recreated. Save the new pin with the fingerprint from the relay's log: nfltr login --relay <host:port> --proxy-url <url> --cert-sha256 <fingerprint>. |
tls: failed to verify certificate: x509: certificate signed by unknown authority | A self-signed relay and no pin on this machine: enrol with a relay code (nfltr join), which carries the pin, or save it with nfltr login --relay … --cert-sha256. With your own CA, install the CA in the machine's trust store. |
--cert-sha256: certificate fingerprint "…": want the 64 hex digits of a SHA-256 | The fingerprint was cut or mistyped. Copy the whole line from the relay's log. |
no machine certificate for relay relay.lan:8443 | This machine has not enrolled: run nfltr join with its relay code. |
HTTP 401 from the relay | The certificate is not this relay's machine CA's, or the machine was revoked: enrol it again with a new code. |
dial tcp 192.168.1.10:8443: connect: connection refused | The relay is not running or the firewall blocks the port: check systemctl status nfltr-relay and the ufw rule. |
--listen 0.0.0.0: give --tls-cert and --tls-key, or --tls-self-signed (whose fingerprint clients pin) | Started on a network address without a certificate. Add one of the TLS forms from step 2. |
data dir /var/lib/nfltr-relay is open to other users (mode 755): chmod 700 /var/lib/nfltr-relay | Run the chmod it names. |
Related: Send files and messages · Share a local app · Organisations.