A new tailnet starts with a policy that lets every device talk to every other device on every port. I find that fine for a week and a bit uncomfortable after that, especially once half my Unraid containers sit on the tailnet. Here is how I’d narrow it: give the containers a tag, write one grant for the port you really use, and let Tailscale test the policy before it saves it. You need a Tailscale account with admin rights, and containers that already run with Unraid’s Tailscale option.
- Time
- 5 min
- Steps
- 6
- Updated
- 19 Nov 2026
You will learn
- Know what you are replacing
- Create a tag for the containers
- Put the tag on the container
- Write the grant
- Let a test catch the mistake
Step 1 of 6: Know what you are replacing
Tailscale’s own examples show the allow-all policy as one grant:
{
"grants": [
{ "src": ["*"], "dst": ["*"], "ip": ["*"] }
]
}
Tailscale says grants are deny-by-default, so every rule you add allows something, and nothing narrows the broad rule until you remove or replace it. Noted’s Tailscale series says the same thing about the default policy: a restrictive rule next to the allow-all rule does nothing. Open Access controls in the admin console and look at what is there before you change anything.
Step 2 of 6: Create a tag for the containers
Tags are for machines. In the policy file, declare the tag and say who may hand it out:
"tagOwners": {
"tag:container": ["[email protected]"]
}
Use your own login in there. Two things from the Tailscale tag docs I’d keep in mind: a device has either a tag identity or a user identity, never both, so do not tag your laptop or phone. And a device that is tagged and authenticated for the first time has key expiry switched off, which is what you want for a server container.
Step 3 of 6: Put the tag on the container
Unraid’s per-container integration has a Tailscale Extra Parameters field, under Tailscale Show Advanced Settings in the container’s edit page. Tailscale’s Unraid page says to put the tag there with --advertise-tags=tag:container. That page also describes creating an OAuth client with Read and Write on Auth Keys and passing it as --authkey=<secret> next to the tag, because a tag needs an authkey that is allowed to apply it. Press Apply, and the container shows up on the Machines page with the tag instead of your name.
If you would rather not touch the container, the Machines page has Edit tags in each device’s menu. The tag has to exist in the policy file first.
Step 4 of 6: Write the grant
Say Jellyfin is the only thing you want other devices to reach on its container, on port 8096. Tailscale’s grants example shows the shape (a group to a tag on a TCP port), so mine is:
"grants": [
{
"src": ["autogroup:member"],
"dst": ["tag:container"],
"ip": ["tcp:8096"]
}
]
I used autogroup:member, the selector for the people in your tailnet, instead of the group from the docs example, so you do not need a groups section. Check the selector against Tailscale’s grants syntax reference for your plan. Swap the port for whatever your container serves; ip takes several entries, like ["tcp:443", "tcp:22"]. If you have subnet routers or exit nodes, add grants for them before you delete the allow-all grant, or they stop working.
Step 5 of 6: Let a test catch the mistake
The policy file has a tests section. Tailscale runs it on every save, and when a test fails the new policy is rejected and nothing changes. That is the safety net for a change that can lock you out of your own server.
"tests": [
{
"src": "[email protected]",
"accept": ["tag:container:8096"],
"deny": ["tag:container:22"]
}
]
A src here can be an email, group or tag; destinations need a single port and no wildcards or CIDR ranges.
Step 6 of 6: Remove the allow-all grant last
Save with both the new grant and the old allow-all grant in place, open the container from a device that should have access, then delete the allow-all grant and save again. Test from your phone too. Tailscale applies the new policy within moments.
How it breaks: you tagged a laptop and lost its user identity (authenticate it again with your account, which removes its tags), or a tag shows up on the Machines page that the policy file does not declare, or the container is still reachable on the LAN. Tailscale access controls only cover the tailnet. The app’s own login and your firewall still matter.
I’d do this on a quiet evening, not with a stream running. Tested against the Tailscale docs as of 13 November 2026; I did not check the Unraid version, so check the field name in your version.
Further reading
- Tailscale: tags
- Tailscale: Unraid integration
- Tailscale: example grants
- Tailscale: policy file syntax (tests)
- Noted: Tailscale Part 5, Securing Your Homelab with Access Controls
- On this site: Manage your Unraid server from anywhere with Tailscale and no open ports
- On this site: Use your Unraid server as a Tailscale exit node, and know what the docs do not say
- On this site: Back up your Unraid appdata with Duplicati, encrypted, to a European provider, and prove it with a test restore
