Jellyfin on Debian/Ubuntu - AmiSaph Edition 2023/10/31 Ami Sapphire Last Updated: 2023/12/19 2023 [1103] fix wget command in Installing Jellyfin add Debian/Ubuntu Minimal Install Notes [1104] add Debian 11/12 nobody samba share quirk workaround add Debian 11/12 disable homes share behavior [1219] add OPNsense DNS Overrides setting for non .local setups Installing Jellyfin Using the DeBuntu script is recommended, as manual setup may be problematic in the long run (also updates for it can be properly installed): curl https://repo.jellyfin.org/install-debuntu.sh | sudo bash Though curl is not usually installed by default, so use wget instead: wget -O- https://repo.jellyfin.org/install-debuntu.sh | sudo bash Oh, sudo bash requires your password if sudo was not run before within 15 minutes. Install the Intel Drivers for Transcoding Normally you would install jellyfin-ffmpeg5 by itself, but the script used before already does this... so the next thing is to add jellyfin to the render group: sudo usermod -aG render jellyfin sudo systemctl restart jellyfin Check the version of intel-opencl-icd to see if it is newer than version 22: apt policy intel-opencl-icd If so, simply install it. sudo apt install -y intel-opencl-icd Otherwise, install it from Intel's repo. Repo: https://github.com/intel/compute-runtime/releases Check the QSV/VA-API codecs. Assume the render is renderD128: sudo /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128 Check the OpenCL runtime status. Assume the render is renderD128: sudo /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device opencl@va Go to the Jellyfin administration panel and setup QSV/VAAPI and check the supported codecs. Location is Server > Playback after entering the Administration's Dashboard. Setting Up a Local Reverse Proxy for Jellyfin This is to let web browsers have access to the server via URL without also specifying the port. Install Caddy sudo apt install caddy Edit the Caddyfile: sudo nano /etc/caddy/Caddyfile Comment out the configuration within the brackets and add these lines: # Reverse Proxy for Jellyfin reverse_proxy localhost:8096 Restart caddy sudo systemctl restart caddy Format and Mount a Storage Drive for Media Now you need a storage drive for any media you want to add to the server. Default directory for such external drives resides in /media for Debian/Ubuntu- based systems. This can be changed, however. For internal drives, however, you will require an entry for it in /etc/fstab. You will need to list the known drives so you will add it to /etc/fstab. Example drive is 4TB, so it will be added to the configuration file. The command: sudo fdisk -l If the drive is unformatted, format it to the desired filesystem first. Example filesystem is ext4. The command: sudo mkfs.ext4 /dev/*disk* where *disk* is the drive you want. Now the drive needs to be mounted. First, you need an absolute path to where the drive will be mounted. Create a directory first. Running the following: sudo mkdir /mnt/jellyfin-media will create a subdirectory named jellyfin-media in the already existing /mnt directory. Now, the drive needs to be added to /etc/fstab file. Running the following: sudo blkid will display the exact UUID needed for the /etc/fstab configuration file. Example UUID is bd94f362-20dd-40a3-84ae-becca294934c, which is tied to /dev/sdf. This will be added to /etc/fstab so it can stay permanently mounted for the next boot. Edit the /etc/fstab file: sudo nano /etc/fstab Example formats: UUID=bd94f362-20dd-40a3-84ae-becca294934c /mnt/jellyfin-media ext4 errors=remount-ro 0 1 /dev/disk-by/uuid/bd94f362-20dd-40a3-84ae-becca294934c /mnt/jellyfin-media ext4 errors=remount-ro 0 1 Save and reboot the system. After reboot, you must give permission of the newly created mount to the user jellyfin: sudo chown -R jellyfin:jellyfin /mnt/jellyfin-media Edit the Samba Configuration You will need to expose the Jellyfin media directory to the local network in order to easily add, edit, and remove media. If it is not installed, install it first: sudo apt install samba Run this command: sudo nano /etc/samba/smb.conf Add an entry at the end of the Share Definitions section of the configuration file. Example share configuration: [jellyfin] comment = Jellyfin path = /mnt/jellyfin-media browseable = yes read only = no guest ok = yes usershare allow guests = yes create mask = 755 force user = jellyfin force group = jellyfin If on Debian 12 that runs Samba 4.17 (or 11 that runs Samba 4.17 backports), add the following above the example share configuration, as it's a recent quirk: [ref: https://forums.debian.net/viewtopic.php?t=154522] [nobody] browseable = no ...or comment out the entire homes share configuration if you have no need to even use the home users setup at all: [homes], comment, browseable, read only, create mask, directory mask, valid users. The home share configuration is disabled in Ubuntu by default, so this is not an issue. Save and reboot the samba daemon: sudo systemctl restart smbd nmbd Debian/Ubuntu Minimal Install Notes You will have to install a few packages in order to use this server to these specs. Samba for actually adding files to the media server, and Avahi Daemon for having the server resolve to a .local domain. Install Samba sudo apt install samba Install Avahi Daemon sudo apt install avahi-daemon Local DNS Overrides This will be needed if some systems cannot use Bonjour .local domains by default (e.g. Windows XP - Vista - 7, some Linux minimal installations), especially if you do not want to utilize any Apple services. The example local .tld is .lan. OPNSense - Unbound Version Go to Services > Unbound DNS > Overrides From there, click the orange + button in the Overrides section. For Host, add the desired hostname, if needed. Example: media For Domain, add the desired domain name. Example: terabyte-media.lan For Type, select A (IPv4 Address). Do the same for AAAA (IPv6 address) if needed. Example (IPv4): 192.168.1.11 Example (IPv6): 2601:406:4c00:55c7:2d8:61ff:fe58:a40c (though, I'm seeing VERY quirky behavior with the IPv6 assignment...) Descriptions are perfectly optional, yet helpful. Click Save, then Apply.