Any host with a Cloudflare relay
The host and the phone both dial out to a small relay in your own Cloudflare account, and the relay passes their messages along. The host needs no open port and no VPN, and the phone connects from any network. It works the same for a Mac at home and for a cloud server.
The relay only ever handles ciphertext. The phone and the host seal every message end to end (ChaCha20-Poly1305) with a key from the pairing QR code, and that key never reaches the relay. The relay’s code is open source under the MIT license: hmob-app/cloudflare-relay.
Is it the right setup?
Section titled “Is it the right setup?”Choose it when you cannot or do not want to install Tailscale or WireGuard on the phone. Keep in mind:
- It runs on Cloudflare’s free plan, which has daily allowances that reset at 00:00 UTC. One person watching agents for eight hours a day stays well inside them; the relay’s README has the numbers.
- No notifications on the lock screen. The app still notifies you while it is open and connected.
workers.devaddresses are unreliable from some networks, mainland China among them. If you have a domain on Cloudflare, serve the relay from it (step 3).- The relay is for your own devices. Do not share it with other people: each person deploys their own.
Before you start
Section titled “Before you start”- A host with herdr: a Mac with Apple silicon or a Linux server (x86_64 or aarch64).
- Node.js 24 and
giton the host. - A Cloudflare account (the free plan is enough) with a
workers.devsubdomain: the dashboard offers one the first time you open Workers & Pages. - The Hmob app on the phone: from the App Store on iPhone and iPad, or the Android APK.
1. Install the gateway
Section titled “1. Install the gateway”curl -fsSL https://hmob.app/install.sh | sh2. Sign in to Cloudflare
Section titled “2. Sign in to Cloudflare”On the host:
git clone https://github.com/hmob-app/cloudflare-relay.git && cd cloudflare-relaynpm cinpx wrangler loginwrangler login opens a browser to grant access to your Cloudflare account. On a server you reach over SSH, run npx wrangler login --device instead: it prints a link and a code to enter in the browser on your computer.
3. Deploy the relay
Section titled “3. Deploy the relay”scripts/deploy.sh --location apacPick the location nearest your host: wnam (western North America), enam (eastern North America), sam (South America), weur (western Europe), eeur (eastern Europe), apac (Asia-Pacific), oc (Oceania), afr (Africa) or me (Middle East). It applies only when the relay first starts; later deployments do not move it.
To serve the relay from a hostname in one of your Cloudflare zones, add --domain relay.example.com (run it in a terminal, so wrangler can ask before it takes over an existing DNS record), and pass it again on every later deployment.
The script creates a credential for the relay, uploads it to Cloudflare as a secret with the relay, and stores the relay’s address and credential in the host’s hmob configuration. It never prints the credential. Check the result with:
hmob relay status4. Pair your phone
Section titled “4. Pair your phone”hmob add "My phone"This prints a QR code, and the first time it also installs the relay service and starts it at boot: a launchd agent on macOS, a systemd user service on Linux (with lingering enabled, so it runs without you logging in). Open the Hmob app, tap Scan pairing QR code and scan the code.
For a second phone or an iPad, run hmob add again with another name. The running service picks it up within a few seconds.
hmob devices # the paired devices and their idshmob devices --revoke <id> # unpair one; it is cut off at onceUpdate, rotate, remove
Section titled “Update, rotate, remove”- Update the relay after a new version:
git pull && scripts/deploy.sh, with the same--domainif you used one. The credential stays the same. - Replace the credential if it may have leaked:
scripts/deploy.sh --rotate. Then restart the relay service (hmob install-service --relay), and pair every phone again. - Remove the relay from Cloudflare:
scripts/deploy.sh --delete.
Several of your own hosts can share one relay; the relay’s README explains how to configure the others.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Check |
|---|---|
hmob add says no relay is configured |
Step 3 did not finish. Run scripts/deploy.sh again and check hmob relay status. |
| The phone stays on “Connecting” | The relay service is running: systemctl --user status hmob-relay on Linux, ~/Library/Logs/hmob-relay.log on macOS. |
| The phone cannot connect from some networks or countries | The network blocks workers.dev. Deploy with --domain and pair again. |
| It stops working, then works again after 00:00 UTC | The free plan’s daily allowance is used up; it comes back at 00:00 UTC. The Workers Paid plan lifts the limit. |
| The app asks you to pair again | The credential was rotated or the device revoked. Run hmob add and scan the new code. |