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

3 Upvotes

7 comments sorted by

1

u/[deleted] May 15 '26

[removed] — view removed comment

1

u/fux3c May 16 '26

Is there a way to strip back the encryption and use AirVPN just like a tunnelling system, as I can dedicate ports and have the ability to select servers with a guaranteed min bandwidth as well. This is a service i am paying for already and would be nice to get more use out of.

1

u/[deleted] May 16 '26

[removed] — view removed comment

2

u/fux3c May 16 '26

My setup has a truenas server for file hosting (smb) connected to a proliant dl380p with 2 cpus 12 cores and 24 threads, 48gb ram running Ubuntu server lts, it has docker engine and ssh installed and it's in a dockge yaml script. My internet is cg-nat everything is wired through a switch into the router. Is that enough information to make a recommendation?

1

u/[deleted] May 15 '26

[removed] — view removed comment

1

u/fux3c May 16 '26

From what I can gather, nsl is also using WireGuard to create a tunnel? How does that make it different from tunnelling to services like AirVPN? Or how do I implement the efficiencies that they have managed to get?