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
Open Command Prompt.
Execute the following command to download the latest Jellyfin image:
docker pull jellyfin/jellyfin
Step 2: Create Configuration and Cache Directories
Navigate to your user directory:
Create the necessary directories:
Step 3: Note Directory Paths
Record the full paths of the directories created in Step 2. For example:
Also, note the path to your media library. For instance:
Step 4: Create a docker-compose.yml
File
Determine your Docker Compose version by running:
- Use the version number in the
version
field of yourdocker-compose.yml
file.
- Use the version number in the
In the
docker\jellyfin
directory, create a file nameddocker-compose.yml
with the following content:- Replace
YourUsername
with your actual Windows username.
- Replace
Step 5: Launch the Jellyfin Container
In Command Prompt, navigate to the
docker\jellyfin
directory:Start the container using Docker Compose:
- The
-d
flag runs the container in detached mode, allowing you to close the Command Prompt without stopping the container.
- The
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:
Or, explicitly:
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
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.
- Locate your external drive on Windows. For example, if the external drive is mounted as
Update the
volumes
Section:- Add an entry to map the external drive to a directory inside the container. For example:
- Add an entry to map the external drive to a directory inside the container. For example:
Complete Example
docker-compose.yml
: Here’s what yourdocker-compose.yml
file might look like:
Notes:
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).
- If you want the container to write to the external drive, change
Handling Spaces in Paths:
- If the external drive path contains spaces (e.g.,
E:\My Drive
), wrap the path in quotes:
- If the external drive path contains spaces (e.g.,
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.
- Make sure the external drive is consistently mounted as the same drive letter (
Multiple External Drives:
- You can map additional drives by adding more entries under
volumes
. For example:
- You can map additional drives by adding more entries under
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
Post a Comment
Thank you for visiting Almost a Technocrat. Due to many spam comments, your comment will be moderated.