How I Turned My Linux PC into a T3 Code Server I Can Use from Anywhere
A short, step-by-step guide.
My Linux PC runs T3 Code as a background service, all the time. Tailscale connects it privately to my MacBook and my Android phone. Nothing is open to the public internet.
Updated October 2026: T3 Code now handles two things this guide used to do by hand, so the setup is shorter. It turns on lingering when you install the service, and
t3 pair --tailscalesets up Tailscale Serve permanently. Followed the old version? See the cleanup note.
You need:
- A Linux PC with systemd (I used Ubuntu)
- Tailscale on the PC and on every device you want to connect from
- Node.js only if your agent CLIs need it (Codex installs with npm)
Step 1: Install T3 Code
curl -fsSL https://t3.codes/install.sh | sh
This puts t3 in ~/.local/bin. If you get t3: command not found, add the PATH line the installer prints to your shell config and open a new terminal.
Want the nightly build instead?
curl -fsSL https://t3.codes/install.sh | T3CODE_CHANNEL=nightly sh
Step 2: Run it as a service
t3 service install
t3 service status
You should see Status: installed · t3@<version>. The service starts at boot and keeps running after you log out, even if nobody ever logs in.
If install says lingering is disabled, it couldn't turn it on without admin rights. Run only this with sudo, then run
t3 service installagain as your normal user:
sudo loginctl enable-linger "$(id -un)"
Don't run t3 itself with sudo. That creates a separate install that belongs to root.
Step 3: Publish it on your tailnet and pair
Let your own user manage Tailscale Serve (one time):
sudo tailscale set --operator=$USER
Then, on the PC:
t3 pair --tailscale
This does two things. It maps a private HTTPS address like https://my-pc.tailXXXXX.ts.net to the service, and that mapping survives restarts. Then it prints a pairing link and QR code.
In the T3 Code app, add an environment (Settings → Connections on the web and desktop apps, Settings → Environments on mobile), then paste the link or scan the QR code.
A pairing link works once and expires after 5 minutes. Need more time?
t3 pair --tailscale --ttl 1h. Run it again for each new device; devices you already paired reconnect on their own.
Check the mapping any time with:
tailscale serve status
The first HTTPS certificate can take a few seconds, so if the address doesn't load right away, wait and try again.
Can't connect?
If you see something like this, your device can't reach the PC:
Failed to fetch remote environment endpoint ... (HttpClientError: Transport error ...)
Check these, in order:
- Tailscale is Connected on the device.
- Mac: Tailscale menu → Settings → turn on Use Tailscale DNS.
- Android: Settings → Private DNS → Off. "Automatic" didn't work for me.
- The pairing link hasn't expired or already been used.
t3 service statuson the PC says it's installed and running.
Step 4: Install your agent CLIs
T3 Code runs agents through their command-line tools, so install them on the PC. For Codex:
npm i -g @openai/codex
codex login status
When the service starts, T3 Code reads PATH from your login shell, so CLIs installed through nvm or into ~/.local/bin are usually found. If an agent still shows as not installed, give the service the path explicitly:
mkdir -p ~/.config/systemd/user/t3code.service.d
cat > ~/.config/systemd/user/t3code.service.d/path.conf <<EOF
[Service]
Environment=PATH=$HOME/.local/bin:$(dirname $(which node)):/usr/local/bin:/usr/bin:/bin:/snap/bin
EOF
systemctl --user daemon-reload
t3 service restart
This file survives T3 updates. If you switch Node versions with nvm, run it again.
Step 5: Keep it reachable
Stop the PC from sleeping:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Tailscale logins expire after about 6 months. In the Tailscale admin console, click ⋯ next to your PC and choose Disable key expiry.
Updating T3 Code
Golden rule: keep the PC, the t3 command and all your apps on the same channel. A client and server on different versions refuse to connect instead of half-working.
On the PC:
t3 update --channel nightly --yes
(Use stable, preview or nightly, whichever your other devices use. Without --yes, it asks before restarting the service.)
You don't always need a terminal: when the PC falls behind, the app shows an update notice, and Update server updates the background service remotely.
Updates restart the server, which interrupts running agents. Turn on Settings → General → Continue threads after restarts to have supported threads pick up where they left off.
Coming from the first version of this guide?
The first version added a systemd drop-in with T3CODE_TAILSCALE_SERVE=1. You don't need it anymore: t3 pair --tailscale keeps the mapping on its own. Remove that line from ~/.config/systemd/user/t3code.service.d/tailscale.conf. Keep the PATH line only if your agents need it (Step 4), or delete the file. Then:
systemctl --user daemon-reload
t3 service restart
t3 pair --tailscale
The separate loginctl enable-linger step is now part of t3 service install, so you can skip it on new machines.
That's it: T3 Code on my PC, from anywhere. 🚀