Jellyfin Forum
Guide: Running Jellyfin in Synology's DSM 7 Using Docker Compose - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Guides, Walkthroughs & Tutorials (https://forum.jellyfin.org/f-guides-walkthroughs-tutorials)
+--- Thread: Guide: Running Jellyfin in Synology's DSM 7 Using Docker Compose (/t-guide-running-jellyfin-in-synology-s-dsm-7-using-docker-compose)



Guide: Running Jellyfin in Synology's DSM 7 Using Docker Compose - Efficient_Good_5784 - 2023-12-31

This will be a short guide for Synology NAS units running DSM 7 on how to run a Jellyfin container using the Container Manager program.

Synology's DSM update to v7 updated the Docker program to what it is now, the Container Manager. Here, you can upload/write YAML files to launch a container.
If you don't have Container Manager on your NAS, install it through the Package Center.

In the Container Manager, you can select from multiple views:
  • Overview: Self-explanatory
  • Project: Place to create projects using compose files
  • Container: List of all existing containers and their current status
  • Image: List of Docker images currently stored on your NAS
  • Registry: Place to find and download Docker images
  • Network: List of networks and their current status
  • Log: Self-explanatory

We'll be using the Project view to run Jellyfin with a compose YAML file.

Note: I'll go over how to set-up the compose YAML file at the end.

