3 ms·
Indeed: #/bin/bash docker run -d \ --volume /opt/jellyfin/config:/config \ --volume /opt/jellyfin/cache:/cache \ --net=host \ --restar
by brimble 5y ago
Indeed:
#/bin/bash
docker run -d \
--volume /opt/jellyfin/config:/config \
--volume /opt/jellyfin/cache:/cache \
--net=host \
--restart=unless-stopped \
jellyfin/jellyfin:10.7.7-amd64
That's "docker, run this and detach the console..."
"Also, mount these two directories in the image, to where Jellyfin expects to store its config, so that stuff persists across container restarts and upgrades..."
"... uh, I don't remember what --net=host does, I think maybe it directly exposes the container's ports on the host interface, because I was being lazy when I wrote this? Anyway, it works..."
".. restart this unless I explicitly stop it..."
"... and run this official Jellyfin image, at this particular version"
Then after the second "--volume" insert more lines for every folder you want to map in, like so:
--volume /mnt/storage/movies:/media/Movies \
--volume /mnt/storage/tv:/media/TV \
--volume /mnt/storage/kid-movies:/media/Kids \
--volume /mnt/storage/music:/media/Music \
Add as many as you like.
You'll see the directories on the right of the ":" show up in the Jellyfin UI, where you can add them as media sources and tell it what's in them, who has access (say, granting some users access only to that "Kids" library), et c.
Save as "jellyfin.sh" or whatever, and chmod +x. Run it. Done. To upgrade the version, change the last line to the new version, kill the container with a docker command, and run the script again. Do the same if you want to add more directories.
(might want to check the version, that may not be latest, it's just what mine is running right now)
You could also do it with docker-compose, I just tend not to do that unless I'm dealing with a container that depends on other containers.
Works ~anywhere that can run Docker containers. Doesn't matter which distro you're using. I'm pretty sure it even comes back up on system restart, and I didn't do any extra work to make that happen. Self-contained, simple, and clean.
[EDIT] To be clear, you also need to create those "/opt/jellyfin/config" and "cache" directories. The left side is what's on the host filesystem. But, you can put those anywhere, they don't have to go in "/opt".
Helpfully, the "--volume" list is also a complete list of everything (aside from the shell file itself) that you might want to back up. Which is one of the things I love about configuring services with Docker.
- throwanem 4y agoJust to pop in and note that this comment turned out an excellent starting point - it might've taken me four hours to figure out why systemd wouldn't mount my shares on boot, but after that getting Jellyfin itself going took about five minutes, and your comment is a big part of why. So thanks for that! Hit me up if you're ever in Baltimore, I'll buy you that beer I owe you :)