Keys / Tailscale

TS_AUTHKEY

A Tailscale auth key that adds a container, server or tsnet app to your tailnet without an interactive login.

Starts with
tskey-auth-
Expires
you choose, 1 to 90 days; 90 by default
API
create, list and delete, with an API access token or OAuth client

Get it

Create one on console.tailscale.com/admin/settings/keys. The steps aren't recorded yet.

Set it

TS_AUTHKEY=tskey-auth-...

The Tailscale container image and tsnet read it on their own; tailscale up takes it with --auth-key. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Generate a new auth key with the same reusable, ephemeral, pre-approved and tags settings.
  2. Deploy it everywhere that reads TS_AUTHKEY.
  3. Check that nothing still uses the old key, then revoke it on the Keys page. Devices it already added stay in the tailnet; remove them on the Machines page.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16