Google Ads

Step-by-Step Guide: Setting Up Jellyfin on Windows with Docker

This guide provides a step-by-step process for setting up a Jellyfin media server on a Windows machine using Docker. Jellyfin is a free and open-source alternative to popular media server solutions, enabling you to organize, stream, and access your media library from anywhere. By utilizing Docker, the setup ensures isolation, portability, and ease of management.


The tutorial covers everything from installing the necessary tools and configuring the environment to launching the Jellyfin container and mapping media directories. Key topics include:

  • Setting up directory structures for configuration and cache.
  • Writing a docker-compose.yml file for defining the Jellyfin container.
  • Configuring read-only or writable media volumes for enhanced security or flexibility.
  • Mapping external drives for additional media storage.

Whether you're a beginner to Docker or experienced in containerized deployments, this guide equips you with practical instructions to get Jellyfin up and running efficiently.

Prerequisites:

  • Docker Desktop: Ensure Docker Desktop is installed on your Windows machine. You can download it from the official Docker website.

Step 1: Pull the Jellyfin Docker Image

  1. Open Command Prompt.

  2. Execute the following command to download the latest Jellyfin image:

    docker pull jellyfin/jellyfin

Step 2: Create Configuration and Cache Directories

  1. Navigate to your user directory:

    cd %USERPROFILE%
  2. Create the necessary directories:

    mkdir -p docker\jellyfin\config
    mkdir docker\jellyfin\cache

Step 3: Note Directory Paths

  • Record the full paths of the directories created in Step 2. For example:

    C:\Users\YourUsername\docker\jellyfin\config
    C:\Users\YourUsername\docker\jellyfin\cache
  • Also, note the path to your media library. For instance:

    C:\Users\YourUsername\Videos\Movies

Step 4: Create a docker-compose.yml File

  1. Determine your Docker Compose version by running:

    docker-compose --version
    • Use the version number in the version field of your docker-compose.yml file.
  2. In the docker\jellyfin directory, create a file named docker-compose.yml with the following content:

    version: '2.12' # Replace with your Docker Compose version
    services: jellyfin: image: jellyfin/jellyfin:latest container_name: jellyfin user: 1000:1000 network_mode: 'bridge' ports: - 8096:8096 volumes: - C:\Users\YourUsername\docker\jellyfin\config:/config - C:\Users\YourUsername\docker\jellyfin\cache:/cache - C:\Users\YourUsername\Videos\Movies:/media:ro restart: 'unless-stopped'
    • Replace YourUsername with your actual Windows username.

Step 5: Launch the Jellyfin Container

  1. In Command Prompt, navigate to the docker\jellyfin directory:

    cd %USERPROFILE%\docker\jellyfin
  2. Start the container using Docker Compose:

    docker-compose up -d
    • The -d flag runs the container in detached mode, allowing you to close the Command Prompt without stopping the container.

Step 6: Access Jellyfin

  • Open a web browser and navigate to http://localhost:8096 to complete the Jellyfin setup.

(A) Read-only or Writable?

The :ro in the Docker Compose file means that the volume is mounted in read-only mode.

Breakdown:

  • C:\Users\YourUsername\Videos\Movies is the directory on your Windows host machine.
  • /media is the directory inside the Jellyfin container where the host directory will be mounted.
  • ro specifies that the container can only read from the mounted directory, preventing any changes to the files in the host directory.

This is useful when you want to ensure the container cannot modify or delete the media files in your library.

If you want the mounted volume to be writable by the container, you can simply omit :ro or explicitly use :rw.

Example:

C:\Users\YourUsername\Videos\Movies:/media

Or, explicitly:

C:\Users\YourUsername\Videos\Movies:/media:rw

Explanation:

  • By default, volumes are mounted with read-write (rw) permissions unless otherwise specified.
  • Adding :rw makes it explicit that the container can both read and write to the host directory.

This setup allows Jellyfin (or any container) to make changes, such as editing metadata or writing additional files to the directory. However, be cautious with writable mounts to avoid unintentional modifications.


(B) Mapping to an external drive

To map an external drive to the Jellyfin container, you need to specify the external drive's path in the volumes section of your docker-compose.yml file. Here’s how you can do it:


Steps to Modify the docker-compose.yml

  1. Determine the Path to the External Drive:

    • Locate your external drive on Windows. For example, if the external drive is mounted as E:\, note that path.
  2. Update the volumes Section:

    • Add an entry to map the external drive to a directory inside the container. For example:
      volumes:
      - E:\:/media/external
  3. Complete Example docker-compose.yml: Here’s what your docker-compose.yml file might look like:

    version: '2.12'
    services: jellyfin: image: jellyfin/jellyfin:latest container_name: jellyfin user: 1000:1000 network_mode: 'bridge' ports: - 8096:8096 volumes: - C:\Users\YourUsername\docker\jellyfin\config:/config - C:\Users\YourUsername\docker\jellyfin\cache:/cache - E:\:/media/external:ro # Map the external drive as read-only restart: 'unless-stopped'

Notes:

  1. Permissions:

    • If you want the container to write to the external drive, change :ro to :rw (or omit it, as read-write is the default).
      - E:\:/media/external:rw
  2. Handling Spaces in Paths:

    • If the external drive path contains spaces (e.g., E:\My Drive), wrap the path in quotes:
      - "E:\My Drive:/media/external:rw"
  3. Drive Letter:

    • Make sure the external drive is consistently mounted as the same drive letter (E:\ in this example). If the drive letter changes, the mapping will fail.
  4. Multiple External Drives:

    • You can map additional drives by adding more entries under volumes. For example:
      - F:\Movies:/media/movies:ro
      - G:\TV:/media/tv:rw

Access in Jellyfin:

  • After launching the container, the external drive will be accessible in Jellyfin's interface under the /media/external path. You can then configure Jellyfin to scan and index media files from this location.

Comments

Popular posts from this blog

A Better SKMEI 1418 / 1427 Instructions Manual

A Better SKMEI 1358 Instructions Manual

Jailbreak your Amazon Kindle Keyboard

How to export Tasker's Projects, Profiles, Tasks and Scenes

SKMEI 1358 Review

How to import Tasker projects, profiles, tasks and scenes