Files
docker-compose-cookbooks/headscale/docs/users-and-keys.md
T
codeandClaude Opus 5.5 665c27e7f4 headscale: promote from _dev, split README into per-task docs
Move step-by-step guides into headscale/docs/, slim README to a quick
reference, and use $HEADSCALE_CONTAINER for docker exec commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:07:10 +00:00

896 B

Create a User and Pre-Auth Key

← Back to README

Commands below use $HEADSCALE_CONTAINER. Set it once per shell session on the dedicated server (change the value if your compose project name differs; find it with docker ps):

export HEADSCALE_CONTAINER=headscale-headscale-1
docker exec -it "$HEADSCALE_CONTAINER" headscale -c /etc/headscale/config.yaml user create homelab
docker exec -it "$HEADSCALE_CONTAINER" headscale users list
docker exec -it "$HEADSCALE_CONTAINER" headscale preauthkeys create --user 1 --expiration 1h

Copy the printed key — you'll use it once on each device you join.

About --expiration: it only limits the window in which the key can register a new device. Devices already joined stay authorized after the key expires. Use a longer expiration (e.g. 24h) or --reusable when onboarding several devices.