In this tutorial, we will be showing you how to install Tailscale on 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.
Equipment
Below is the list of equipment we used when installing and setting up Tailscale on the Raspberry Pi.
Recommended
- Raspberry Pi ( Amazon )
- Micro SD Card ( Amazon )
- Power Supply ( Amazon )
- Ethernet Cable ( Amazon ) or Wi-Fi ( Amazon )
Optional
- Raspberry Pi Case ( Amazon )
- HDMI Cable ( Amazon )
- Monitor ( Amazon )
- USB Keyboard ( Amazon )
- USB Mouse ( Amazon )
This tutorial was tested on a Raspberry Pi 400 using the latest version of Raspberry Pi OS Bullseye.
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
Installing and Running Tailscale on the Raspberry Pi
Now that we have added the Tailscale repository to our Raspberry Pi, we can proceed to install the software.
1. At this point, all we need to do to install Tailscale is run the following command.
This command will install this software from the repository that we added in the previous section.
sudo apt install tailscale
2. To start up the Tailscale network on our Raspberry Pi, you will need to use the following command on your device.
This command will start the process of connecting to Tailscale and setting up your VPN. You will need to authenticate yourself with Tailscale by using one of three
sudo tailscale up
3. After running the above command, you will see a message like the one below.
To start the process of authenticating yourself with Tailscale, you will need to go to the URL in your favorite web browser.
To authenticate, visit:
https://login.tailscale.com/a/XXXXXXXXXXXX
4. At this point, you will need to log in to the Tailscale website to authenticate your device.
You will need to sign in with either a Google, Microsoft, or GitHub account. If you have never used Tailscale, an account will be created during sign-in.
5. After logging in, you will see the following message displayed within your web browser.
Additionally, within the console on your Raspberry Pi, you should now see the message below in the terminal. This indicates that your Pi is now connected to Tailscale.
Success.
6. If this is the first time you have used Tailscale, you will need to add it to another device to form a network.
In our case, we proceeded to install Tailscale on our Windows laptop so we could access our device remotely.
7. Once you have Tailscale installed on two devices, you should see the screen below in the web browser.
Tailscale provides you with a command (1.) that you can use to verify that Tailscale is working on your Raspberry Pi. This command will send a ping to the specified Tailscale IP address.
If everything works fine, you can click the “Success, it works!
” button (2.).
8. You will now get a list of guides that you can use to improve your configuration of Tailscale on the Raspberry Pi.
To proceed to the admin console, click the “Go to the admin console
” button.
9. The final screen you will be greeted with is the dashboard of Tailscale.
Using this screen, you can manage all of the machines that are a part of your Tailscale network. You can also manage things such as access controls and other settings.
Using Tailscale on your Raspberry Pi from the Terminal
This section will cover a couple of commands you can use within the terminal. These commands will get additional information about Tailscale running on the Raspberry Pi.
Retrieving the IP assigned to your Raspberry Pi by Tailscale
You can use the Tailscale command line tool to retrieve the IP address assigned to your Raspberry Pi.
While you can also get this IP from the Tailscale dashboard, it is sometimes faster to run the following command.
tailscale ip
After running this command, you should get a list of both IP addresses assigned to your device. One is an IPv4 address the other is IPv6.
100.XX.XXX.XXX
fd7a:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:8079
Getting the Status of Tailscale
By using the following command in the terminal, you can get the status of Tailscale on your Raspberry Pi.
This command will return the IP address of your Raspberry Pi and all other devices that are a member of the network.
tailscale status
Below is an example of the data returned using the above command.
100.XX.XXX.XXX raspberrypi pimylifeup@ linux -
100.XXX.XX.XX emmet-pc pimylifeup@ windows idle, tx 1044 rx 540
Disabling Tailscale on the Raspberry Pi
You can use the following command if you want to temporarily disable the Tailscale network on your Raspberry Pi without de-authorizing the device.
This is useful when you want to disconnect temporarily from your private Tailscale network.
tailscale down
Enabling Tailscale
You will want to use the following command to bring the Tailscale network back up on your Raspberry Pi. This is the same command that you used to set up Tailscale in the first place
tailscale up
If your Raspberry Pi has become de-authorized from the network, you will be prompted to log in again.
De-Authorizing your Raspberry Pi from Tailscale
If you no longer want to use Tailscale on your Raspberry Pi, you will want to disconnect it from the network first.
You can perform this action by using the following command within the terminal.
tailscale logout
This command will bring the Tailscale network down and then expire the node key so it can’t be reused.
Conclusion
Hopefully, by this point, you will now understand how to install and use Tailscale on the Raspberry Pi.
Tailscale is a neat networking software that allows you to set up a VPN between your devices with little to no configuration.
Please comment below if you have had any issues with getting Tailscale to work on your device.
We have numerous other Raspberry Pi projects that are well worth checking out, including our guide on running Heimdall.
Emmet,
Hoping this site is still active and YOU will respond.
Thanks for the clear instructions.
I currently have a RPI model 3B running at home that I installed PIhole and PIVPN with Wireguard. On my phone I have the wireguard client that I use to connect PRI so I can have Pihole block my ads. I switch on the VPN on the phone when I am out and about and need to browse or use a free hotspot at the library or coffee shop / Friends home where I do not get a Cellular signal. Given the upload speed on my home service is between 10-18 MBPS the connections is usually workable but noticeably slow. I also use Let’s Encrypt from the ASUS router to avoid the issues with the IP being changed although I do not see that happening often.
My Question: 1. If I want to use Tailscale I assume I will need to uninstall PIVPN?
2. Can I setup a tailscale machine to just use the pihole without access to the other machines on the Network. Something like a split tunnel client on the PiVPN?
Hi Tiwo,
1. You should be able to run Tailscale alongside PiVPN without any issues. Tailscale sets up its own virtual network and shouldnt be impacted by the VPN.
2. With Tailscale, only devices that are a member of that network will be able to talk with each other using the Tailscale address. (I hope this is what you mean). It is possible to lock down Tailscale further by setting up access control lists but it isn’t something I personally have tried.
Kind regards,
Emmet
I’m new to all this, so forgive me if I made an obvious mistake.
When I execute “sudo tailscale up” I get:
“failed to connect to local tailscaled; it doesn’t appear to be running (sudo systemctl start tailscaled ?)”
I was copying and pasting your commands. Any idea what went wrong?
Hi Scott,
Typically tailscale should start up immediately after being installed.
Can you try starting the service manually to see if that’s what is causing your issues.
You can manually start the tailscale service on your Raspberry Pi by using the following command.
If that runs without issue, you can run the “sudo tailscale up” command again.
Cheers,
Emmet
Hi Emmet.
I have a remote RPI that would be useful for me to include in a VPN network. I’m already connecting to it using VNC so before installing Tailscale remotely (through VNC), I just wanted your view on whether there would be any conflicts with VNC in doing so, as I cannot easily gain physical access to that Pi (it runs a monitoring service about 100mi from where I live).
Thanks.
Hi Steen,
Installing tailscale in theory should not affect any currently running services as it only routes traffic being sent through particular addresses.
However, I cannot guarantee this as it is not something I have had a chance to try this scenario for myself.
Cheers,
Emmet
Thanks Emmet, can you tell me how to completely uninstall Tailscale? I am going to install PiVPN using your instructions.
Thanks again you provide great instructions and help, keep it up.
Hi Bill,
You should be able to completely uninstall Tailscale from your system by using the following commands.
1. First purge the tailscale package. Purging will uninstall and remove any configuration files belonging to Tailscale.
2. Next, remove the sources and GPG key that we added to remove the Tailscale repository.
3. Finally run an update to make sure Tailscale is now cleared from your package list cache.
Cheers,
Emmet
Great instructions, installed without any problems.
I had setup my Pi using your instructions listed in “Build Your Own Raspberry Pi VPN Server” but was having port forwarding problems so I though this would solve that problem. When I was able to connect to the PiVPN device my laptop was able to browse the Pi’s network and connect to those network devices. When I connected using Tailscale I could not browse the Pi’s network. I was still on my laptops network and still had it’s ip address.
Can you tell me how I can correct this?
Thanks again.
Hi Bill,
Sadly, Tailscale doesn’t quite work the way you want it to. Every device you want to connect to needs to have Tailscale installed as they need to be within the same virtual private network.
So, while you can connect to your Raspberry Pi and the services running on it, you will need to install Tailscale again if you want to connect to your NAS for example.
Cheers,
Emmet
Cheers,
Emmet