How to install Jellyfin Media Server?
Jellyfin is a free and open source media system that lets you stream all your photos, music, videos and movies to any device from your own server. It is a fully free alternative to PLEX Media Server that doesn't require any account, subscription or connection to a cloud service and offers hardware transcoding out of the box. Jellyfin apps are available for almost all platforms.
Jellyfin and PLEX Media Server can be installed side by side, but you should decide for one of them since both will index your whole media library which costs disk space and CPU time twice.
Preparation
- Create a subdomain like
media.yourdomain.comand edit the DNS settings for this subdomain to point to your Nextcloud Domain. (instructions) - Mount all drives that contain your media below
/mnt(instructions)
Installation
- Run over CLI:
sudo bash /var/scripts/not-supported.sh - Choose
Jellyfin - Choose to install
Jellyfin - It now reports whether hardware transcoding is available on your server. It is not recommended to continue if it is not available.
- Type in the subdomain that you've created and that points to your Nextcloud domain like
media.yourdomain.comand confirm it - Don't use
UPNPto open the required ports (since you've already done this for your Nextcloud) - Confirm the notification about
fail2banthat will be set up for the Jellyfin login - Wait until everything is installed and it reports that Jellyfin was successfully installed. Please read the final notification carefully, since it also reminds you of the manual
Known proxiesstep that is needed to makefail2banwork (see below)
What to do now?
- Open
https://media.yourdomain.comand directly create your admin user, since Jellyfin is not protected before you did that! - Afterwards, make
fail2banwork by going toDashboard->Networking, entering127.0.0.1into theKnown proxiesfield and clicking onSave. This step is required because Jellyfin runs behind a reverse proxy and would otherwise log127.0.0.1for every failed login instead of the real ip address of the attacker, which would mean that nobody ever gets banned. Please note that the entry in theKnown proxiesfield only gets active after a restart of Jellyfin, sofail2banwill not be able to ban anyone before you did that. It is recommended to install the two-factor authentication plugin first and to do the restart only once after that. - Afterwards, create your libraries by choosing the corresponding folders below
/mnt - If hardware transcoding is available, you should enable it in
Dashboard->Playback->Transcodingby choosingIntel QuickSync (QSV)as hardware acceleration. See the Jellyfin documentation for further information.
Recommended: protect the Jellyfin login with two-factor authentication
Jellyfin has no built-in two-factor authentication, which means that a leaked or guessed password is enough to log into your server. The Jellyfin Security plugin adds 2FA (authenticator app, passkeys and recovery codes) on top of the Jellyfin login and is a good addition to the fail2ban protection that gets set up automatically.
- Open
https://media.yourdomain.comand go toDashboard->Plugins->Repositories - Click on
+and add the following repository URL:https://raw.githubusercontent.com/ZL154/JellyfinSecurity/main/manifest.json - Save it and switch to the
Catalogtab - Install the
Jellyfin Securityplugin from there - Restart Jellyfin once to activate the plugin by running over CLI:This restart also applies the
sudo docker restart jellyfinKnown proxiessetting from above, so you only need to do it once. - Afterwards go to
Dashboard->Plugins->Two-Factor Authenticationto open the settings of the plugin - Make sure that
Plugin Enabledis checked - Set the
2FA enforcement scopedropdown toAll users - everyone must enrollso that every user of your server needs to set up two-factor authentication - Don't forget to click on the big
Save Settingsbutton at the bottom of the settings page to apply your changes! - Now set up 2FA for your own account by opening
Profile->Two-Factor Authentication, scanning the QR code with an authenticator app of your choice and saving the recovery codes in your password manager
- The plugin is listed as
Jellyfin Securityin the catalog but appears asTwo-Factor Authenticationin the plugin settings afterwards. - Please save your recovery codes! If you lose both your authenticator app and your recovery codes, you will lock yourself out of your own server.
- All your media should be accessible from within Jellyfin in subdirectories of
/mnt - All your media is mounted read only so that Jellyfin is not able to write to or change anything on your drives
- Jellyfin runs in the host network so that DLNA and the automatic server discovery of the Jellyfin clients work. This means that Jellyfin is additionally reachable unencrypted inside your local network on
http://internal-server-ip-address:8096. It is recommended to always usehttps://media.yourdomain.cominstead. fail2bangets set up automatically and bans ip addresses that failed to log in 10 times within 30 minutes. You can unban an ip address by runningsudo fail2ban-client set jellyfin unbanip XX.XX.XX.XX. This requires theKnown proxiesstep from above and that the Jellyfin log level stays at its defaultInformationsince Jellyfin doesn't log failed logins on higher log levels. So please don't raise the log level in/home/plex/jellyfin/config/logging.jsonif you want to keepfail2banworking. Once you have at least one failed login attempt, you can test the jail by runningsudo fail2ban-regex /home/plex/jellyfin/config/log/log_*.log /etc/fail2ban/filter.d/jellyfin.local --print-all-matched. The ip addresses shown there must be real ip addresses and not127.0.0.1.- The Jellyfin user-data is stored in
/home/plex/jellyfinand is covered by the daily backup. It is kept if you uninstall or reinstall Jellyfin so that you don't lose your settings, users and metadata. You can delete it manually by runningsudo rm -r /home/plex/jellyfin. - You can digitize your Blu-rays, DVDs & CDs directly on your server (instructions)
- You should not store your digitized Blu-rays and DVDs on your with Veracrypt encrypted external data SSD/HDD but instead use an extra HDD to store those data! (Since it is overkill to backup this data; in exchange will this extra HDD not get encrypted which makes data recovery a lot easier)
You can find instructions how to do that here: click here. - Every other data than digitized Blu-rays and DVDs should be stored on the with Veracrypt encrypted external data SSD/HDD so that this data gets backed up.
- The whole extra HDD will not be visible and usable in Nextcloud/SMB