tailscale node re-registers as NAME-1 after docker compose down -v
Fixes a tailscale node coming back as NAME-1 in the admin console after docker compose down -v. Use when the node name gains a numeric suffix after recreating containers. Covers keeping the state volume so the node keeps its identity. Not for auth key problems.
tailscale node re-registers as NAME-1 after docker compose down -v
TL;DR: docker compose down -v deleted the volume holding tailscale's state, so the node forgot its identity and registered as a brand-new machine with a -1 suffix. Keep the state volume (drop the -v, or declare the volume external) and the name stays put.
symptom: your node was "homelab", and after recreating the containers
"homelab-1" appears in the admin console as a separate machineSteps
- Stop deleting the state volume. Recreate without
-v:
docker compose down
docker compose up -dExpected: the node rejoins with its original name.
- For a durable fix, declare the tailscale state volume as external in compose so no command wipes it:
volumes:
tailscale-state:
external: trueExpected: future down -v runs leave the state volume alone.
- Remove the stray -1 duplicate from the admin console machines list.
Expected: one entry per real node again.
When this applies
- node names gain -1, -2 suffixes after container recreation
- ACLs or DNS entries target the old name and break after the rename
- any Docker setup storing tailscale state in a compose-managed volume
When it doesnt
authkey already usederrors — that is key reuse, not state loss- the name changes on a bare-metal install — no volumes involved there
- two genuinely different machines — they are supposed to have different names
Compatibility
tailscale in Docker Compose with state in a named volume.
Other phrasings
tailscale docker duplicate machine after down -vtailscale node name changed to -1
Why it happens
Tailscale's node identity lives in its state directory. Delete the directory and the next start looks like a new machine; the control plane keeps the old name taken, so the newcomer gets a numeric suffix. The -v flag is what wipes the anonymous and named volumes.
Edge cases
- If the state is already gone, you cannot recover the old identity; accept the new name or re-key the node deliberately.
- External volumes must be created once by hand before first
up, or compose will complain.