Skip to content

Install Tealhand Host on Linux

Tealhand Host is the service on a computer that checks and runs the commands your phone signs. This page installs it on a Linux computer with no screen, from source, and keeps it running as a systemd user service. It runs as you, never as root.

  • A Linux computer you can log in to, over SSH or at the keyboard.
  • Git, Rust through rustup (the repository pins Rust 1.99.1 in rust-toolchain.toml) and a C compiler. On Debian or Ubuntu: sudo apt install build-essential git curl.
  • systemd, for the service below.
Terminal window
git clone https://github.com/tealvpn/tealhand
cd tealhand
rustup toolchain install
cargo build -p tealhand-host
mkdir -p ~/.local/bin
install -m 755 target/debug/tealhand-host ~/.local/bin/tealhand-host

Check that it runs, and make sure ~/.local/bin is on your PATH:

Terminal window
tealhand-host --version

Every command and option: command line reference.

Connect first, with Host not running. If it already runs as a service, stop it: systemctl --user stop tealhand-host.

Terminal window
tealhand-host connect --relay https://relay.example.com

Leave out --relay to use this network only. A relay you give here is saved and used by run and by the service. See Install Tealhand Relay for your own relay, and add --relay-pin sha256:<64 hex digits> if it uses a self-signed certificate.

Over SSH the QR code is drawn in your terminal. If it is hard to scan, the command also prints the code as a line of text: “No camera at hand? Copy the line below to the phone and choose “Paste the code” there:“. On the phone choose “Paste the code” and paste that line. The phone and the computer must be on the same network to connect, and the code works for 10 minutes. The phone shows a check code and the terminal asks:

"Pixel 8" wants to connect to this computer.
Check code: ABCD EFGH. Connect only if the phone shows the same code.
Connect? [y/N]

Answer y only if both codes are the same. The command ends with Connected to "Pixel 8". Start Tealhand Host with: tealhand-host run. More on what happens: Connecting a phone.

The repository ships a sample unit, crates/tealhand-host/packaging/tealhand-host.service. It runs tealhand-host run --power-helper %h/.local/bin/tealhand-power, restarts on failure after 5 seconds, and holds no address and no key. %h is your home folder. With a debug build the helper file does not have to exist yet, but the path must be absolute, as it is.

Terminal window
mkdir -p ~/.config/systemd/user
cp crates/tealhand-host/packaging/tealhand-host.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now tealhand-host
loginctl enable-linger "$USER"

loginctl enable-linger keeps your user services running when nobody is logged in, and starts them at boot. Without it, the service stops when your last session ends.

Check on it:

Terminal window
systemctl --user status tealhand-host
journalctl --user -u tealhand-host

The journal shows one line per event and, when it stops, an error line with the fix under it. Set RUST_LOG in the unit to change the log level.

Tealhand Host listens on one UDP port, the one iroh uses. The first run picks a free port and saves it; every later start reuses it, so the address in a connection QR code stays valid. Choose it with --port <n> on connect or run. Nothing else listens.

If the computer has a firewall that blocks inbound UDP, open that port for your local network. For ufw, with your port in place of 41234:

Terminal window
sudo ufw allow 41234/udp

Without an open port the phone can still reach the computer through a relay once connected; only connecting and direct local connections need it.

What Where
Data folder $XDG_DATA_HOME/tealhand/host, or ~/.local/share/tealhand/host when that is not set. Made 0700
The computer’s key The Secret Service when one runs; on a headless server without one, key.bin in the data folder, mode 0600

The files in the data folder: Headless computers.

Folders for the phone’s Files screen are shared at the computer, with the service stopped: Share folders.

Terminal window
systemctl --user stop tealhand-host
tealhand-host remote off
systemctl --user start tealhand-host

remote off keeps remote control off from the next start. It prints “Remote control is off from the next start. Only this computer can switch it on again.” While it is off, a phone can still see the computer’s status and cancel a running countdown, but it cannot change anything or open a file. See Remote control on and off.

To forget the connected phone (a lost phone), stop the service and run tealhand-host unpair.

Pull the repository, build again, install over ~/.local/bin/tealhand-host, and restart the service: systemctl --user restart tealhand-host. The data folder keeps your connected phone, rules and shared folders.