Publications
Make a service running on 127.0.0.1 reachable from one profile's tailnet — and from nothing else. The inverse of a tunnel, applied live, with your tailnet's ACLs as the access control.
View as MarkdownWhat a publication is#
A publication takes a service you already run on this machine — a dev server on 127.0.0.1:8080, a preview build, an internal dashboard — and makes it reachable from exactly one profile's tailnet. Teammates on that tailnet open it through the profile's node; nobody on your other tailnets, your local network, or the public internet can.
It is the mirror image of a tunnel. A tunnel is outbound: a loopback port on your machine relayed into one tailnet. A publication is inbound: a port on one profile's tailnet node relayed back to a loopback target.
1peer on the work tailnet2 │3 ▼4work profile's node, tailnet port 4435 │ TailMux relays — one profile, no fallback6 ▼7127.0.0.1:8080 (your own service)The tailnet-side listener lives inside the profile's embedded node. TailMux opens no new port on your network interfaces; the only OS socket involved is TailMux's own connection to your loopback service.
Publishing a service#
In the app, open Publications (the macOS menu bar app: Open → Publications; the Fedora app: Publications in the sidebar) and click Add Publication:
1Name: preview2Profile: work3Local service: 127.0.0.1:80804Tailnet port: 4435Serve over HTTPS: onOnce it is listening, the row shows the address your tailnet uses — copy it with one click and share it. You never assemble it yourself:
1https://tailmux-work.example-tailnet.ts.netThe same publication from the CLI. Every publish subcommand talks to the running TailMux service:
$tailmux publish add preview --profile work --target 127.0.0.1:8080 --port 443 --tls$tailmux publish listpublish list prints one line per publication: name, profile, state (stopped, starting, listening, error, or blocked), who can reach it (see Making it reachable), the tailnet address, the local target, and the reason when something is wrong. Add -o json for scripts.
--profile— the one profile whose tailnet serves the publication.--target— the local service, which must be a loopbackhost:portsuch as127.0.0.1:8080.--port— the port on the tailnet side. Required: TailMux never picks one for you, because it is part of the address you share.--tls— serve over HTTPS with the tailnet's certificate (see below). Off by default.--reach—tailnet, the default and the only reach this version serves.
HTTPS#
With Serve over HTTPS (--tls, tls: true), TailMux terminates TLS on the tailnet side using the MagicDNS certificate Tailscale issues for the profile's node, and relays the decrypted connection to your loopback target — so the local service itself speaks plain HTTP. On port 443 the address is a clean https:// URL with no port.
Without HTTPS the publication is a raw TCP relay and its address reads tcp://<host>:<port>. Use that for anything that is not HTTP, or for a service that already does its own TLS.
Who can reach it#
A publication is reachable by the devices of one tailnet, subject to that tailnet's ACLs — and by nothing else.
- A publication belongs to exactly one profile and is served only by that profile's node. Another profile's tailnet has no listener on that port, so it can never reach it.
- The target must be loopback. TailMux will not publish a host on your local network — it is not a LAN-to-tailnet gateway.
- The target cannot be one of TailMux's own listeners — a tunnel, a proxy, the PAC server, or the control API. Publishing one would let one tailnet relay into another.
- Nothing is published unless you add it.
Making it reachable#
A publication can be listening and still reachable by nobody. Your tailnet's access policy decides which devices may connect to the profile's node, and TailMux cannot change or get around it. While a publication is listening, TailMux reads that policy from the node and tells you what it allows:
- Reachable — the app shows "reachable from 3 devices" (or "from every device in the tailnet");
publish listshowsreachable (3)oreveryonein theREACHcolumn. - Unreachable — no device is allowed to connect. The app's badge reads Unreachable;
publish listshowsunreachable. - Unknown — TailMux could not tell, for example because the policy admits devices by capability rather than by address, and says why. It never reports a publication as unreachable on a guess.
-inREACH— the publication is not listening, so there is nothing to check.
On a tailnet with the default policy, which lets every device reach every other, there is nothing to do: every device in that tailnet can reach your publications.
On a tailnet with a restricted policy, the profile's node is a new device that no rule mentions, so its publications start out unreachable. To fix it:
- Click Make reachable… on the publication in the app, or run
tailmux publish policy preview. - Add the two entries it shows to the tailnet policy file — one inside
"hosts", one inside"grants". Open Access Controls takes you to the policy editor on tailscale.com. Not an admin? Send the lines to your tailnet admin. - Once the policy is saved, the badge turns back to Published within half a minute.
1"hosts": {2 // TailMux publications: profile work on laptop3 "tailmux-work": "100.64.0.10",4},5 6"grants": [7 // TailMux publications: profile work on laptop.8 // Only TailMux publications listen on this node, so "*" opens nothing else.9 {10 "src": ["you@example.com"],11 "dst": ["tailmux-work"],12 "ip": ["*"],13 },14],You do this once per computer and profile. The entries cover every publication on that profile, on any port, including ones you add later — there are no per-port rules to maintain.
What the entries open, and to whom:
"ip": ["*"]opens only your publications. The profile's node listens on nothing else: no SSH, no other ports on your computer, none of TailMux's own local listeners. Turning a publication off closes its port."src"decides who can connect. TailMux suggests your own login, which admits only your own devices. Widen it — to a group, for example — only if you mean to share with those people.
For a profile on a custom control server, TailMux shows the same two entries but cannot link to its admin console: edit the policy where that server keeps it.
Managing publications#
$tailmux publish stop preview # close its tailnet listener$tailmux publish start preview # open it again$tailmux publish stop --all # take every publication off its tailnet$tailmux publish rm preview # delete it from the configuration- Publications apply live — adding, editing, starting, stopping, or removing one needs no router restart, unlike routing changes.
- Enabled publications start automatically when the service runs. A stopped publication stays stopped across restarts until you start it again.
publish stop --allis the panic button: it stops every publication in one command.stopworks even without a valid licence, so you can always take a service down.publish addonly creates. To replace a publication from the CLI, remove it withpublish rmand add it again; in the app, use Edit publication.- A publication in
errorshows the reason on its row; fix the cause (for example, enable HTTPS on the tailnet), then restart it from its row in the app or runpublish start.
Configuration#
Publications live in the same config file as everything else, under publications:. The app and the CLI write this block for you; you can also edit it by hand.
1publications:2 preview:3 display_name: "Preview build" # optional; defaults to the key4 profile: work # a tsnet profile5 target: 127.0.0.1:8080 # must be loopback6 port: 443 # tailnet-side port, required7 tls: true # HTTPS with the tailnet's MagicDNS certificate8 reach: tailnet # default9 disabled: false # true = stoppedThe tailnet port must be unique per profile: two publications cannot share a port on the same profile, but a work and a personal publication can both use 443.
Requirements#
- The profile must use the
tsnetbackend. Publications are served by the embedded node; a profile on thetailscaledbackend is rejected with an error that names the fix. Switching a profile tobackend: tsnetmeans authenticating that profile again, because the two backends do not share state — see backends. - The TailMux service must be running. A publication needs the live, signed-in profile that only the service owns, so
tailmux publishfails with a clear message when no service is running. The menu bar and Fedora apps run it for you. - A valid licence. Adding, starting, listing, and removing publications need one, like tunnels; stopping does not.
- HTTPS enabled on the tailnet — only for publications with
tls: true.
Notes#
- Tailnet only.
reach: funnelis accepted in the config file but this version never serves it: such a publication is reported asblockedand stays off the public internet. There is no public-internet path in this version. - Publications are TCP. They do not advertise subnet routes, turn TailMux into an exit node, or publish Tailscale Services.
- TailMux publishes a service that is already running; it does not start or supervise your application.
- To reach a service on a tailnet from this machine — the opposite direction — use a tunnel.