Setup Jellyfin media server in your homelab using docker

VijayVijay
2 min read

Table of contents

Jellyfin is a free and open-source media server that allows you to manage and stream all your media files from any device. It is an open-source alternative to the Plex media server. Let's see how can we setup this media server in docker.

Requirements

  • Linux system

  • Docker

  • Docker compose

  • A media folder

Setup

First of all, make sure the docker is installed and running in the background. If you are unsure about commands, you can use the following commands to check in Linux.

Command to check docker status:

sudo systemctl status docker

Command to start docker daemon:

sudo systemctl start docker

Once you are sure that docker is running, create a folder called jellyfin. You can feel free to name it whatever you want. For this tutorial, I am going to name it as jellyfin.

Now go inside that folder and follow these steps

  • Create a docker-compose file with the name docker-compose.yml

  • Create a config folder

  • Create a cache folder

Now edit that docker-compose.yml with your favorite text editor, I use Vim to edit files. Add the following content in the docker-compose file.

services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    user: 1000:1000
    network_mode: 'host'
    volumes:
      - /home/homelab/jellyfin/config:/config
      - /home/homelab/jellyfin/cache:/cache
      - /home/homelab/media:/media
    restart: 'unless-stopped'
    extra_hosts:
      - "host.docker.internal:host-gateway"

Here you need to provide the path to that cache and config directories we have created before and also your media directory. I have mine in the home folder.

Once you are done with this, you can run the following docker-compose command.

docker compose up

This will do the setup, open the following URL http://<your-homelab-host-ip>:8096 , you will be prompted with a jellyfin setup page. Fill the fields and create an account. You can now stream your media from any device with your homelab server.

0
Subscribe to my newsletter

Read articles from Vijay directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vijay
Vijay

I am a Linux enthusiast, developer and gamer.