Like your own private ngrok/Cloudflare Tunnel. Connect to services over Tailscale, isolated in a Docker container and network (without privileged access) for security/convenience.
Create a Tailscale tunnel container configured to connect to some service running on another machine on your Tailscale network. Attach it to a Docker network (or the host network), and TCP traffic to the local container's specified port will be tunneled securely to the remove service via Tailscale. Use it to run a reverse proxy on a VPS that connects to the Raspberry Pi on your LAN, access services on different hosts on a Tailscale network via Docker/Docker Compose, or whatever else.
Based on tailscale-docker.
Set the TAILSCALE_AUTH_KEY with your own ephemeral auth key: https://login.tailscale.com/admin/settings/keys
docker run -d
-e TUNNEL_NAME=tailscale-tunnel
-e TAILSCALE_AUTH_KEY=your_auth_key_here
-e LOCAL_PORT=8080
-e SERVICE_HOSTNAME=service.tailnet-name.ts.net
-e SERVICE_PORT=80
-p 8080:8080
--name tailscale-tunnel
tailscale-tunnelAccess the tunnel via tailscale-tunnel:8080.
- Update the values in
.env_templateand rename it to.env - Run
docker-compose up -d - Go to
<SERVER_IP>:81in your browser and log in to Nginx Proxy Manager
- See the docs for the default admin user credentials
- Create a new Proxy Host or Stream using
TUNNEL_NAMEas the hostname andLOCAL_PORTas the port
- Copy
.env_template, update the values, and rename it to.env - Copy
docker-compose.ymland remove everything except thetailscale-tunnelservice - Add a network block to the bottom of the file:
networks:
default:
external: true
name: <DOCKER_NETWORK_NAME>- Run
docker-compose up -d - Access the tunnel via
<TUNNEL_NAME>:<LOCAL_PORT>on any other containers connected to the<DOCKER_NETWORK_NAME>network
- Copy
.env_template, update the values, and rename it to.env(or combine it with an existing.envfile, if you're already using one) - Copy the
tailscale-tunnelservice into your existingdocker-compose.yml - Access the tunnel via
<TUNNEL_NAME>:<LOCAL_PORT>on any of the other containers in thedocker-compose.ymlfile
- All containers need to be on the same Docker network.