Self-hosted relay (kettu-relay)

Deploy kettu-relay on your own server and connect from Desktop, Android, iPhone/iPad, daemon, and browser without a Kettu account.

kettu-relay is Kettu’s open source relay that you run on your own server. Once your computers sign in to it, your Android phone, iPhone/iPad, other computers, or browser can reach them from any network—with no Kettu account, no VPN, and no port forwarding on your computers.

The relay only forwards Kettu’s end-to-end encrypted traffic and never sees your sessions, files, or keys.

Order matters: configure the relay key on the host computer only

Do not paste the kettu-relay link (https://…#key=krk_…) into the pairing field on your phone or another computer.

Follow this two-step order:

  1. Configure your own relay on the computer you want to reach (Desktop app or Daemon)—the access key stays encrypted on that host and is never given to clients.
  2. Generate a pairing code on that computer (click Add device…), then scan it or paste the pairing link on Android, iPhone/iPad, or another computer. The pairing code automatically carries your relay address (and certificate pin for IP-only relays), so clients need no relay setup and no Kettu account.

Pick a publicly reachable server and start kettu-relay using one of the setups below. The first start prints the full relay link (such as https://relay.example.com#key=krk_…), and kettu-relay link prints it again at any time.

Point a domain at your server and open ports 80 and 443 (for automatic Let’s Encrypt certificates), then run on Linux with systemd:

curl -fsSL https://kettu.sh/relay/install | sudo sh -s -- --domain relay.example.com

Print the link again later with:

sudo -u kettu-relay sh -c 'set -a; . /etc/kettu-relay.env; kettu-relay link'

Keep the relay link private

Anyone who has the full relay link (with #key=krk_…) can sign computers in to your relay. If it leaks, run kettu-relay key reset—the old key stops working within seconds.

2. Connect your host computer to the relay

Configure the computer you want to access remotely (Desktop app or server Daemon) first.

Open Settings › Remote access and turn on Remote access.

Under Relay, choose Your own relay.

Paste the full relay link (https://relay.example.com#key=krk_…, or https://203.0.113.7#key=krk_…&pin=… for IP-only relays) into Address. Kettu automatically splits the address, access key, and certificate pin into the right fields (or you can enter them separately).

Click Use this relay. Kettu verifies the address, certificate/pin, and access key before switching. Once connected, the status card shows Connected · xx ms · relay x.y.z.

If you want clients to connect exclusively through your relay, you can turn off Direct connections on the same page (leaving it on lets devices on the same Wi-Fi or VPN connect directly).

3. Pair your phone, another computer, or browser

Once the host computer shows Connected, pair your client devices. The pairing code already carries your relay address (and IP certificate pin)—no relay key and no Kettu account are needed on the client.

Make sure the Android app is on v0.0.7 or later (adds full domain and IP-pinned self-hosted relay support; get the latest APK on the Download page).

On the host computer, open Settings › Remote access, click Add device… under Devices, and keep Open with set to App (on a daemon server, run kettu pair). A QR code and pairing link appear.

Open Kettu on Android:

  • First launch (signed out): tap Continue without an account to use Kettu account-free.
  • Already inside the app: open Computers, tap Add a computer, and choose Scan a pairing code or Paste a pairing link.

Scan the QR code on the host computer, or choose Paste a pairing link and paste the pairing link from Add device… (not the #key= relay link).

Back on the host computer, verify the device name/code and click Add to approve pairing (or confirm in the daemon terminal).

Once paired, the computer card and dashboard show Its own relay, <your relay>.

Later, you can also view status, switch relay addresses, or replace the host’s access key directly from Android under the computer’s Dashboard › Remote access and devices › Relay › Your own relay (pasting a full #key=&pin= link splits automatically).

4. Switching relays, rotating keys, and automatic migration

  • Switching relay addresses: Click Change… in Settings › Remote access › Relay on the host computer (or from Remote access and devices on iPhone/Android). Any client that is online at the time moves to the new relay automatically; offline devices pick up the change the next time they connect on the same network, or when paired again.
  • Rotating the access key: Run kettu-relay key reset and kettu-relay link on the relay server. The host computer’s status changes to Refused · the relay has a new access key—click Paste new link… or Replace… and paste the new link. Paired phones and browsers do not need to re-pair.

5. Troubleshooting

SymptomCause and fix
Phone says the pasted link is not a valid pairing codeYou likely pasted the kettu-relay relay link (#key=krk_…). Configure that link on the host computer under Settings › Remote access › Relay › Your own relay, then use Add device… to generate a pairing code for your phone.
Android cannot connect to an IP-only relay or lacks self-hosted relay controlsUpdate the Android app to v0.0.7 or later, and verify the host computer was configured with the full link including &pin=….
Client says it cannot reach the relayCheck that kettu-relay is running, firewall/security group allows TCP 443, and TLS is valid. Behind nginx, verify Upgrade, Connection "upgrade", and proxy_read_timeout 1h are set.
Client says the computer is offline on the relayYour relay is reachable, but the host computer is not signed in to it. Confirm Kettu is running on the host, Remote access is on, and Relay shows Connected.
Host shows Refused · the relay has a new access keyThe key changed or was reset with kettu-relay key reset. Run kettu-relay link on the server and paste the new link on the host.
Browser fails to open an IP-only relayBrowsers cannot pin self-signed certificates, so IP-only relays do not serve the web client. Bind a domain for browser access, or use Desktop, iPhone/iPad, or Android.