Installing Tailscale to the Raspberry Pi
Tailscale is software that allows you to set up a zero-configuration VPN on your Raspberry Pi in minutes. Designed to remove the complexity of setting up your own VPN, Tailscale doesn’t even require you to open any ports in your firewall for it to operate.
Being built on top of Wireguard also has its benefits. Tailscale gives you a fast, secure, and private connection to your device.
Best of all, Tailscale comes with a great free tier for personal use. On this free tier, you can connect up to 20 different devices within the same VPN.
This software is an excellent solution for those running a headless Raspberry Pi and wanting to get easy remote access.
Preparing your Raspberry Pi for Tailscale
This section will get you to prepare your Raspberry Pi’s operating system so that we can install and run Tailscale.
1. Before we begin, let us update the package list and any out-of-date packages.
You can perform these updates by using the following two commands.
sudo apt update
sudo apt upgrade
2. Our next step is to install any packages we will need to complete the installation of Tailscale. Luckily there are only two that we have to worry about.
Use the following command to install both “lsb-release
” and “curl
“.
sudo apt install lsb-release curl
lsb-release
– This package allows us to easily grab information about the system such, as the OS release name.curl
– We will use curl to download the Tailscale GPG key to our Raspberry Pi.
3. Once the package is installed, we need to grab the GPG key for the Tailscale repository by using the command below.
The GPG key is what helps your Raspberry Pi identify the package it is downloading is authentic
curl -L https://pkgs.tailscale.com/stable/raspbian/$(lsb_release -cs).noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
Using “$(lsb_release -cs)
” within this command, we can insert the correct operating system code name.
4. Once the PG key has been saved to your system, we can finally add the Tailscale repository.
To insert the link to the Tailscale repository on your Raspberry Pi, you can use the following command.
echo "deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/raspbian $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/tailscale.list
The above command will create a new file within the “sources.list.d
” directory called “tailscale.list
“. Within this file is a link to the Tailscale repository that the package manager will read during an update.
5. For your system to be aware of the Tailscale repository, we will need to perform another package list update.
Update the package list by using the command below in the terminal.
sudo apt update
Read More: Installing Tailscale to the Raspberry Pi