Skip to content

Jellyfin

Get your FREE "elfhosted" Jellyfin instance for demo / trial 🥳

Want to see a live demo, or "kick the tyres" 🚙 before you commit to self-hosting Jellyfin?

Try out an "ElfHosted" 🧝 instance of Jellyfin for FREE!

Jellyfin is best described as "like Emby but really FOSS".

Jellyfin Screenshot

If it looks very similar as Emby, is because it started as a fork of it, but it has evolved since them. For a complete explanation of the why, look here.

Jellyfin Requirements

Ingredients

Already deployed:

Related:

Preparation

Setup data locations

We'll need a location to store Jellyfin's library data, config files, logs and temporary transcoding space, so create /var/data/jellyfin, and make sure it's owned by the user and group who also own your media data.

mkdir /var/data/jellyfin

Also if we want to avoid the cache to be part of the backup, we should create a location to map it on the runtime folder. It also has to be owned by the user and group who also own your media data.

mkdir /var/data/runtime/jellyfin

Prepare Jellyfin environment

Create jellyfin.env, and populate with PUID/GUID for the user who owns the /var/data/jellyfin directory (above) and your actual media content (in this example, the media content is at /srv/data)

PUID=
GUID=

Jellyfin Docker Swarm config

Create a docker swarm config file in docker-compose syntax (v3), something like the example below:

Fast-track with premix! 🚀

I automatically and instantly share (with my sponsors) a private "premix" git repository, which includes necessary docker-compose and env files for all published recipes. This means that sponsors can launch any recipe with just a git pull and a docker stack deploy 👍.

🚀 Update: Premix now includes an ansible playbook, so that sponsors can deploy an entire stack + recipes, with a single ansible command! (more here)

version: "3.0"

services:
  jellyfin:
    image: jellyfin/jellyfin
    env_file: /var/data/config/jellyfin/jellyfin.env
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/data/jellyfin:/config
      - /var/data/runtime/jellyfin:/cache
      - /srv/data/:/data
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=traefik_public"
        - "traefik.http.routers.jellyfin.rule=Host(`jellyfin.example.com`)"
        - "traefik.http.services.jellyfin.loadbalancer.server.port=8096"

    networks:
        - traefik_public
    ports:
      - 8096:8096

networks:
  traefik_public:
    external: true

Note

Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See my list here.

Serving

Launch Jellyfin stack

Launch the stack by running docker stack deploy jellyfin -c <path -to-docker-compose.yml>

Log into your new instance at https://YOUR-FQDN, and complete the wizard-based setup to complete deploying your Jellyfin.

Chef's notes 📓


  1. I didn't use an oauth2_proxy for this stack, because it would interfere with mobile client support. 

  2. Got an NVIDIA GPU? See this blog post re how to use your GPU to transcode your media! 

  3. We don't bother exposing the HTTPS port for Jellyfin, since Traefik is doing the SSL termination for us already. 

Tip your waiter (sponsor) 👏

Did you receive excellent service? Want to compliment the chef? (..and support development of current and future recipes!) Sponsor me on Github / Ko-Fi / Patreon, or see the contribute page for more (free or paid) ways to say thank you! 👏

Employ your chef (engage) 🤝

Is this too much of a geeky PITA? Do you just want results, stat? I do this for a living - I'm a full-time Kubernetes contractor, providing consulting and engineering expertise to businesses needing short-term, short-notice support in the cloud-native space, including AWS/Azure/GKE, Kubernetes, CI/CD and automation.

Learn more about working with me here.

Flirt with waiter (subscribe) 💌

Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated.

Your comments? 💬