Skip to content

Raspberry Pi Tailscale: SSH Access from Anywhere | ShillehTek

May 17, 2024

Video Tutorial (Optional)

Watch first if you want to follow the full setup of Tailscale and SSH access in real time.

Project Overview

SSH Into Raspberry Pi with Tailscale VPN: In this tutorial, you set up a Raspberry Pi with the Tailscale mesh VPN so you can SSH into it securely from anywhere as if you were on the same local network.

Tailscale simplifies creating a secure network between your devices. You will install Tailscale on the Raspberry Pi and on a Mac, authenticate both devices, then connect over SSH using the Pis Tailscale IP. (Windows steps are similar.)

If you want to support the channel: Youtube. Support link: https://www.buymeacoffee.com/mmshilleh. Hire on UpWork: https://www.upwork.com/freelancers/~017060e77e9d8a1157.

  • Time: 15 to 30 minutes
  • Skill level: Beginner
  • What you will build: Remote SSH access to a Raspberry Pi over Tailscale using a private mesh VPN IP

Parts List

From ShillehTek

  • None required for this software setup

External

  • Raspberry Pi running Raspberry Pi OS (or a compatible Debian-based OS)
  • Another computer to connect from (Mac or Windows)
  • Tailscale account and internet access
  • Tailscale (download and install on each device)

Note: The commands shown use apt (Debian/Raspberry Pi OS style). Adjust if you are on a different Linux distribution.

Step-by-Step Guide

Step 1 - Install and start Tailscale on the Raspberry Pi

Goal: Get Tailscale installed and connected on your Raspberry Pi.

What to do: First update the Pi so packages are current.

Code:

sudo apt update
sudo apt upgrade -y

What to do: Add the Tailscale repository to your Pi.

Code:

curl -fsSL https://pkgs.tailscale.com/stable/raspbian/buster.gpg | sudo apt-key add -
curl -fsSL https://pkgs.tailscale.com/stable/raspbian/buster.list | sudo tee /etc/apt/sources.list.d/tailscale.list

What to do: Update package lists and install Tailscale.

Code:

sudo apt update
sudo apt install tailscale

What to do: Start Tailscale.

Code:

sudo tailscale up

Expected result: You are prompted to authenticate the Raspberry Pi via a browser flow, and the Pi becomes an authorized device in your Tailscale network.

Step 2 - Install and authenticate Tailscale on your Mac

Goal: Add your Mac to the same Tailscale network so it can reach your Pi.

What to do: Download and install Tailscale, then sign in.

  • Download Tailscale: Visit the Tailscale website and download the Mac version.
  • Install Tailscale: Open the downloaded file and follow the installer prompts.
  • Authenticate: Open Tailscale and sign in with the same Tailscale account used on the Pi.

Expected result: Your Mac shows as connected in Tailscale, on the same tailnet as your Raspberry Pi.

Step 3 - SSH to the Raspberry Pi using its Tailscale IP

Goal: Connect to the Pi over SSH using the private Tailscale IP address.

What to do: On the Raspberry Pi, get its Tailscale IPv4 address.

Code:

tailscale ip -4

What to do: On your Mac, SSH to that address (replace <tailscale-ip> with the output from the previous command).

Code:

ssh pi@<tailscale-ip>

What to do: Example SSH command.

Code:

ssh pi@100.64.0.1

Expected result: You connect to your Raspberry Pi over SSH. If prompted the first time, type yes to add the host to known hosts.

Step 4 - Note for Windows users

Goal: Understand the equivalent workflow on Windows without changing the overall process.

What to do: Install Tailscale on Windows, sign in to the same Tailscale account, then SSH to the Raspberry Pis Tailscale IP using an SSH client such as PuTTY or Windows Terminal.

Expected result: Your Windows machine can SSH into the Raspberry Pi using the same Tailscale IP method.

Conclusion

You set up secure remote access to a Raspberry Pi using Tailscale, then connected via SSH using the Pis Tailscale IP address. This approach works from an external network and feels like you are on the same local LAN.

Want to stock up on parts for your next Raspberry Pi or IoT build? Shop at ShillehTek.com. If you want help customizing a remote access setup or building an end-to-end IoT project, check out our IoT consulting services.