Linux serverlinux web serverNETWORK ADMINISTRATIONS

A deep dive into using Tailscale with Docker

Everything you ever wanted to know about using Tailscale in a Docker container.

– GitHub resources: https://github.com/tailscale-dev/docker-guide-code-examples
– Tailscale.com blog post: https://tailscale.com/blog/docker-tailscale-guide
– Tailscale docs: https://tailscale.com/kb/1282/docker

===

00:00 – Start
00:36 – Why put Tailscale in a container?
01:48 – Auth Keys vs OAuth Clients
06:05 – Auth Keys
13:36 – OAuth Clients
18:00 – Container Namespacing
24:54 – Exposing an app via Serve and Funnel

source

by Tailscale

linux web server

28 thoughts on “A deep dive into using Tailscale with Docker

  • I don't think this would work on platforms that only support non-root or user-only docker containers. A lot of PaaS don't support compose or allow you to set the docker run args.

  • I have a unraid server and want to use tailscale on 2 diffrent accounts how to do this with a docker compose setup or on my unraid server.

    I tried what gpt4 suggested did not work I meant it kinda worked for every reboot of my unriad server it got ne a new machine name.

  • We started using tail scale after pfSense started to include the package (prior we used zerotier). It started as a low effort way to gain backup access to internal networks Incase if ipsec or open VPN failures, but it performed so well, and was so easy and fast to use even in mobile devices that it quickly became desirable as a primary VPN. Especially for some remote users that use starlink or TMO home internet.

    I am happy to see more advanced features merging in.

    This post particularly is useful for when I deploy a docker with an application, I think including this tail scale as part of that stack will let us have remote access to that stack saving complicated remote access issues.

    Also very happy this is still made as open source.

  • Hi! An amazing video, Just want to know how can I access my host like if tailscale was installed on it via this setup? Currently whenever I am moving b/w machine I have to do this manual setup. Rather I am looking that since my rest of the ecosystem is managed via docker compose I just spin this also up there and I can then normally SSH into my host machine

  • I met Alex at DevOps Days Chicago and he’s been blowing my mind since. Thanks Alex!

  • Amazing content! Thank you for the time and effort you and the rest of the Tailscale team put into this.

  • Great video Alex! I just switched over from Zerotier and it's so far been a pretty good experience. I clicked the link from Self Hosted, so hopefully that helps out there too.

  • I did ask this on the reddit thread but I'll ask it here too in case you don't see it. Are there any issues doing this with podman? Or is it only with Docker?

  • Make a video on adding devices to a subnet and connecting it to your tailscale network

  • Brilliant stuff. The command line is scary, and docker just seems a headache, but I'm sure I could learn it if I tried. With tailscale, I've set up an old laptop with an external HDD, then use it as a personal cloud storage when I'm away from the house and have access to several TB if I want my files anywhere. Then I've also set up jellyfin with tailscale for a media server for family on a refurbished office PC for £60 off ebay – so it's a family netflix. This is a very powerful tool, and the more you can simplify it and offer alternatives to the command line and messy config files (because this stuff is just not intuitive), the more value it has for me personally.

    In any case, thanks for simplifying this stuff. Much appreciated

  • Great Video – as always.
    I am currently struggeling with getting direct access to my tailscale clients – Singe NAT on one side (home router with a valid , public IP4 address.
    However all connections to this container are routet via DERP.
    This is anoying especially when doing high bandwith tasks.

    Can you maybe give a tutorial on how to get direct connections and how to optimize routing?

  • Would this have support for things like udp ports leading to game server containers?

  • Thx. It will be super helpful if you could do a similar topic on docker swarm as well

  • just getting started with Tailscale and Docker, thanks for the great intro! Long live self hosting! 🔥

  • I don’t understand the Compose yaml at @6:45. If you don’t define it, TS_USERSPACE will default to true, and not need the /dev/net/tun and net_admin/sys_module capabilities. So either remove those lines and run in userspace, or leave them in and also add TS_USERSPACE=false. The combination as shown seems self-contradictory.

  • Hello! Could you do a deep dive into how ACLs work for beginners please? I know there is a really in depth article y'all have but I do much better learning when I can see it be done. Thank you!

  • Thanks, Tailscale, for your outstanding efforts! Your dedication to providing high-quality content is truly appreciated. Keep up the great work!

  • I have been trying to do this for a month using macvlan with no luck thanks. Do you have to do this for every container?

  • Great tutorial! It would be nice, a tutorial with Tailscale running on a Proxmox

  • Running Tailscaled using Docker (compose) on a Ubuntu server. Have the –ssh setting. When attempting to SSH to this machine, SSH connects to the docker container itself and not the host machine. I'm guessing somebody has figured this out or maybe it's not possible.

  • Tailscale has genuinely changed the way my business works. Thanks so much for sharing so many useful ways to innovate and break the traditional and insecure ways of connecting things.

  • I can't tell you how much I've been waiting for this video! You mentioned it recently in one of the podcasts and as I'm still not quite getting to grips with Docker and Tailscale I've been eagerly awaiting it. 😅

  • I've been looking for a suitable self-hosting start point and this tutorial has answered a heap of "where do i begin?" questions. Thanks !

  • I love tailscale and love what it can do but im not smart enough to config this stuff lol

  • userspace tailscaled was a game changer for my workload. I don't need massive throughput but I don't want to run a privileged container if I can avoid it.

    The feature I'd like to see most is reserved IP keys: Almost like elastic IPs in AWS EC2, but for my tailnet. I generate an auth key for an ephemeral node that's always going to get a predetermined IP on my tailnet. I also want keys to last longer than 90 days, maybe with the prerequisite that the node be manually approved by an admin? This means I can use preauthorized keys to spin up infrastructure with deterministic IPs on my tailnet.

  • Tailscale is the best. How do you guys feel about headscale? I've considered trying it but I haven't taken the plunge yet.

Comments are closed.