Skip to content

Cloud server with Tailscale

Your cloud server (EC2, a VPS, any Linux machine) runs herdr and the hmob gateway. Your iPhone reaches it over your tailnet. The server needs no inbound port for hmob: no security group or firewall rule to open.

  • A Linux server (x86_64 or aarch64) with herdr installed, and SSH access to it.
  • Tailscale on the iPhone, signed in.
  • The Hmob app on the iPhone.
Terminal window
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up # open the printed link and sign in to the same tailnet
TS_IP="$(tailscale ip -4)"
echo "$TS_IP" # 100.x.y.z

As the user who runs herdr (not root):

Terminal window
curl -fsSL https://hmob-app.github.io/install.sh | sh
export PATH="$HOME/.local/bin:$PATH" # if the script says it is not on PATH

Listen on the Tailscale address only:

Terminal window
hmob install-service --bind "$TS_IP"
hmob status
ss -ltn | grep 8443 # only 100.x.y.z:8443

This installs a systemd user service and enables lingering, so it runs at boot without you logging in. Follow its log with journalctl --user -u hmob -f.

Terminal window
hmob pair --url "https://$TS_IP:8443"

With Tailscale on in the iPhone, open the Hmob app, tap Scan pairing QR code and scan the code in your SSH terminal. The code is valid for 5 minutes and can be used once.

Keep TCP 8443 closed to the internet; Tailscale carries the traffic. Tailscale connects without any inbound rule. Allowing inbound UDP 41641 is optional and only helps it make direct (rather than relayed) connections.

Symptom Check
Pairing times out Tailscale is on in the iPhone; tailscale status lists the phone; hmob status shows the service running.
“A TLS error caused the secure connection to fail” You entered the address by hand, or paired by host name. Pair again by scanning a QR code made with --url https://$TS_IP:8443.
The service does not start after a reboot systemctl --user status hmob and journalctl --user -u hmob. If it started before Tailscale had its address, it retries on its own within seconds.