Now on to the guide:
  1. Open File Station.
  2. In the "docker" folder, create a folder named "jellyfin" (note: you can chose where to save this, you're not forced to store this in "docker").
  3. In the "jellyfin" folder, create two folders: "cache" & "config".
  4. Using a text editor, create a compose file on your computer (instructions at end of guide).
  5. Open Container Manager's Project view.
  6. Create a new project.
  7. Give the project a name.
  8. For the path, click on "Set Path" and select the "jellyfin" folder you created in step 2 (you'll get a "compose.yaml" file stored in this location when this project is created).
  9. For source, select the "Upload docker-compose.yaml" option, then click on browse to upload your compose file.
  10. You'll see a view of your compose file from which you can still edit it. Just click next a couple of times, then click on "done".
  11. If you unselected the last option in step 10 to not start the project immediately after creation, right-click on the project and then on build.
  12. A pop-up will appear. The Docker image specified in the compose file will start downloading if it's not present on your NAS.
  13. The pop-up will end with an exit code (0=no errors).
  14. You should now have a running Jellyfin instance that you can access by going to a browser and opening "<your-nas-IP>:<port-chosen>"

The following is how the compose YAML file should be written.
Just copy and paste this into a text editor, edit it, then make sure to save it with a .yaml file extension. As in, you can save this to a .txt file, then just rename the text file from .txt to .yaml.

Comments in a YAML file are preceded with "#". Deleting the # symbol will make the line apply when you run the compose file.
Notes:
  • PUID = Process User ID
  • PGID = Process Group ID
  • User ID and Group ID of 0 is root (omitting both PUID and PGID will also make the container run through root)
  • Following the previous steps, this compose file already links to the cache and config folders that we created.
  • If your Synology NAS has an iGPU, make sure to uncomment the device section to allow for HWA.
  • The TZ environment variable will determine if Jellyfin's tasks run correctly at your selected times.
  • For your media folders, replace "<path-to-folder>" with the folders leading to your media files.
  • I added some comments to the example compose file. You can remove them later if you want to clean this up for your personal use.
  • The code block in this forum makes the compose file have double-line spacing. You can delete these too if you want to make it more compact.
Code:
services:
  jellyfin:
    #for specific image-> image: jellyfin/jellyfin:10.8.13
    image: jellyfin/jellyfin:latest
    container_name: Jellyfin
    environment:
      #- PUID=0
      #- PGID=0
      - TZ=America/Los_Angeles
      #- JELLYFIN_PublishedServerUrl=192.168.1.#
      #note: change TZ to your timezone identifier: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
    volumes:
      - /volume1/docker/jellyfin/cache:/cache:rw
      - /volume1/docker/jellyfin/config:/config:rw
      #- /volume1/<path-to-folder>/shows:/shows:rw
      #- /volume1/<path-to-folder>/movies:/movies:ro
      #note: (:rw = read/write) & (:ro = read only)
    #devices:
      #- /dev/dri/renderD128:/dev/dri/renderD128
      #- /dev/dri/card0:/dev/dri/card0
      #note: uncomment these lines in devices to allow for HWA to work on Synology units with an iGPU
    ports:
      - 8096:8096/tcp
      #- <port-to-use>:8096/tcp
    network_mode: bridge
    #network_mode: host
    restart: unless-stopped
Note: You can also choose to copy this directly when creating a project by selecting the "Create docker-compose.yml" option for source.

Also check out the Official Jellyfin documentation about Docker Compose: https://jellyfin.org/docs/general/installation/container/#using-docker-compose

After all this, you should end up with a project in Container Manager's Project view and a running container.
You can now open the project to view its details.
Here, you can modify the YAML configuration it uses (the project needs to be stopped first to edit it).
You'll be able to add/remove media folders or even select a specific Jellyfin Docker image from here in the future.

Also as a final note, in the Project view:
  • Build: Create the container
  • Clean: Delete the present container

If somebody finds an error with this, let me know and I'll update this.
‐---------------------
Edit:

I forgot to mention this originally. For those unaware, I want to point out that we created an external location from the container where the config folder is stored and used.

Deleting containers will not delete any external volumes/folders you linked to it, just what's inside the container itself.

This means that if you delete the Jellyfin container, your config folder will be retained. As long as you keep this external config folder, you can reuse it for future Jellyfin updates to carry over your entire server settings, playlists, watched history, metadata, etc. The only thing that won't transfer over with just the config folder alone is metadata stored along with your media files.
‐---------------------
Edit 2: Added a link to the Jellyfin Docs about Docker Compose.
‐---------------------
Edit 3: Clarified the "JELLYFIN_PublishedServerUrl" option in the compose file example.
----------------------
Edit 4: Another thing I want to point. When you edit the compose file with new changes, the changes will not apply to the current container until it's destroyed and rebuilt. When you edit the compose file within Container Manager, it gives you the option of rebuilding the container straight away, or just to save the file. If you save the file only, make sure to rebuild it later for your changes to apply.


RE: Guide: Running Jellyfin in Synology's DSM 7 Using Docker Compose - denmalley - 2024-02-02

Thanks for this guide - one thing I don't see mentioned is whether we should change that ip address under the JELLYFIN_PublishedServerUrl variable to something specific to our setup or if we're supposed to use our main gateway IP like shown. I have been trying to tackle the issue of "slow HTTP response" littering my logs and have seen quite a few solutions out there indicating to change this variable but they all word it slightly differently and of course their own examples don't help me.

Some say "your container's local IP" so like the IP found when you open the container's detail view and look under "network" in the "general" tab?

Some say "the IP address of your server, without a port."

Some say "the name of the domain you're using."

The official compose doc's comments say "alternative address used for autodiscovery."

I am very confused about what to use, if anything here. And whether I should just wait for this thing to grind through my library before I make any judgements about speed. I started to get poke around when it was going on like 48 hours to process my music library, and every screen takes forever to load, but maybe that's normal behavior while doing an initial scan. Plex says I have around 5000 or so albums in total, does that seem like a reasonable timeframe to process that data?

Sorry if this is a hijack of this thread's intended purpose.


RE: Guide: Running Jellyfin in Synology's DSM 7 Using Docker Compose - Efficient_Good_5784 - 2024-02-02

Sorry, I now realize "192.168.1.1" is an optional gateway IP. I kind of forgot both "192.168.1.1" or "192.168.1.254" can be used as the gateway IP.

I didn't mean it like that. I'll edit that to be "192.168.1.#" just so that it makes sense with what it's supposed to be.
Just to note, this should be the same option as what is found in the Jellyfin dashboard under networking. Just scroll to the bottom and in the "Firewall and Proxy Settings" section, you will see the location of this option.

To be honest, my knowledge of this option is not great. I just included it because when I made my own compose file, I copied that over and never removed it just in case I ever needed it (just had it commented out so that it doesn't apply). It'll be better if you ask around and wait for someone with more knowledge about that option to explain it to you.

I did find this reddit post that will be useful here.

(2024-02-02, 01:42 AM)denmalley Wrote: I have been trying to tackle the issue of "slow HTTP response"
This is more of a useless log that the developers even put a "hush" option to make that log entry disappear from the logs.
If you go to your dashboard and into the log section, at the very top you will see the option box to enable or disable this log warning.
You can also keep it enabled and choose a larger timeframe before your server sends this warning out if you find 500ms to be too fast to be considered a "slow response".

It sounds like your issue of Jellyfin being slow (on your Synology NAS I presume) is due to the scan. I would wait for the scan to complete. Unless you mess with your Synology NAS to install apps on an SSD, everything is running on the HDDs. With all the activity that a new library scan does, it would make sense that Jellyfin will be slow to load things to a client.

Now if you're wondering if your scan will never finish, you can then look at the logs to see if your Jellyfin server ran into some issue.
If you don't know how to read the logs, just make a thread here and paste them so others that do know what to look for can read it.
Just make sure to remove external IP addresses and other personal names and media path names.


RE: Guide: Running Jellyfin in Synology's DSM 7 Using Docker Compose - bitmap - 2024-02-02

As a first-run -- for ANY install -- I would recommend looking at the scheduled tasks and setting them for low-traffic times. As @Efficient_Good_5784 pointed out, you can get some pretty significant degradation (particularly for remote users, anybody who requires transcoding, etc...) during some of these scheduled tasks. The Library scan doesn't seem to cause a lot of problems, but refreshing People (i.e., actor info, images, etc...) has always caused a lot of network congestion for me. Instead of every X hours, set them for a specific time as the trigger and make sure it's when none of your users (or you) are likely to be on.

I'd advocate adding this to the official documentation as a post-install step, honestly. Even on well-equipped devices, these tasks can take a toll on performance.


RE: Guide: Running Jellyfin in Synology's DSM 7 Using Docker Compose - denmalley - 2024-02-03

Well after full scan of about 8TB of movies, tv shows, and music over the past few days, things are looking pretty good! Thanks @Efficient_Good_5784 for the advice on ignoring slow http. I am also looking at mounting an ssd for running containers as I've heard this can really hop up performance.

Thanks @bitmap for advice on scheduled tasks, I'll look into that