5.1 KiB
Remote Access
Use this when you want to connect to a T3 Code server from another device such as a phone, tablet, or separate desktop app.
Recommended Setup
Use a trusted private network that meshes your devices together, such as a tailnet.
That gives you:
- a stable address to connect to
- transport security at the network layer
- less exposure than opening the server to the public internet
Enabling Network Access
There are two ways to expose your server for remote connections: from the desktop app or from the CLI.
Option 1: Desktop App
If you are already running the desktop app and want to make it reachable from other devices:
- Open Settings → Connections.
- Under Manage Local Backend, toggle Network access on. This will restart the app and run the backend on all network interfaces.
- The settings panel will show the default reachable endpoint, with a
+Ncontrol when more endpoints are available. Expand it to inspect alternatives such as loopback, LAN, private-network, or HTTPS endpoints. - Use Create Link to generate a pairing link you can share with another device.
The default endpoint controls the QR code and primary copy action for pairing links. You can change it from the expanded endpoint list. The preference is stored by endpoint type, so choosing the local LAN endpoint survives normal IP address changes when you move between networks.
When no user default is saved, the app chooses the best reachable endpoint for pairing links:
- HTTPS/WSS-compatible endpoints are preferred because they work from
https://app.t3.codes. - Non-loopback HTTP endpoints are used for direct LAN pairing when HTTPS is not available.
- Loopback-only endpoints are not useful for another device unless that device is the same machine.
If the copied link points directly at http://192.168.x.y:3773, open it from a client that can reach that LAN address. If it points at https://app.t3.codes/pair?..., the hosted web app will save the environment and connect directly to the backend URL in the link.
Option 2: Headless Server (CLI)
Use this when you want to run the server without a GUI, for example on a remote machine over SSH.
Run the server with t3 serve.
npx t3 serve --host "$(tailscale ip -4)"
t3 serve starts the server without opening a browser and prints:
- a connection string
- a pairing token
- a pairing URL
- a QR code for the pairing URL
From there, connect from another device in either of these ways:
- scan the QR code on your phone
- in the desktop app, enter the full pairing URL
- in the desktop app, enter the host and token separately
- in the hosted web app, open a hosted pairing URL when the backend is reachable over HTTPS
Use t3 serve --help for the full flag reference. It supports the same general startup options as the normal server command, including an optional cwd argument.
Note The GUIs do not currently support adding projects on remote environments. For now, use
t3 project ...on the server machine instead. Full GUI support for remote project management is coming soon.
How Pairing Works
The remote device does not need a long-lived secret up front.
Instead:
t3 serveissues a one-time owner pairing token.- The remote device exchanges that token with the server.
- The server creates an authenticated session for that device.
After pairing, future access is session-based. You do not need to keep reusing the original token unless you are pairing a new device.
Hosted Web App Pairing
The hosted web app at https://app.t3.codes can save a remote backend in browser local storage from a URL like:
https://app.t3.codes/pair?host=https://backend.example.com:3773#token=PAIRCODE
Use hosted pairing when the backend is reachable from the browser over HTTPS/WSS. This includes a backend behind a trusted HTTPS tunnel or another HTTPS endpoint you operate.
Do not use hosted pairing for plain HTTP LAN URLs such as http://192.168.x.y:3773. Browsers block an HTTPS page from connecting to an insecure HTTP or WS backend. For those endpoints, use the direct pairing URL shown by the desktop app or CLI from a client that can open that HTTP URL directly.
Hosted pairing does not proxy traffic through T3 Code. The browser still connects directly to the backend URL in the pairing link.
Managing Access Later
Use t3 auth to manage access after the initial pairing flow.
Typical uses:
- issue additional pairing credentials
- inspect active sessions
- revoke old pairing links or sessions
Use t3 auth --help and the nested subcommand help pages for the full reference.
Security Notes
- Treat pairing URLs and pairing tokens like passwords.
- Prefer binding
--hostto a trusted private address, such as a Tailnet IP, instead of exposing the server broadly. - Anyone with a valid pairing credential can create a session until that credential expires or is revoked.
- Hosted pairing links keep the credential in the URL hash so it is not sent to the hosted app server, but it can still be exposed through browser history, screenshots, logs, or copy/paste.
- Use
t3 authto revoke credentials or sessions you no longer trust.