# How to Install and Configure Tailscale VPN on Raspberry Pi: A Step-by-Step Guide

**URL:** <https://forum.hhf.technology/t/how-to-install-and-configure-tailscale-vpn-on-raspberry-pi-a-step-by-step-guide/389>\
**Category:** Home Networking\
**Tags:** raspberry-pi, tailscale\
**Created:** [October 15, 2024, 6:30pm UTC](https://forum.hhf.technology/t/how-to-install-and-configure-tailscale-vpn-on-raspberry-pi-a-step-by-step-guide/389 "2024-10-15T18:30:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 15, 2024, 6:30pm UTC](https://forum.hhf.technology/t/how-to-install-and-configure-tailscale-vpn-on-raspberry-pi-a-step-by-step-guide/389/1 "2024-10-15T18:30:00Z")

</div>

This guide provides detailed instructions for setting up Tailscale VPN on your Raspberry Pi, enabling secure remote access and network connectivity.

## Table of Contents

- [Prerequisites](#prerequisites)
- [System Preparation](#system-preparation)
- [Installing Tailscale](#installing-tailscale)
- [Configuration and Authentication](#configuration-and-authentication)
- [Troubleshooting](#troubleshooting)
- [Security Considerations](#security-considerations)

## Prerequisites

- A Raspberry Pi (any model) running Raspberry Pi OS (formerly Raspbian)
- Internet connection
- SSH access or direct access to the Raspberry Pi terminal
- Sudo privileges on your Raspberry Pi
- A Tailscale account (free or paid)

## System Preparation

First, ensure your system is up to date:

```bash
sudo apt-get update && sudo apt-get -y upgrade

```

Install required dependencies:

```bash
sudo apt install lsb-release curl

```

## Installing Tailscale

1. Add the Tailscale GPG key to your system:

```bash
curl -L https://pkgs.tailscale.com/stable/raspbian/$(lsb_release -cs).noarmor.gpg | \
  sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null

```

1. Add the Tailscale repository to your package sources:

```bash
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

```

1. Update package list and install Tailscale:

```bash
sudo apt-get update
sudo apt -y install tailscale

```

1. Reboot your Raspberry Pi to ensure all changes take effect:

```bash
sudo reboot

```

## Configuration and Authentication

1. After reboot, start Tailscale:

```bash
sudo tailscale up

```

1. You’ll receive a URL similar to:

```auto
To authenticate, visit:

https://login.tailscale.com/a/xxxxxxxxxxxx

```

1. Open this URL in your web browser and log in to your Tailscale account
2. Approve the device connection in the Tailscale admin console

## Security Considerations

- By default, Tailscale operates in a secure mode where your Raspberry Pi can only communicate with other devices on your Tailscale network
- Consider enabling MFA on your Tailscale account for additional security
- Regularly update both Tailscale and your Raspberry Pi OS to receive security patches
- Review and adjust node permissions in the Tailscale admin console as needed

## Verifying Installation

Check Tailscale status:

```bash
sudo tailscale status

```

This will show all connected devices and their IP addresses within your Tailscale network.

## Troubleshooting

If you encounter issues:

1. Check system logs:

```bash
sudo journalctl -u tailscaled

```

1. Verify Tailscale service status:

```bash
sudo systemctl status tailscaled

```

1. Common solutions:
  - Ensure your Raspberry Pi has a stable internet connection
  - Verify that the tailscaled service is running
  - Check firewall settings if you have modified them
  - Confirm your Tailscale account is active and the device is authorized

## Additional Resources

- [Official Tailscale Documentation](https://tailscale.com/kb/)
- [Raspberry Pi Documentation](https://www.raspberrypi.org/documentation/)
- [Tailscale GitHub Repository](https://github.com/tailscale/tailscale)

* * *

Remember to replace `xxxxxxxxxxxx` in the authentication URL with the actual code provided during your setup process. This guide is compatible with all current Raspberry Pi models and recent versions of Raspberry Pi OS.

For automatic startup on boot:

```bash
sudo systemctl enable --now tailscaled

```

If you need the script.

```bash
#!/bin/sh

# Installing Tailscale to the Raspberry Pi
# https://pimylifeup.com/raspberry-pi-tailscale/

# update the package list and any out-of-date packages
sudo apt-get update && sudo apt-get -y upgrade

# install needed packages
sudo apt install lsb-release curl

# get the GPG key for the Tailscale repository
curl -L https://pkgs.tailscale.com/stable/raspbian/$(lsb_release -cs).noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null

# add the Tailscale repository
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

# update the package list
sudo apt-get update

# install Tailscale
sudo apt -y install tailscale

# restart device
sudo reboot

# start up the Tailscale network
sudo tailscale up

# copy "https://login.tailscale.com/a/XXXXXXXXXXXX" URL to your favorite browser and login to Tailscale

# admin@rpi777:~ $ sudo tailscale up
#
# To authenticate, visit:
#
# https://login.tailscale.com/a/c03e43d5bd19

```
