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.
Before we start, you will need to make sure you have the following prerequisites:
Open a Command Prompt window with administrative privileges.
Clone the Headscale repository from GitHub using the git clone
command:
git clone https://github.com/juanfont/headscale.git
Navigate to the Headscale directory using the cd
command:
cd headscale
Run the go build
command to create the headscale.exe
executable:
go build -o headscale.exe ./cmd/headscale
You should now have the headscale.exe
executable in the same directory as the headscale
folder.
Create a new configuration file for Headscale by running the following command:
headscale.exe init
The init
command will create a file named headscale.yaml
in the current directory. Open this file in a text editor and make the following changes:
Set the value of the hostMap
key to the IP address of your computer.
Remove the authKey
key from the file, as it will be generated automatically when you run the headscale.exe serve
command.
Set the persistenceBackend
key to sqlite
.
Set the adminDomain
key to a domain you own or to a subdomain of a domain you own.
Set the authProviders
key to local
.
Save the changes to the headscale.yaml
file.
Run the headscale.exe serve
command to start the Headscale server:
headscale.exe serve
The first time you run the serve
command, 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 create
command and follow the prompts:
headscale.exe node create
Once 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 create
command.
Congratulations! You've successfully installed and configured Headscale on a Windows 11 computer.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!