# Jellyfin # Installation #### 1\. Install Packages ```bash sudo apt install apt-transport-https gnupg lsb-release curl -fsSL https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/debian-jellyfin.gpg echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/debian $( lsb_release -c -s ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list ``` ```bash sudo apt update sudo apt install jellyfin ``` ```bash sudo systemctl enable --now jellyfin.service sudo systemctl restart jellyfin.service ``` 2\. Setup reverse proxy In your new Jellyfin installation, head over to the `Admin Dashboard` -> `Advanced` -> `Networking` and disable HTTPS (if enabled), then add your local host (`127.0.0.1`) to the known proxies, to allow NGINX to act as a reverse proxy. After that, restart your Jellyfin server. ```bash sudo systemctl restart jellyfin ``` Create a new VHOST in NGINX, `/etc/nginx/sites-enabled/streaming.example.org` and insert the following configuration (adapting the servername etc. of course): ```bash upstream jellyfin { server 127.0.0.1:8096; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name streaming.example.org; ssl_certificate /etc/ssl/...; ssl_certificate_key /etc/ssl/...; ssl_trusted_certificate /etc/ssl/...; location / { proxy_pass http://jellyfin; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Nginx-Proxy true; proxy_redirect off; } } server { listen 80; listen [::]:80; server_name streaming.example.org; return 301 https://$server_name$request_uri; } ``` You can now reach your Jellyfin instance over streaming.example.org. # Basic Configuration ##### 1. Creating a library Before you can start adding media to your server, you have to create a library. You can choose between different content types. Select the one appropriate for the content you want to add. I will start by creating a library for my movies, so I choose movies from the drop-down and continue. Most of the library settings are self-explanatory. Some options, however, are worth mentioning, so here is a small overview:
Option | Recommendation |
`Enable chapter image extraction` | Only enable this option, if you have a rather powerful CPU and on top of that, lots of free storage space. If you do have, this will give you preview images, when skipping through a video. |
`Extract chapter images during the library scan` | You can safely disable this option, because using plugins like Fanart will provide much better images, for all the different display sizes (Banner, Poster, etc.) |
Option | What it does |
`\[tmdbid=xyz\]` / `\[imdbid=xyz\]` | Specify which IMDB/TMDBID the movie has, so the according metadata gets fetched automatically. |
`.sample` `.trailer` `.theme` .`interview` `.featurette` | Let Jellyfin know, that the file is a sample/trailer/theme/interview/featurette file. |
`\[1080p\] \[720p\]` `\[480p\]` | Usually unnecessary, but in case, it's missing in the files metadata, let Jellyfin know, what resolution the video has. |
This section only covers setup for Nvidia GPUs
##### 1. Finding a suitable GPU The recommended way for hardware acceleration is to use a dedicated GPU. The usual manufacturers are AMD and Nvidia. However, experience has shown, that despite Nvidia's flawed Linux support regarding drivers, it is still the more performant and stable option, for transcoding media files (specifically HEVC). If you are wondering, which GPU is affordable and also supports all the common codecs, I can recommend you to take a look at the following matrix provided by Nvidia: [https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new](https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new). Make sure, that your GPU supports at least H.265 (4K YUV 4:2:0), since there are still a lot of clients, that don't support the rather new codec. Keep in mind, that using an old "Gaming" GPU might not be the best option for you, because they consume a lot of power and furthermore are locked to a maximum of 3 concurrent sessions. So if you have more than three people streaming video at any given time, you'll run into problems. This leaves Nvidia's Professional/Datacenter GPU's. My recommendation for a cheap, low power consuming and free of restrictions GPU is the [Nvidia Quadro P2000](https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/productspage/quadro/quadro-desktop/quadro-pascal-p2000-data-sheet-us-nvidia-704443-r2-web.pdf). With its 5GB of GDDR5 VRAM, it has enough power, to allow a whole family to stream HQ content. If you know, that you don't exceed the session limit, the cheaper [Nvidia Quadro P400](https://www.nvidia.com/content/dam/en-zz/Solutions/design-visualization/productspage/quadro/quadro-desktop/quadro-pascal-p400-data-sheet-us-nv-704503-r1.pdf) might be of interest to you. With that out of the way, you can continue to install the Nvidia drivers. ##### 2. Installing NVIDIA drivers Before installing the drivers, make sure, that you meet all requirements: - [x] Supported kernel version ([https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements)) - [x] CUDA capable GPU - [x] NVENC and NVDEC cabable GPU To start off, make sure, that your `/etc/apt/sources.list` file includes the `contrib` and `non-free` repositories. E.g. the following: ```ini deb http://deb.debian.org/debian/ bullseye main contrib non-free deb-src http://deb.debian.org/debian/ bullseye main contrib non-free deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free ``` Next, update all packages and install the `nvidia-driver` package. ```bash apt update apt -y install nvidia-driver firmware-misc-nonfree ``` Make sure, that the default nouveau drivers are blacklisted, by running `cat /etc/modprobe.d/nvidia-blacklists-nouveau.conf` ```ini # You need to run "update-initramfs -u" after editing this file. # see #580894 blacklist nouveau ``` If all is set, reboot your machine. You should be able, to verify the loaded drivers now, by running `lsmod | grep nvidia`: ```ini nvidia_uvm 1273856 0 nvidia_drm 73728 0 drm_kms_helper 278528 1 nvidia_drm nvidia_modeset 1146880 1 nvidia_drm nvidia 40828928 2 nvidia_uvm,nvidia_modeset drm 618496 4 drm_kms_helper,nvidia,nvidia_drm ``` Additionally, for monitoring purposes, you can install `nvidia-smi`. Simply run the following command: ```bash apt -y install nvidia-smi ``` This allows you, to see your GPU's current status: ```ini ~# nvidia-smi Mon Jul 11 13:33:22 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.48.07 Driver Version: 515.48.07 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 Quadro P400 Off | 00000000:03:00.0 Off | N/A | | 45% 49C P0 N/A / N/A | 0MiB / 2048MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+ ``` ##### 2.1 Installing CUDA ToolkitThis only works on systems with x86\\\_64 architecture
First, remove outdated signing keys, by running ```bash apt-key del 7fa2af80 ``` After that, setup the CUDA repository: ```bash wget https://developer.download.nvidia.com/compute/cuda/repos/If you want to edit the metadata of e.g., an MP4 file, you can use the version of `ffmpeg` Jellyfin installed in `/usr/lib/jellyfin-ffmpeg/ffmpeg`
# Design Tweaks ##### 1. Custom Theme/Skin You can either install the [SkinManager](https://github.com/danieladov/jellyfin-plugin-skin-manager) Plugin to try out a new look for Jellyfin, or directly edit CSS in the `Custom CSS` section under the `General` settings. I experienced the SkinManager as pretty unstable, so I chose to use the second option. ```CSS @import url("https://cdn.jsdelivr.net/gh/prayag17/JellySkin@latest/default.css"); @import url("https://cdn.jsdelivr.net/gh/prayag17/JellySkin/default.css"); @import url("https://cdn.jsdelivr.net/gh/prayag17/JellySkin@latest/addons/Logo.css"); @import url("https://cdn.jsdelivr.net/gh/prayag17/JellySkin/addons/Logo.css"); @import url("https://cdn.jsdelivr.net/gh/prayag17/JellySkin/addons/imp-per.css"); @import url("https://cdn.jsdelivr.net/gh/prayag17/JellySkin/addons/progress-bar.css"); .btnForgotPassword, .btnQuick { display: none !important; } ``` You can find the theme here: [https://github.com/prayag17/JellySkin](https://github.com/prayag17/JellySkin) ##### 2. Enable Backdrops for all users Sadly, you cannot enable backdrops for all users from the settings. However, you can do this, by editing the `bundle.js` file. To locate the file, run ```bash find / -name *.bundle.js | grep jellyfin => /usr/share/jellyfin/web/main.jellyfin.bundle.js ``` Next, edit the file (here `/usr/share/jellyfin/web/main.jellyfin.bundle.js`) and replace this line ```JavaScript enableBackdrops:function(){return P} ``` with the following one: ```javascript enableBackdrops:function(){return x} ``` After that, restart Jellyfin and clear it's cache.