Open History to see the last commit
1# Remote Access
2
3Use this when you want to connect to a T3 Code server from another device such as a phone, tablet, or separate desktop app.
4
5## Recommended Setup
6
7Use a trusted private network that meshes your devices together, such as a tailnet.
8
9That gives you:
10
11- a stable address to connect to
12- transport security at the network layer
13- less exposure than opening the server to the public internet
14
15## Enabling Network Access
16
17There are two ways to expose your server for remote connections: from the desktop app or from the CLI.
18
19### Option 1: Desktop App
20
21If you are already running the desktop app and want to make it reachable from other devices:
22
231. Open **Settings** → **Connections**.
242. Under **Manage Local Backend**, toggle **Network access** on. This will restart the app and run the backend on all network interfaces.
253. The settings panel will show the address the server is reachable at (e.g. `http://192.168.x.y:3773`).
264. Use **Create Link** to generate a pairing link you can share with another device.
27
28### Option 2: Headless Server (CLI)
29
30Use this when you want to run the server without a GUI, for example on a remote machine over SSH.
31
32Run the server with `t3 serve`.
33
34```bash
35npx t3 serve --host "$(tailscale ip -4)"
36```
37
38`t3 serve` starts the server without opening a browser and prints:
39
40- a connection string
41- a pairing token
42- a pairing URL
43- a QR code for the pairing URL
44
45From there, connect from another device in either of these ways:
46
47- scan the QR code on your phone
48- in the desktop app, enter the full pairing URL
49- in the desktop app, enter the host and token separately
50
51Use `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.
52
53> Note
54> The GUIs do not currently support adding projects on remote environments.
55> For now, use `t3 project ...` on the server machine instead.
56> Full GUI support for remote project management is coming soon.
57
58## How Pairing Works
59
60The remote device does not need a long-lived secret up front.
61
62Instead:
63
641. `t3 serve` issues a one-time owner pairing token.
652. The remote device exchanges that token with the server.
663. The server creates an authenticated session for that device.
67
68After pairing, future access is session-based. You do not need to keep reusing the original token unless you are pairing a new device.
69
70## Managing Access Later
71
72Use `t3 auth` to manage access after the initial pairing flow.
73
74Typical uses:
75
76- issue additional pairing credentials
77- inspect active sessions
78- revoke old pairing links or sessions
79
80Use `t3 auth --help` and the nested subcommand help pages for the full reference.
81
82## Security Notes
83
84- Treat pairing URLs and pairing tokens like passwords.
85- Prefer binding `--host` to a trusted private address, such as a Tailnet IP, instead of exposing the server broadly.
86- Anyone with a valid pairing credential can create a session until that credential expires or is revoked.
87- Use `t3 auth` to revoke credentials or sessions you no longer trust.