Skip to content

Tailscale Setup

If you’re running PizzaPi on a machine in your Tailscale network, you can use Tailscale Serve to expose the web UI over HTTPS with a valid TLS certificate — no reverse proxy or manual cert management needed.


  • A working PizzaPi deployment (see Self-Hosting)
  • Tailscale installed and logged in on the host machine
  • MagicDNS enabled in your Tailscale admin console (enabled by default)

  1. Start Tailscale Serve

    Proxy HTTPS traffic to the local PizzaPi port (default 7492). No manual certificate is needed — Tailscale Serve provisions and renews its own TLS certificate automatically.

    Terminal window
    tailscale serve --bg http://localhost:7492

    The web UI is now available at:

    https://your-hostname.tail12345.ts.net/
  2. Update allowed origins

    The server validates request origins for security. Add your Tailscale HTTPS URL to PIZZAPI_EXTRA_ORIGINS.

    See the Self-Hosting guide for full details on setting environment variables and override files.

    Use config set to persist the extra origin:

    Terminal window
    pizzapi web config set extraOrigins "https://your-hostname.tail12345.ts.net"

    Then restart:

    Terminal window
    pizzapi web stop && pizzapi web
  3. Verify

    Open https://your-hostname.tail12345.ts.net/ in your browser. You should see a valid certificate issued by Let’s Encrypt and the PizzaPi login page.


Terminal window
# Check current serve config
tailscale serve status
# Stop serving
tailscale serve off

If you want to expose PizzaPi to the public internet (not just your Tailnet), you can use Tailscale Funnel instead of Serve:

Terminal window
tailscale funnel --bg http://localhost:7492

This makes your instance available to anyone at https://your-hostname.tail12345.ts.net/ — no VPN required for visitors.


For contributors running the dev stack, PizzaPi’s Vite config can automatically load Tailscale TLS certificates for the dev server.

  1. Generate certificates into the certs/ directory

    Terminal window
    sudo tailscale cert \
    --cert-file certs/ts.crt \
    --key-file certs/ts.key \
    your-hostname.tail12345.ts.net
  2. Set the extra origins env var

    Terminal window
    export PIZZAPI_EXTRA_ORIGINS=https://your-hostname.tail12345.ts.net:5173
  3. Start the dev server

    Terminal window
    bun run dev

    Vite detects certs/ts.crt and certs/ts.key and serves the UI over HTTPS automatically.


SymptomCauseFix
SSL/certificate error in browserTailscale Serve not running, or accessing :7492 directly over HTTPSUse the default HTTPS URL (port 443) and ensure tailscale serve is active
Blank pageServe configured with https+insecure:// backendUse http://localhost:7492 (plain HTTP) as the backend — the server doesn’t speak TLS
”Invalid origin” errorPIZZAPI_EXTRA_ORIGINS doesn’t match the URL, or has a trailing slashSet it to https://your-hostname.tail12345.ts.net (no trailing slash) and restart
502 Bad GatewayTailscale Serve config was lost (e.g. after reboot)Re-run tailscale serve --bg http://localhost:7492
Port already allocatedAnother container or process is using the portRun docker ps -a --filter "publish=7492" to find the conflict, stop it, then retry
Can’t reach from other Tailnet devicesTailscale ACLs blocking accessCheck your ACL policy allows traffic on port 443
bind: address already in use on :443 for another containertailscale serve holds 443 on the tailnet IP; lsof does not show it (the bind lives inside tailscaled)Confirm with netstat -an | grep '\.443 ' and move the other service to a different port

Tailscale Serve covers the relay itself, but it cannot cover PizzaPi’s host-based tunnels, which need a wildcard hostname (<label>.<domain>):

Terminal window
$ dig +short abc123.your-host.tail12345.ts.net
(NXDOMAIN MagicDNS resolves registered node names only)
$ tailscale cert abc123.your-host.tail12345.ts.net
500: invalid domain; must be one of ["your-host.tail12345.ts.net"]

MagicDNS has no wildcard and Tailscale issues certificates only for a node’s own name, so no reverse proxy — Caddy, nginx or otherwise — can serve *.your-host.tail12345.ts.net. Separately, the relay refuses any tunnel domain inside its own cookie scope. Use a different domain for tunnels, pointed at the tailnet IP; see Tunnel TLS.