Getting started¶
This page helps you get started with headscale and provides a few usage examples for the headscale command line tool headscale
.
Prerequisites
- Headscale is installed and running as system service. Read the setup section for installation instructions.
- The configuration file exists and is adjusted to suit your environment, see Configuration for details.
- The Tailscale client is installed, see Client and operating system support for more information.
Getting help¶
The headscale
command line tool provides built-in help. To show available commands along with their arguments and options, run:
Manage users¶
In headscale, a node (also known as machine or device) is always assigned to a specific user, a tailnet. Such users can be managed with the headscale users
command. Invoke the built-in help for more information: headscale users --help
.
Create a user¶
List existing users¶
Register a node¶
One has to register a node first to use headscale as coordination with Tailscale. The following examples work for the Tailscale client on Linux/BSD operating systems. Alternatively, follow the instructions to connect Android, Apple or Windows devices.
Normal, interactive login¶
On a client machine, run the tailscale up
command and provide the FQDN of your headscale instance as argument:
Usually, a browser window with further instructions is opened and contains the value for <YOUR_MACHINE_KEY>
. Approve and register the node on your headscale server:
Using a preauthkey¶
It is also possible to generate a preauthkey and register a node non-interactively. First, generate a preauthkey on the headscale instance. By default, the key is valid for one hour and can only be used once (see headscale preauthkeys --help
for other options):
The command returns the preauthkey on success which is used to connect a node to the headscale instance via the tailscale up
command: