How to Install Headscale on Linux Mint

Headscale is a self-hosted WireGuard network designed to provide a secure communication channel for various devices connected to the same network. In this tutorial, we will discuss how to install Headscale on Linux Mint.

Prerequisites

Before we proceed with the installation, we must ensure that we have the following:

Installation Steps

Follow the steps below to install Headscale on Linux Mint:

Step 1: Install WireGuard

We must install WireGuard first to use it with Headscale. We can do this by following the steps below:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC
sudo add-apt-repository ppa:wireguard/wireguard
sudo apt-get update
sudo apt-get install wireguard

Step 2: Install Headscale

Once we have WireGuard installed, we can proceed with the Headscale installation. To do it, follow the steps below:

wget https://github.com/juanfont/headscale/releases/latest/download/headscale-linux-amd64.tar.gz
tar -xf headscale-linux-amd64.tar.gz
sudo mv headscale /usr/local/bin
sudo vim /etc/headscale/config.hcl
automigrate = false # Set to true if the database does not exist yet

storage "file" {
  path = "/etc/headscale/database.db"
}

node {
  name = "$NODE_NAME_HERE"
  region = "$REGION_NAME_HERE"
  listen_port = 51820
  public_key = "$GENERATED_PUBLIC_KEY_HERE"
  private_key = "$GENERATED_PRIVATE_KEY_HERE"
}

control {
  listen_addr = "$CONTROL_IP_ADDRESS_HERE:PORT_4444"
}

migrations_path = "/usr/local/bin/headscale/migrations/"
$NODE_NAME_HERE # Replace with the name of your node.
$REGION_NAME_HERE # Replace with the name of your region.
$GENERATED_PUBLIC_KEY_HERE # Replace with the public key created above.
$GENERATED_PRIVATE_KEY_HERE # Replace with the private key created above.
$CONTROL_IP_ADDRESS_HERE # Replace with the IP address of the system.

Step 3: Start the Headscale Server

After the configuration file is set up, run the Headscale server by entering the following command:

sudo headscale serve -config /etc/headscale/config.hcl

Step 4: Set up Client Devices

Now that the Headscale server is running, we need to set up our client devices to use the network. The exact instructions will depend on the device and platform, but the general steps are:

Conclusion

Headscale can provide a secure communication channel for devices connected to the same network, and its installation is relatively simple. By following the steps in this tutorial, we can quickly set up Headscale on Linux Mint, install WireGuard, and configure set up client devices to connect to the network.

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!