I have the following setup a macbook running colima started as follows:
colima start --mount /Volumes/MAIN/mediaserver:/mnt/external:w --network-address
and the following docker compose file:
services:
vpn:
image: qmcgaw/gluetun:latest
container_name: vpn
restart: unless-stopped
cap_add:
- NET_ADMIN
environment:
- FIREWALL=on # kill switch should be on by default
- DOT=on # Enables DNS-over-TLS for extra privacy
- VPN_SERVICE_PROVIDER=${VPN_PROVIDER}
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
- WIREGUARD_ADDRESSES=${WIREGUARD_IPS}
- SERVER_CITIES=${WIREGUARD_CITIES}
- TZ=${TZ}
- VPN_LOCAL_NETWORK=192.168.1.0/24 # Allows incoming LAN connections to VPN containers
- EXTRA_SUBNETS=192.168.1.0/24
devices:
- /dev/net/tun:/dev/net/tun
ports:
- "32400:32400/udp"
- "32410:32410/udp" # Discovery
- "32412:32412/udp"
- "32413:32413/udp"
- "32414:32414/udp"
- "5353:5353/udp"
- "1900:1900/udp"
- "32469:32469"
sysctls:
- net.ipv6.conf.all.disable_ipv6=1
volumes:
- ${CONFIG_BASE_PATH}/gluetun:/config
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
restart: unless-stopped
network_mode: "service:vpn"
depends_on:
- vpn
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
- VERSION=docker
volumes:
- ${CONFIG_BASE_PATH}/plex:/config
- ${MEDIA_SERVER_BASE_PATH}/media/movies:/mediaserver/media/movies
- ${MEDIA_SERVER_BASE_PATH}/media/tv:/mediaserver/media/tv
running this docker compose allows me to access plex web-ui from macbook via
http://127.0.0.1:32400/web and on other machines on the same network via http://macbook-host-name:32400/web. but my TV also on the same network is not able to discover my plex media library.
I made sure in the plex server setting that “Enable local network discovery (GDM)” is turned on.
If I change to network_mode: "host"
I am unable to even reach the web ui of plex from any device, not even with 127.0.0.1:32400/web from the machine running colima. What am doing wrong and how can fix/debug the problem?
What actually worked is entering 192.168.178.158:32400/ in the plex server gui under Settings > Network
make sure Custom server access URLs
directly. This allowed plex on my tv to discover my plex media library.
how can I add this IP to my docker compose so it makes into the the plex server settings automatically? and how could I use fqdn instead of the ip? local fqdn of the macbook entered into gui settings of plex does not work.
how can I get the plex server to work with network_mode: "host"
circumventing my vpn container?
I had a previous setup where I had a debian machine running plex server directly on it and my TV was able to discover the plex media library just fine. (this machine was turned off during all my tests. so no interference from that side.)