# headscale server ## Docker (Truenas Scale App) ### user You need to be have at least one user. You can think of a user as one local network. ``` sudo docker exec ix-headscale-headscale-1 headscale users create ``` List the users: ``` sudo docker exec ix-headscale-headscale-1 headscale users list ``` Add a key to a user: ``` sudo docker exec ix-headscale-headscale-1 headscale nodes register --user --key ``` ### nodes/devices The nodes are the devices registered to a user/network. List the nodes: ``` sudo docker exec ix-headscale-headscale-1 headscale nodes list ``` ### Creating key Normaly you just let the Truenas Client create the key for you. But if you want to run the docker app to add a device to a tailscale/headscale instance you need to manually create a key. ``` sudo docker exec ix-headscale-headscale-1 headscale preauthkeys create --user --reusable=false sudo docker exec ix-headscale-headscale-1 headscale preauthkeys create --user --reusable=true ``` You get the ID from listing all the Users.