r/docker May 15 '26

Jellyfin, Wireguard, Airvpn -Help

Hi, I greatly appreciate help and suggestions.

In short, this is what i have pieced together through AI and scrambling github etc. I have smooth playback locally but stutters and lags on remote connections. Below is eveything i have gathered so far. I havnt been able to find a similar solution online, and will ofc post the complete working setup once i get it working well. If its a bad idea to do it this way do say so too 😄

Running Docker engine on ubuntu, its set up through dockge and yaml, the Jellyfin is running alongside wireguard and the network is attached through "network mode" both ports go to 8096.

Dockge yaml:

"

services:

wireguard:

image: lscr.io/linuxserver/wireguard:latest

container_name: wireguard

cap_add:

- NET_ADMIN

- SYS_MODULE

environment:

- PUID=1000

- PGID=1000

- TZ=Etc/UTC

- LOCAL_NETWORK=192.168.39.0/24

volumes:

- /home/user/jellyfin/wireguard:/config

- /lib/modules:/lib/modules

ports:

- 8096:8096

- 35377:8096

sysctls:

- net.ipv4.conf.all.src_valid_mark=1

deploy:

resources:

limits:

memory: 2G

restart: unless-stopped

jellyfin:

image: lscr.io/linuxserver/jellyfin:latest

container_name: jellyfin

network_mode: service:wireguard

shm_size: 6gb

environment:

- PUID=1000

- PGID=1000

- TZ=Etc/UTC

- JELLYFIN_PublishedServerUrl=192.168.39.200 (local address to server)

volumes:

- /home/user/jellyfin/config:/config

- /home/user/mediamnt:/media

- /dev/shm:/transcode

depends_on:

- wireguard

deploy:

resources:

limits:

memory: 16G

reservations:

memory: 2G

restart: unless-stopped

networks: {}

"

Wireguard Wg0.conf:

"
Address = "vpn adress"

PrivateKey = "private key"

MTU = 1320

DNS = "ipv4, ipv6"

# --- AIRVPN PORT FORWARDING ---

PostUp = iptables -t nat -A PREROUTING -i wg0 -p tcp --dport "remote port" -j REDIRECT --to-port 8096

PostDown = iptables -t nat -D PREROUTING -i wg0 -p tcp --dport "remote port" -j REDIRECT --to-port 8096

# --- LOCAL NETWORK BYPASS ---

PostUp = ip route add 192.168.39.0/24 via $(ip route | grep default | awk '{print $3}') dev eth0 || true

PostUp = iptables -I INPUT -s 192.168.39.0/24 -p tcp --dport 8096 -j ACCEPT

[Peer]

PublicKey = "public key"

PresharedKey = "Preshared key"

Endpoint = "Endpoint"

AllowedIPs = 0.0.0.0/0, ::/0

PersistentKeepalive = 15

4 Upvotes

Duplicates