At a glance
- What it is
cloudflaredmakes outbound-only connections to Cloudflare, which serves a public hostname for you- You need
- A Cloudflare account and a domain on Cloudflare
- Herald sees
- An
https://address, like any other - Sign-in
- Hermes’ dashboard username and password
- Cost
- Cloudflare Tunnel is on every plan, including Free
If you still want a tunnel
A tunnel avoids opening router ports and gives you a stable HTTPS name that works without any app on the phone. The dashboard behind it can read your API keys and run commands, so only go ahead if you accept that its sign-in page is reachable by anyone.
Keep the password herald-setup generates, which is 20 random characters, rather than one you have used elsewhere. Hermes rate-limits sign-in attempts, and Herald reports a 429 as too many attempts.
Set up a tunnel for Herald
- Create a tunnel
In the Cloudflare dashboard, go to Networking › Tunnels and select Create Tunnel. Give it a name, choose the computer’s operating system and run the install command it shows on the computer that runs Hermes.
- Add a published application route
Under Routes, select Add route, then Published application. Pick a hostname such as
hermes.example.comand set the Service URL tohttp://127.0.0.1:9119. Leave HTTP Host Header empty, so Hermes sees your hostname. - Run herald-setup with your hostname
It writes the dashboard password, sets
dashboard.public_urlto that address, keeps Hermes on 127.0.0.1 and starts it. When it starts Hermes, it waits until the address answers through the tunnel before it prints the QR code.npx herald-setup --url https://hermes.example.com - Scan the QR code in Herald
Tap Scan the QR code. The code carries the address and the new password.
What Herald needs from the tunnel
- Hermes at the root of the hostname. Herald keeps only the scheme, host and port of an address, so a path such as
/hermeswon’t work. - WebSockets passed through. Herald’s chat runs over a WebSocket to
/api/ws. Cloudflare Tunnel supports WebSockets; keep the WebSockets setting on in your zone’s Network settings. - The Host header unchanged. Hermes only accepts the exact hostname in
dashboard.public_url, as a guard against DNS rebinding. - No login page or challenge in front. Herald can only answer Hermes’ own sign-in, so Cloudflare Access logins, email codes and bot challenges block it.
cloudflaredon the same computer. Hermes trusts forwarding headers from loopback automatically; a connector in another container or on another host must be listed indashboard.trusted_proxies.
Why not a Quick Tunnel?
cloudflared tunnel --url http://127.0.0.1:9119 gives you a random trycloudflare.com address without an account. Cloudflare says Quick Tunnels are for testing, have no uptime guarantee and get a new hostname every time, and that anyone with the URL can reach your service.
With Herald, a new hostname means pairing again after every restart: Herald only retries other forms of the same host and addresses the connection used before. Cloudflare also notes that its email check for Quick Tunnels needs an interactive browser and doesn’t support non-interactive clients.
Cloudflare Tunnel or Tailscale?
| Question | Cloudflare Tunnel | Tailscale |
|---|---|---|
| Who can reach the sign-in page | Anyone on the internet | Only devices on your tailnet |
| App needed on the phone | None | Tailscale |
| Domain needed | Yes, on Cloudflare | No, you get a ts.net name |
| Fits Hermes’ guidance for password sign-in | No | Yes, it is a VPN |
| Setup with herald-setup | --url https://your-hostname | Automatic |
Troubleshooting
- Cloudflare shows an error page. Hermes isn’t running, or the Service URL is wrong. On the computer, check that
curl http://127.0.0.1:9119/api/healthanswers. - Sign-in works but chats never load. The WebSocket is being blocked. Check the zone’s WebSockets setting and any firewall or bot rules on the hostname.
- Invalid Host header. The tunnel is rewriting the Host header, or
dashboard.public_urldoesn’t match the hostname. Run herald-setup again with the exact address. - The password is refused, or Herald signs out. See dashboard sign-in problems and signed out with a 401.
Questions
Can I put Cloudflare Access in front of Hermes?
Not for Herald. Access shows its own login page, and Herald can only answer Hermes’ sign-in. If you need a login layer in front of Hermes, use Tailscale instead, where only your devices can reach the address.
Is Cloudflare Tunnel free?
Cloudflare Tunnel is available on every Cloudflare plan, including Free. To publish a stable hostname you need a domain on Cloudflare, and registering a domain usually costs money.
Does Herald work with a trycloudflare.com address?
Only until cloudflared stops: the next Quick Tunnel gets a different hostname, so you would pair again each time. Cloudflare says Quick Tunnels are for testing and development.
Why does Hermes need public_url for a tunnel?
Hermes rejects requests whose Host header isn’t loopback or a name it has been told about. dashboard.public_url adds your tunnel’s hostname and keeps the sign-in gate on, even though Hermes itself listens on 127.0.0.1. herald-setup writes it for any https:// address.
