Home > Software > How to Set Up Jellyfin Media Server with Docker Compose: A Comprehensive Guide

How to Set Up Jellyfin Media Server with Docker Compose: A Comprehensive Guide

Anastasios Antoniadis

Share on X (Twitter) Share on Facebook Share on Pinterest Share on LinkedInIn the era of digital streaming, setting up a personal media server has become a popular way to organize and access personal media collections from anywhere. Jellyfin, an open-source media solution, stands out by offering a free platform to manage and stream your …

Docker (1)

In the era of digital streaming, setting up a personal media server has become a popular way to organize and access personal media collections from anywhere. Jellyfin, an open-source media solution, stands out by offering a free platform to manage and stream your media with no strings attached. Deploying Jellyfin within a Docker environment using Docker Compose simplifies the installation and management process, making it accessible even for users with minimal Docker experience. This guide provides a step-by-step approach to deploying a Jellyfin media server using Docker Compose.

Understanding Jellyfin and Docker Compose

Jellyfin serves as a media system that lets users organize and stream their audio, video, and photos. Meanwhile, Docker Compose is a tool that helps define and run multi-container Docker applications. By using Docker Compose to deploy Jellyfin, you can benefit from Docker’s ecosystem, ensuring easy setup, scalability, and isolation from your host system.

Prerequisites

Before you start, ensure you have Docker and Docker Compose installed on your system. Familiarity with basic Docker concepts and command-line operations is also recommended.

Step 1: Create a Docker Compose File

Create a Project Directory: Make a directory for your Jellyfin project. This directory will house your docker-compose.yml file and can be used to store configuration files and persistent data.

mkdir jellyfin-docker && cd jellyfin-docker

Create the Docker Compose File: In the project directory, create a docker-compose.yml file.

touch docker-compose.yml

Edit the Docker Compose File: Open the docker-compose.yml file in your preferred text editor and input the following configuration:

version: '3.8'
services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    user: "1000:1000" # Optional: Change to your user/group ID
    volumes:
      - ./config:/config # Jellyfin configuration files
      - ./cache:/cache   # Temporary cache files
      - ./media:/media   # Media library location
    ports:
      - "8096:8096"      # HTTP port
      - "8920:8920"      # HTTPS port (optional)
    restart: unless-stopped
  1. This configuration defines a single service named jellyfin using the latest Jellyfin image. It maps volumes for configuration, cache, and media files to persist data and exposes ports 8096 for HTTP and 8920 for HTTPS access.

Step 2: Deploy Jellyfin with Docker Compose

With your docker-compose.yml configured, deploy Jellyfin by running the following command in the terminal within your project directory:

docker-compose up -d

This command starts Jellyfin in detached mode, downloading the necessary Docker image and creating the container as defined.

Step 3: Accessing Jellyfin

After deploying Jellyfin, access it by navigating to http://localhost:8096 or http://your-server-ip:8096 in a web browser. You’ll be greeted by the Jellyfin setup wizard, where you can configure your media library, create user accounts, and customize settings.

Best Practices for Using Jellyfin with Docker Compose

  • Data Persistence: The configuration maps volumes for Jellyfin’s configuration, cache, and media libraries to the host. Ensure these paths are backed up regularly.
  • Security: Consider using a reverse proxy for SSL termination if accessing Jellyfin over the internet. You can also enable HTTPS directly in Jellyfin by configuring the appropriate settings and mapping the SSL certificate and key to the container.
  • Updates: To update Jellyfin, simply pull the latest image and restart the container with Docker Compose:
docker-compose pull && docker-compose up -d

Conclusion

Deploying Jellyfin with Docker Compose offers a streamlined method to set up a personal media server, combining Jellyfin’s comprehensive media management features with Docker’s ease of deployment and isolation. By following this guide, you can have your Jellyfin server up and running in minutes, ready to organize and stream your media collection from anywhere. Whether you’re a seasoned Docker user or new to containerized applications, Docker Compose makes managing your Jellyfin instance straightforward and efficient.

Anastasios Antoniadis
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x