Notes on Using Tailscale Serve to Expose a Local App over HTTPS Inside a Tailnet Only

What is this Link to this heading

Notes from trying out Tailscale Serve after learning that it exists.

What is Tailscale Serve Link to this heading

Tailscale Serve is a feature where Tailscale acts as a reverse proxy and exposes a local port over HTTPS inside your tailnet (= Tailscale network) only.

Since the local port is never exposed to the outside world and is only reachable from within the tailnet, binding a Docker container’s published port to loopback alone is enough to restrict access to it to the tailnet. That way, even if your local network is compromised, the port stays out of reach unless the attacker gets inside the tailnet.

On the flip side, it is reachable from anywhere within the tailnet, which is handy for getting to local-only apps or development environments running on your PC from your phone.

It is also served over HTTPS, so you can use things that require HTTPS, such as passkey logins, linking external accounts, and browser notifications. Tailscale obtains and renews the certificates automatically, so there is nothing to maintain.

As of November 24, 2026, the Personal plan is free for non-commercial use with up to 6 users. There is no limit on devices as long as they are treated as the logged-in user’s own machines, so they can all connect for free. That is plenty for a personal homelab.

Trying it out Link to this heading

This assumes Tailscale is already installed.

When trying this out, be careful not to include personal information in your machine names.

The first time you use it, you need to open the Tailscale admin console and enable “MagicDNS” and “HTTPS Certificates” at the bottom of the page. When you enable “HTTPS Certificates”, you get a warning that your machine names will be made public. This is because the machine names end up in the certificate’s public log. See below for details.

If you are using Docker Compose, configure a localhost bind in the ports setting of compose.yaml as follows. Combined with Tailscale Serve, this limits access to the inside of the tailnet.

services:
  myservice:
    ports:
      - "127.0.0.1:8090:8090"

Once that is in place, set up the serve configuration with Tailscale Serve. The command to run depends on how you want to expose it.

For example, to serve local port 8090, run the following. In this case it is exposed as https://<マシン名>.<tailnet名>.ts.net/.

tailscale serve --bg 8090

To stop serving it, the command is as follows.

tailscale serve off

To serve it on a separate port, run the following. In this case it is exposed as https://<マシン名>.<tailnet名>.ts.net:<ポート番号>/.

tailscale serve --bg --https=8090 8090

To stop serving it, the command is as follows.

tailscale serve --https=8090 off

To serve it under a separate path, run the following. In this case it is exposed as https://<マシン名>.<tailnet名>.ts.net/<パス>/. Note that this requires the app itself to support running under a subpath.

tailscale serve --bg --set-path=/<パス> 8090

To stop serving it, the command is as follows.

tailscale serve --set-path=/<パス> off

By the way, --bg is the flag for running in the background, and the configuration stays in effect across reboots.

References and URLs Link to this heading

Licensed under CC BY-NC-SA 4.0
Last updated on Nov 23, 2026