Set up a dogcam with Tailscale, Raspberry Pi, and Motion
Tailscale makes it easy to setup a dogcam that you can securely access from anywhere.
Unlike an off-the-shelf dogcam, with Tailscale you don’t need to trust a third-party service, or risk exposing a camera inside your home to the public internet. Every connection on Tailscale is encrypted and entirely private to your network.
Before you begin this guide, you’ll need two things:
- A Raspberry Pi with Wi-Fi/Ethernet capabilities (e.g. Raspberry Pi 3 B+)
- A USB webcam (e.g. Logitech C615)
This guide assumes your Raspberry Pi is already set up with an internet connection, whether Wi-Fi or Ethernet.
SSH into the Raspberry Pi, and install Tailscale with a single command:
curl -fsSL https://tailscale.com/install.sh | sh
Alternatively, we provide manual installation instructions for Raspberry Pi.
Once it is installed, and you’ve run
tailscale up on your Raspberry Pi, continue to the next step.
Next, install motion using apt with this command
sudo apt install motion
First, we’ll enable motion to run as a background service. Edit
nano or your favorite editor:
sudo nano /etc/default/motion
We’ll change the start_motion_daemon setting to “yes”:
Save and close the file.
Next, we’ll configure motion to expose a web page, and modify a few video capture settings too.
/etc/motion/motion.conf with your editor
sudo nano /etc/motion/motion.conf
Search for the following settings, updating their values to ones listed below.
Enable viewing video streams over the web. You can also change the port from the default value (8081) if you’d like.
stream_port 8081 stream_localhost off
Disable saving images or video to the SD card. Since this is a dogcam, we only care about looking at live footage.
output_pictures off ffmpeg_output_movies off
Save and close the file.
Once all your configuration settings have been updated, restart motion
sudo service motion restart
From any device in your Tailscale network, you can now view the live webcam
<raspberry pi tailscale ip>:8081. Find your Raspberry Pi’s IP
and type it into your browser.
You should see a feed from your webcam, that will look something like this.
Success! You now have a functioning dogcam, secured with Tailscale. This can only be accessed by devices on your personal Tailscale network, and no one else.
You may also want to experiment with other settings such as
framerate. If you make other changes, be sure to restart motion
sudo service motion restart afterwards.