jaipreetsoni.com

How to Install Tailscale in TrueNAS Using Dockge

#OpenSource #TrueNAS #TailScale

by Jaipreet Soni

Table of Contents
What Are We Building?

Tailscale is one of the easiest ways to set up a secure VPN mesh network across all your devices. If you’re running TrueNAS SCALE and prefer containerized deployments, you can run Tailscale inside Docker using Dockge (a self-hosted Docker Compose stack manager).

This guide will show you step by step how to deploy Tailscale on TrueNAS with Dockge.Thankfully, with open-source technologies, you can build your own private cloud productivity suite on a VPS — with full control, better privacy, and no recurring subscription fees.

We’re creating a self-hosted alternative to cloud services like Google Workspace and Microsoft 365. You’ll be able to:

  • Sync files across devices

  • Edit documents online (Word, Excel, etc.)

  • Use calendar, tasks, mail client

  • Share and collaborate — securely & privately

We’ll use:

  • TrueNAS SCALE – Base OS with storage + apps (Docker & Kubernetes ready)

  • Docker(Dockge): Container engine to manage apps like Nextcloud

  • Nextcloud: The all-in-one collaboration suite

  • Cloudflare Tunnel: Free & secure access to your server over the internet

Prerequisites
  • A working TrueNAS SCALE installation

  • Dockge installed and running (used to manage docker-compose files)

  • Internet access on your NAS

Step 1: Create a Free Tailscale Account
  • Go to Tailscale.com

  • Click Sign Up and create a free account using Google, Microsoft, GitHub, or any email.

  • Once logged in, open the Admin ConsoleSettings → Keys

  • Generate a new Auth Key (copy this, you’ll use it later).

Step 2: Create the Docker Compose File

In Dockge, add a new project (for example, call it tailscale) and paste the following docker-compose.yml:

💻
docker-compose.yml
services:
  tailscale:
    image: tailscale/tailscale
    restart: unless-stopped
    volumes:
      - /mnt/tank/configs/tailscale:/var/lib
      - /dev/net/tun:/dev/net/tun
    environment:
      - TS_AUTHKEY=     # Add your Tailscale Auth Key
      - TS_ROUTES=      # Add your LAN subnet /24
      - TS_STATE_DIR=/var/lib/tailscale
      - TS_EXTRA_ARGS=--advertise-exit-node
      - TS_USERSPACE=false
    network_mode: host
    cap_add:
      - NET_ADMIN
      - NET_RAW
Explanation of Variables:
  • TS_AUTHKEY → Your Tailscale authentication key (from Step 1)

  • TS_ROUTES → The local subnet you want to route through Tailscale (example: 192.168.1.0/24)

  • TS_EXTRA_ARGS → Adds options like --advertise-exit-node so your TrueNAS can serve as an exit node

Step 3: Deploy the Container

Save the compose file in Dockge and deploy it. Dockge will pull the Tailscale image and start the container.

You can check the logs in Dockge to confirm Tailscale is connected.

Step 4: Verify the Connection
  • Open the Tailscale Admin Console

  • You should see your TrueNAS device listed as online

  • If you added --advertise-exit-node, you’ll have the option to use your NAS as an exit node

Step 5: (Optional) Enable Subnet Routing

If you specified a subnet in TS_ROUTES (e.g., 192.168.1.0/24), approve the subnet router in the Admin Console → Machines tab.

Conclusion

That’s it  — you now have Tailscale running inside Docker on TrueNAS SCALE, managed by Dockge. With this setup, your NAS is securely accessible from anywhere, and you can even use it as a subnet router or exit node.

Add to Home Screen ×