---
title: "Attach to phux on another machine over Tailscale"
url: "https://docs.phux.sh/tailscale"
source: "https://github.com/no-phux/website/blob/bffc0f5a462084993a7cfe1367f97d7ac533cf9f/src/site-docs/tailscale.md"
projectVersion: "0.113.1"
protocolVersion: "1.0.0"
stability: "stable"
---

# Attach to phux on another machine over Tailscale

If your machines are on a Tailscale network you run, phux host discover lists them and phux attach connects to a phux server you added. Tailscale is optional; phux host add also works over plain SSH.

```sh
phux host discover
phux host add DNS_NAME --name mini --install --accept-new-host-key
phux attach mini
```

Tailscale is optional, and the tailnet is your own. Without it, `phux host add me@mini` works over the SSH access you already have ([Remote machines](/remote)). With it, `phux host discover` lists your machines so you don't type their names. Tailscale makes encrypted point-to-point connections between machines you install it on ([what Tailscale is](https://tailscale.com/kb/1151/what-is-tailscale)). phux does not install Tailscale or sign you in. Their [install guide](https://tailscale.com/kb/1017/install) is the setup. MagicDNS is on by default and names each machine. `DNS_NAME` in the snippet is the name `phux host discover` prints.

`phux host discover` reads the local Tailscale client (`tailscale status --json`). It reports whether that client is signed in and connected, every other machine on the tailnet, which of them run an OS phux ships for, and which you already registered. It does not register a machine and it does not contact one. `--json` prints a document. `--login` signs in or reconnects first: it opens the macOS app, reconnects a stopped client, or prints a sign-in link and returns while the browser finishes. Run `phux host discover` again afterwards.

`phux host add` connects over SSH. `--install` installs phux on that machine, or updates an older copy, and unless you pass `--no-service` it installs a service so the server comes back after a reboot. The server's policy becomes `paired`. The direct attach uses QUIC on UDP 8788. `--accept-new-host-key` trusts an SSH host key you have never seen. A key that changed is still refused. [Remote machines](/remote#machines-on-your-tailnet) calls that flag safe on a tailnet, because the tailnet already vouches for the address. A machine that runs [Tailscale SSH](https://tailscale.com/kb/1193/tailscale-ssh) needs no SSH key of yours. `--name mini` is the local label. `phux attach mini` then connects over QUIC, and SSH is no longer in the path.

`phux ls --all` lists sessions on this machine and on every machine you registered.

From a device that has only an SSH client, run `ssh -t user@host phux attach`. If that SSH session drops, the programs keep running, and so do the sessions and the scrollback. [What survives what](/concepts#what-survives-what). A server crash or a reboot ends the programs. Sessions, tabs, and panes come back without them. `phux restore` starts the programs again. The service from `phux host add` starts the server after a reboot. It does not start the programs.

On Windows, the CLI and TUI run under WSL 2. The native desktop build is not published yet. [Windows (WSL)](/installation#windows-wsl).

phux has no accounts and no hosted service. Each machine runs its own server. A machine you add can do everything you can do on that server, including typing into panes. Only add machines you control. With no remote configuration, the server accepts only the local socket.

## Next

- [Remote machines](/remote)
- [See which coding agent is waiting on you](/agent-waiting)