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:

Installation

  1. Open a Command Prompt window with administrative privileges.

  2. Clone the Headscale repository from GitHub using the git clone command:

    git clone https://github.com/juanfont/headscale.git
    
  3. Navigate to the Headscale directory using the cd command:

    cd headscale
    
  4. Run the go build command to create the headscale.exe executable:

    go build -o headscale.exe ./cmd/headscale
    
  5. You should now have the headscale.exe executable in the same directory as the headscale folder.

Configuration

  1. Create a new configuration file for Headscale by running the following command:

    headscale.exe init
    
  2. 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.

  3. Save the changes to the headscale.yaml file.

Running Headscale

  1. Run the headscale.exe serve command to start the Headscale server:

    headscale.exe serve
    
  2. 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.

  3. To create a new device on the Headscale network, run the headscale.exe node create command and follow the prompts:

    headscale.exe node create
    
  4. 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!