Installing Headscale on Windows 11
Headscale is a self-hosted WireGuard-based mesh network that allows for secure access to internal resources without exposing them to the internet. In this tutorial, we'll go through the process of installing and setting up Headscale on a Windows 11 computer.
Prerequisites
Before we start, you will need to make sure you have the following prerequisites:
- A Windows 11 computer with administrative privileges
- Git command-line tools installed
- Go programming language installed
Installation
Open a Command Prompt window with administrative privileges.
Clone the Headscale repository from GitHub using the
git clonecommand:git clone https://github.com/juanfont/headscale.gitNavigate to the Headscale directory using the
cdcommand:cd headscaleRun the
go buildcommand to create theheadscale.exeexecutable:go build -o headscale.exe ./cmd/headscaleYou should now have the
headscale.exeexecutable in the same directory as theheadscalefolder.
Configuration
Create a new configuration file for Headscale by running the following command:
headscale.exe initThe
initcommand will create a file namedheadscale.yamlin the current directory. Open this file in a text editor and make the following changes:Set the value of the
hostMapkey to the IP address of your computer.Remove the
authKeykey from the file, as it will be generated automatically when you run theheadscale.exe servecommand.Set the
persistenceBackendkey tosqlite.Set the
adminDomainkey to a domain you own or to a subdomain of a domain you own.Set the
authProviderskey tolocal.
Save the changes to the
headscale.yamlfile.
Running Headscale
Run the
headscale.exe servecommand to start the Headscale server:headscale.exe serveThe first time you run the
servecommand, a new authentication key will be generated and displayed in the command prompt. Save this key somewhere safe as you'll need it to create new devices on the network.To create a new device on the Headscale network, run the
headscale.exe node createcommand and follow the prompts:headscale.exe node createOnce you've created a device, you can connect to the network by installing the WireGuard client and importing the configuration file generated by the
headscale.exe node createcommand.
Congratulations! You've successfully installed and configured Headscale on a Windows 11 computer.