Repository navigation
Remote access
CHERNOBYL has no cloud relay. Your phone connects straight to the companion on your PC, so you choose how it gets there: your home Wi-Fi, a private network such as Tailscale, or a tunnel you run yourself.
Security comes from pairing, not from the network. After pairing, every message between phone and PC is encrypted end to end with a key only those two hold. A router, VPN relay or tunnel in between sees encrypted messages, their timing and their size, but not their content.
- The pairing key. The QR code carries a 256-bit key made for that one phone. It is never sent over the network after that. Phone and PC prove to each other that they hold it, and every later message is sealed with ChaCha20-Poly1305. A replayed, altered or out-of-order message closes the connection.
-
The access token. The token (
HOST_TOKEN) only lets a connection in. It must be at least 32 characters, and the companion refuses to listen beyond loopback without one. Beyond loopback, a token alone cannot run anything or read any state: the paired encrypted session is required too. - Unless the network adds TLS, a middleman can see the token in the connection request. That is why the token is not enough on its own.
This is what the setup script sets up for you. To do it by hand:
-
Start the companion on all interfaces with a token:
.\chernobyl-companion.exe --bind 0.0.0.0 --port 8787 --token <your-token>
-
Create a pairing QR for your PC's LAN address (replace the example address with yours):
.\chernobyl-companion.exe --pair --endpoint ws://192.168.1.50:8787
If the companion is already running,
--pairasks it to create the offer, so you do not need to restart it. -
On the phone, pair as described in Pairing.
Tailscale lets your phone reach the PC from any network without opening ports on your router.
-
Install Tailscale on the PC and the phone and sign in to both. Note the PC's tailnet address (
100.x.y.z) or its MagicDNS name. -
Start the companion on that address (or
0.0.0.0) with a token:.\chernobyl-companion.exe --bind 100.x.y.z --port 8787 --token <your-token>
-
Create the pairing QR for the tailnet address:
.\chernobyl-companion.exe --pair --endpoint ws://100.x.y.z:8787 # or with MagicDNS: .\chernobyl-companion.exe --pair --endpoint ws://my-desktop.tailnet-name.ts.net:8787
A tunnel or reverse proxy gives you a public wss:// address that forwards to the companion on loopback.
-
Point the tunnel at
ws://127.0.0.1:8787(for ngrok,http://127.0.0.1:8787). -
Start the companion on loopback with a token and
--require-e2e:.\chernobyl-companion.exe --bind 127.0.0.1 --port 8787 --token <your-token> --require-e2e
-
Create the pairing QR with the public address:
.\chernobyl-companion.exe --pair --endpoint wss://agents.example.com
Always use --require-e2e behind a tunnel. The tunnel connects to the companion from loopback, and without the flag the companion treats loopback connections as local. With it (or "server": {"requireE2e": true} in companion.json), every command and every state snapshot needs the paired encrypted session, as on a LAN bind. The companion also treats a connection that carries proxy headers (such as X-Forwarded-For or ngrok's own headers) as remote, but a proxy that strips those headers gets none of that protection, so keep the flag.
-
-TunnelUrl wss://hostadds your tunnel as a second address in the QR, turns onrequireE2e, and checks that the tunnel reaches the companion. -
-NgrokDomain <name>.ngrok-free.devrunsngrok http <port> --url <domain>hidden, now and at every login, and sets-TunnelUrlfor you. Runngrok config add-authtokenonce yourself first; the script never handles your ngrok token. Use-Ngrok <path>ifngrok.exeis not atC:\ngrok\ngrok.exe.
--endpoint can be repeated. The phone tries the addresses in the order you give them, so put the home address first:
.\chernobyl-companion.exe --pair --endpoint ws://192.168.1.50:8787 --endpoint ws://100.x.y.z:8787If the first address cannot be reached (you left home), the phone moves on to the next. Once it has connected, it starts from the first address again next time.
If the addresses make the payload too long for a terminal QR code, the companion prints the payload: {...} line and you paste that into the app instead of scanning.
- Always set a token of at least 32 characters for anything beyond loopback.
- Limit the firewall rule for port 8787 to your private network or your Tailscale interface. The setup script adds a rule for Private networks only. The diagnostics port (9487) only ever listens on
127.0.0.1. - Browsers cannot connect: a WebSocket request that carries a browser
Originheader is refused. - Revoke a lost phone at once: see Pairing.
The app shows two different states when it loses the companion.
| State | What the app does | Usual causes |
|---|---|---|
| Reconnecting | Retries on its own, working through the addresses in the QR. Commands you sent wait and are sent again once it reconnects. | A Wi-Fi drop, switching networks, the companion restarting, or missed heartbeats. |
| Denied | Stops trying until you act. | Wrong or missing token, a revoked phone, an expired or already used pairing, a version mismatch. |
What to do for each Denied reason is in Troubleshooting.
CHERNOBYL is free software under the GNU General Public License v3.0, made by N&D Co. Read more on the CHERNOBYL project page.
Get started
Use it
- Sessions
- Approvals
- Plans and audit
- Notifications and background
- Remote access
- Android 4.4 tablet client
Keep it safe
Help