Jellyfin Forum
Problems running Jellyfin from a Docker Compose - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+---- Forum: Networking & Access (https://forum.jellyfin.org/f-networking-access)
+---- Thread: Problems running Jellyfin from a Docker Compose (/t-problems-running-jellyfin-from-a-docker-compose)



Problems running Jellyfin from a Docker Compose - browbeat7900 - 2024-08-22

Hello all,

I am very new to self-hosting with Jellyfin and was directed to use docker compose to run jellyfin on my machine running Ubuntu 24.04 LTS.

I set up a docker-compose.yaml file (shown below) using the jellyfin documentation and a few pointers from other users on reddit and other forums; such as adding ports (http) , changing network mode to bridge, etc.

Code:
services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    user: 1000:1000
    network_mode: 'bridge'
    volumes:
      - /home/browbeat/jellyfin/config:/config
      - /home/browbeat/jellyfin/cache:/cache
      - type: bind
        source: /home/browbeat/jellyfin/media
        target: /media
      - type: bind
        source: /home/browbeat/jellyfin/media2
        target: /media2
        read_only: true
    ports:
      - "8096:8096"
    restart: 'unless-stopped'

when starting the docker compose (after giving docker the proper permissions to run without sudo) I keep receiving the error
"Error response from daemon: driver failed programming external connectivity on endpoint jellyfin (ea2ae228cadcae6b155230ff723239f7032a1cf1968572b260ca24ce6fc77f46): failed to bind port 0.0.0.0:8096/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:8096: bind: address already in use"

I tried doing "docker compose down" and other commands found in threads to close all docker containers but the error still persisted.

when running in host rather than bridge, I am unable to access my media library despite supplying the docker compose my file paths and giving it user 1000 in the yaml file.

FWIW: I am trying to host this as a server to stream photos and videos over a local network.

I am a bit confused as to what exactly I am doing wrong here and am a bit lost in searching through documentation and forums as I am very new to all of this. Any help from the community is appreciated as I just don't really know where to go from here.


RE: Problems running Jellyfin from a Docker Compose - TheDreadPirate - 2024-08-23

Are you already running jellyfin directly on your OS? Or Emby?

What is the output of this command?

Code:
sudo ss -tulpn | grep 8096

Using sudo or running it as root is important so we can see what the process using port 8096.

Also, sorry I didn't respond yesterday. For some reason this post wasn't in my new post feed.


RE: Problems running Jellyfin from a Docker Compose - browbeat7900 - 2024-08-25

Output of the command given:
"tcp LISTEN 0 512 0.0.0.0:8096 0.0.0.0:* users:"(("jellyfin",pid=1841,fd=464))"

I shouldn't have Jellyfin running on my OS directly as I uninstalled it before reinstalling through docker. I am attempting to only run jellyfin through a docker compose right now.

Apologies for the delayed response. I wasn't sent an email for the reply despite setting up that feature.

Edit: please ignore quote between : and ( after users, this was to prevent an emoticon from appearing.


RE: Problems running Jellyfin from a Docker Compose - TheDreadPirate - 2024-08-25

So it looks like it is running directly on the OS? Since the process is running as the jellyfin user.


RE: Problems running Jellyfin from a Docker Compose - browbeat7900 - 2024-08-26

Is there a way to prevent it from running on the OS rather than in the container? I thought that by creating a docker compose and installing jellyfin through docker it would be running that way.

Apologies again for the late response this doesn't seem to be emailing me at all.


RE: Problems running Jellyfin from a Docker Compose - TheDreadPirate - 2024-08-26

You could uninstall it? Or just disable the service if you want to keep it around.

Code:
sudo systemctl stop jellyfin
sudo systemctl disable jellyfin

"disable" prevents it from auto starting on boot.


RE: Problems running Jellyfin from a Docker Compose - browbeat7900 - 2024-08-26

I attempted to uninstall using "sudo apt-get purge –auto-remove jellyfin" and "sudo apt-get remove –auto-remove jellyfin" but both created errors finding the "-auto-remove" package.

However, disabling jellyfin as suggested actually let it run! Thank you!

If I could ask one more thing, what is the best way to secure my server? I know that running in a compose is fairly secure but I am not exactly sure if I should allow external connections how I should configure the server. You don't have to answer here as I know this quite a bit (understatement) to ask here, but if you could point me to some good resources for securing things like this I would be immensely grateful. I have been lost in a sea of documentation and articles on how to secure things like this so I figured going to the jellyfin forum directly for resources would be the best course of action.

Thank you so much again for your help.


RE: Problems running Jellyfin from a Docker Compose - TheDreadPirate - 2024-08-26

When you remove "jellyfin" via apt, it will only remove the meta package. You have to use "jellyfin*" with the asterisk at the end so that it removes the meta package and all of the actual jellyfin packages (jellyfin-web, jellyfin-server, jellyfin-ffmpeg6).

For secure remote access your options are to use a VPN or setting up a reverse proxy and getting https certs. I recommend setting up a reverse proxy and getting certs.

1) Get a free DDNS domain from duckdns.
2) Open ports 80 and 443 on your router and forward to your server (required both for access to Jellyfin and for the certificate request process)
3) Setup a container for Nginx Proxy Manager with host networking
4) Setup the Jellyfin proxy config in Nginx Proxy Manager, enable https, provide your duckdns domain. Nginx Proxy Manager will automatically acquire and manage the renewal of the cert. Follow the link below for all the switches and advanced setup.
5) ????
6) Profit!

https://jellyfin.org/docs/general/networking/nginx/#nginx-proxy-manager


RE: Problems running Jellyfin from a Docker Compose - browbeat7900 - 2024-08-28

This is extremely helpful. Thank you so much!!