selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
TailGuard logo

Self-host TailGuard

v1.104.2

Container bridging WireGuard hosts into Tailscale

ReleaseOpen SourceMIT
Docker ComposeCompose file & guide
docker compose up
Updatedlast week
LanguageShell
Setup difficultyModerate
Stars
611
Port
41641 (UDP port used by Tailscale, exposed by Docker (-p 41641:41641/udp))
Docker
ghcr.io/juhovh/tailguard
TailGuard status Web UI page showing Tailscale and WireGuard tunnel state

What is TailGuard?

TailGuard is a Docker container that links an existing WireGuard setup to a Tailscale network, aimed at machines whose WireGuard installation is locked down or cannot run Tailscale software. It keeps a permanent Tailscale peer and a WireGuard client in one container, usually on a VPS near the WireGuard endpoint, and relies on plain IP forwarding rather than any protocol translation. You give it a downloaded WireGuard config as wg0.conf, then tune behaviour with environment variables: a destination address for tailnet traffic, extra advertised routes, exit-node selection in client mode, fallback DNS, host-exposure toggles and per-peer isolation on the WireGuard side. Subnets found in AllowedIPs get published to the tailnet automatically; traffic back the other way needs routes added on your WireGuard side. The container joins the tailnet through the login link it prints at startup or via an auth key, and an optional status page shows Tailscale and WireGuard tunnel state once you set a port for it. Run it with the published ghcr.io image through docker run, or build it locally with docker compose; a self-managed control server can be used instead of Tailscale's hosted one.

Should you self-host TailGuard?

TailGuard scores 48/100 on selfhost.directory (how scoring works) and ranks #37 of 56 in VPN. It has 611 GitHub stars.

It shipped 10 stable releases in the past year. The latest, v1.104.2, came out on 21 October 2026. New versions land roughly every 2 weeks.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Shell.

Its closest alternative on selfhost.directory is Tailscale (84/100, 38 215 stars). It scores higher overall, so compare the two before you pick. See TailGuard vs Tailscale side by side.

Features

  • Auth key / interactive tailnet login
  • Custom control server
  • Destination IP forwarding
  • Exit node support
  • IPv6 Support
  • Monitoring web UI
  • Subnet route advertisement
  • WireGuard peer isolation
  • WireGuard to Tailscale bridge

TailGuard README

How to install TailGuard

Install TailGuard with Docker

The simplest way to start TailGuard is to simply download a WireGuard config and save it as wg0.conf. After that you can create an IPv6 network (optional, but recommended) and start the container:

docker network create --ipv6 ip6net
docker run -it \
  -v ./wg0.conf:/etc/wireguard/wg0.conf -v ./state:/tailguard/state \
  --cap-add NET_ADMIN --device /dev/net/tun \
  --sysctl net.ipv4.ip_forward=1 --sysctl net.ipv6.conf.all.forwarding=1 \
  --sysctl net.ipv4.conf.all.src_valid_mark=1 \
  --network ip6net -p 41641:41641/udp \
  --name tailguard ghcr.io/juhovh/tailguard:latest

Requires NET_ADMIN capability, /dev/net/tun and IP forwarding sysctls.

How to configure TailGuard

  • TG_CLIENT_MODESet to 1 to behave as a Tailscale client, allows setting an exit node

    Set to 1 to behave as a Tailscale client, allows setting an exit node

    values: 1 / unset

  • TG_EXPOSE_HOSTSet to 1 if you want to allow connections from TS and WG peers

    Set to 1 if you want to allow connections from TS and WG peers

    values: 1 / unset

  • TG_NAMESERVERS1.1.1.1Fallback nameservers for resolving hostnames

    Fallback nameservers for resolving hostnames

  • TG_WEBUI_PORTSet to TCP port to serve status UI on, will be opened on firewall automatically

    Set to TCP port to serve status UI on, will be opened on firewall automatically

  • TS_AUTHKEYTailscale auth key for authentication if used

    Tailscale auth key for authentication if used

  • TS_DEST_IPDestination IP to route Tailscale traffic to, IPv4 and/or IPv6

    Destination IP to route Tailscale traffic to, IPv4 and/or IPv6

  • TS_DEVICEtailscale0Tailscale device name, must be a valid device name

    Tailscale device name, must be a valid device name

  • TS_EXIT_NODESet Tailscale exit node, only works with client mode enabled

    Set Tailscale exit node, only works with client mode enabled

  • TS_HOSTNAMETailscale hostname for this device if used

    Tailscale hostname for this device if used

  • TS_LOGIN_SERVERURL of the control server if not using Tailscale default

    URL of the control server if not using Tailscale default

  • TS_PORT41641Tailscale port number, should be exposed by Docker

    Tailscale port number, should be exposed by Docker

  • TS_ROUTESSet routes to advertise, overrides autodetected routes if needed

    Set routes to advertise, overrides autodetected routes if needed

  • WG_DEVICEwg0WireGuard device name, must be valid and match config file name

    WireGuard device name, must be valid and match config file name

  • WG_ISOLATE_PEERSSet to 1 to isolate WireGuard peers from each other

    Set to 1 to isolate WireGuard peers from each other

    values: 1 / unset

TailGuard releases & version history

More in Network Management

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…