Skip to content
Pocket Homelab
Install

Reach your apps away from home

Why iOS blocks plain http to a VPN or Tailscale address, and three ways to give Pocket Core, the Pocket apps and your other services an https address the iPhone can use anywhere, background syncs included.

iPhone
On this page

At home, an address like http://192.168.1.20:8300 works. Away from home, over Tailscale or WireGuard, the same server needs an https:// address, or the iPhone will not talk to it. This is true for Pocket Core, every Pocket app and any other service you connect. It matters most for what the app does in the background, such as sending Apple Health to Pocket Health, location to Pocket Movement, or queued changes when the connection comes back.

Why plain http stops at the front door

iOS lets an app use plain http:// only for addresses on the local network:

  • private addresses: 192.168.x.x, 10.x.x.x, 172.16.x.x to 172.31.x.x
  • names ending in .local, and single-word names such as http://nas:8080

Anything else is blocked by iOS before the request leaves the phone. That includes a Tailscale 100.x.y.y address and a MagicDNS name such as box.tail1234.ts.net, even though the VPN connects you to your own server. iOS enforces this rule (App Transport Security) for every app, and an app cannot make an exception for an IP range.

So the fix is on the server: give it a name with a certificate the iPhone trusts. If you installed Pocket Core with the one-line install, option 1 does that for you; options 2 to 4 are for any other server.

Option 1: Pocket’s free address on your tailnet

Pocket’s free address (<random>.box.pockethomelab.net) has a real Let’s Encrypt certificate, so iOS accepts it anywhere. What matters is where it points:

  • A VPS: the plain install command does it. Pocket joins your tailnet as a device of its own (approve the link the script prints) and the name points at Pocket’s tailnet address from the start. It works on every device on your tailnet, and nothing is open to the internet. See On a VPS.

  • A machine at home: the name points at its home-network address, so it works at home without anything installed on the phone. For away from home, pick one:

    1. Route your home network over Tailscale. On any always-on machine at home that runs Tailscale: sudo tailscale set --advertise-routes=192.168.1.0/24 (your network), then approve the route in the Tailscale admin console under Machines → … → Edit route settings. The same name now works at home and away.
    2. Or put Pocket on the tailnet. Install with --tailnet: Pocket joins your tailnet as a device of its own and the name points at its Tailscale address. It works wherever Tailscale is on, at home too, and nowhere else.

Connecting Tailscale is also in the setup in the browser (Away from home), and later under Settings → System in Pocket Core.

Option 2: Tailscale Serve

Tailscale can fetch a certificate for your server’s ts.net name and forward https to an app’s port. Nothing is opened to the internet.

  1. In the Tailscale admin console, under DNS, turn on MagicDNS and HTTPS Certificates.

  2. On the server, serve each app’s port over https on the same port number:

    tailscale serve --bg --https=8300 http://127.0.0.1:8300
    tailscale serve status

    The app is now at https://box.tail1234.ts.net:8300 (your machine and tailnet names).

  3. Use that https address in the app (and in Pocket Core, if it hands the address out).

The certificate is listed in public Certificate Transparency logs, so your machine and tailnet names are visible there. The traffic and your data are not.

Option 3: your own domain, open to the internet

Run the installer with --domain example.com --email you@example.com. Caddy gets a Let’s Encrypt certificate for core.example.com and every <app>.example.com. *.example.com must point at the server, and ports 80 and 443 must reach it from the internet. See Install Pocket Core and the apps.

Option 4: your own domain, reachable only over the VPN

This works with any VPN, and nothing listens on the internet.

  1. Point a DNS record such as health.example.com (or *.example.com) at the server’s VPN address, for example 100.101.102.103. From the internet that address leads nowhere; on the VPN it reaches the server.

  2. The server cannot be reached for the usual Let’s Encrypt check, so prove the domain through DNS instead (the ACME DNS challenge). With Caddy, build it with your DNS provider’s module (for example xcaddy build --with github.com/caddy-dns/cloudflare) and give it a token that can edit the zone:

    health.example.com {
    	tls {
    		dns cloudflare {env.CF_API_TOKEN}
    	}
    	reverse_proxy 127.0.0.1:8199
    }
  3. Use https://health.example.com in the app.

A self-signed certificate also works, but only after every iPhone installs it and turns it on under Settings → General → About → Certificate Trust Settings. One of the options above is less work.

Keep the VPN on in the background

iOS wakes the app when there is something to send: new Apple Health data, a location change, a queued change. It can only reach the server if the VPN is connected at that moment. In the Tailscale app, turn on VPN On Demand (or use an always-on WireGuard profile), so the connection comes up by itself when the phone leaves home.

Check it

  1. In the app, change the service’s address to the https:// one. Tokens and passwords stay the same.
  2. Turn Wi-Fi off, keep the VPN on, and press Test connection in the service’s settings.
  3. For a background sync (Pocket Health, Pocket Movement), record something, wait a few minutes, and look at the app’s last push on the server (in Pocket Health: Settings → Phone & imports).

If it still fails, Troubleshooting goes through VPN routing, DNS and certificate errors.