Deploy Jellyfin in Tailscale and Home Network

I have Jellyfin running on Docker and recently connected it to Tailscale so I could watch my Movies from anywhere. The Issue is that I also want to access Jellyfin from my Amazon FireTV which doesn’t come with a Tailscale App to connect it to its network. So I need to find a way to make Jellyfin available in my home network again while maintaining the Tailscale connection. Basically I’m looking for a way to have Jellyfin in Tailscale while also Exposed via port :8096 on my Ubuntu server.

I’m not sure whether that would be possible by changing the network_mode to service:tailscale and ‘host’ (although I’ve read that that’s not possible) or some other network configuration work around.

Here is the yaml file I deploy the stack with so you can see my current setup.

version: "3.9"

networks:
  frontend:
    external: true

services:    
  tailscale:
    image: tailscale/tailscale:latest
    container_name: tailscale
    hostname: jellyfin
    environment:
      - TS_AUTHKEY=xxxxxxxx
      - TS_SERVE_CONFIG=/config/jellyfin.json
      - TS_STATE_DIR=/var/lib/tailscale
    volumes:
      - /home/ubuntu/tailscale/config:/config
      - /home/ubuntu/tailscale:/var/lib/tailscale
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - net_admin
      - sys_module
    restart: unless-stopped
    networks:
      - frontend
  
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    user: 1000:1000
    network_mode: service:tailscale
    depends_on:
      - tailscale
    environment:
      TZ: "Europe/Berlin"
    volumes:
      - /home/ubuntu/jellyfin/config:/config:rw
      - /home/ubuntu/jellyfin/media:/mnt:rw
    restart: on-failure:3

Since you use the network of the tailscale container, you can only forward the jellyfin port from the host to the tailscale container. The jellyfin container itself does not have its own network so you can’t use the ports section in that service.

Ok, so would you say the setup I’m trying to achieve is not possible at all?
Or is it a discussion for the Tailscale community?

The solution is what I wrote:

services:    
  tailscale:
    ports:
      - 8096:8096

Assuming the frontend network is a Docker bridge network

But I never used tailscale so if that prevents port forwarding from working, I’m affraid I can’t help.

1 Like

Oh, my bad I missed that.

I just gave it a try and it works like a charm! Great and super simple solution! Thanks a lot!