Using the Tailscale Docker Mod for LinuxServer.io containers¶
-
Edit the Docker container that you wish to connect to Tailscale.
-
Add a variable:
- Name: DOCKER_MODS
- Key: DOCKER_MODS
- Value:
ghcr.io/tailscale-dev/docker-mod:main
-
Add a variable:
- Name: TAILSCALE_STATE_DIR
- Key: TAILSCALE_STATE_DIR
- Value:
/var/lib/tailscale
-
Add a path:
- Name: TS_STATE_PATH
- Container Path:
/var/lib/tailscale
- Host Path: A unique name to create a Docker volume for the Tailscale state.
Note
You can also use a filesystem path to create a bind mount instead of a Docker volume.
-
Apply the changes to the container.
Warning
If the Tailscale state variable or path are not configured, Tailscale will be logged out any time the container restarts.
Tip
If you would like to have Tailscale automatically log in instead of using the logs to get a login link, you can create an auth key from the Tailscale admin console and add another variable named
TAILSCALE_AUTHKEY
containing the key. -
Open the logs for the container. Locate the line that says AuthURL is. Click the link to log in to Tailscale.
Tip
The docker mod can be customized further using variables (e.g., to enable Tailscale serve). Refer to the mod documentation for the complete list of variables.