Introduction: Build Your Own Streaming Service

Netflix, Disney+, HBO Max... There are so many streaming services these days. But content is scattered across different platforms, and playing your own movie or TV show files can be inconvenient. Building a media server on your home server solves all these problems.

With a media server, you can enjoy all your videos, music, and photos from anywhere - your Smart TV, smartphone, tablet, or computer. Even outside your home, as long as you have an internet connection, it works like your own personal Netflix. In this guide, we will cover everything from comparing media server software to installation, configuration, and external access setup.

1. What is a Media Server?

1.1 Understanding Media Servers

A media server is server software that stores media files such as videos, music, and photos, and allows you to stream and play them on various devices. Unlike simple file sharing, media servers provide the following features:

  • Automatic Metadata Collection: Automatically fetches movie titles, synopses, cast information, and poster images.
  • Library Organization: Automatically categorizes content by genre, year, director, and more for easy browsing.
  • Transcoding: Converts files in real-time when the playback device doesn't support the original format.
  • Watch Progress Sync: Stop watching on one device and continue from where you left off on another.
  • User Management: Create accounts for each family member with personalized recommendations and watch history.

1.2 Benefits of a Media Server

Running a media server offers several advantages:

  • Centralization: Manage all your scattered media files in one place.
  • Device Freedom: Access from Smart TVs, smartphones, tablets, PCs, and more.
  • Remote Access: Access your media library from outside your home.
  • Easy Sharing: Easily share media with family and friends.
  • Subscription Savings: Reduce dependency on streaming services by leveraging content you already own.

2. Media Server Software Comparison: Plex vs Jellyfin vs Emby

Let's compare the three most popular media server software options. Understand their characteristics and choose the one that best suits your needs.

2.1 Plex

Plex is the oldest and most recognized software in the media server space.

  • Pros: Polished UI, stable service, rich client apps, easy external access setup
  • Cons: Some core features require payment (Plex Pass), Plex account required, closed ecosystem
  • Pricing: Free basic tier, Plex Pass $4.99/month or $119.99 lifetime
  • Recommended For: Those who don't want to spend time on configuration, those who prioritize stability

2.2 Jellyfin

Jellyfin is a completely free and open-source media server. It started as an open-source fork of Emby.

  • Pros: 100% free, open-source, no forced account requirement, active community, plugin extensibility
  • Cons: UI is somewhat less polished than Plex, fewer official client apps, initial setup can be complex
  • Pricing: Completely free
  • Recommended For: Those who don't want to spend money, open-source enthusiasts, those who enjoy customization

2.3 Emby

Emby sits somewhere between Plex and Jellyfin in terms of features and philosophy.

  • Pros: Clean UI, stable service, DVR and live TV features
  • Cons: Most core features require payment (Emby Premiere), was open-source but became closed
  • Pricing: Free basic tier, Emby Premiere $4.99/month or $119 lifetime
  • Recommended For: Those who need DVR/Live TV features, those seeking a balance between Plex and Jellyfin

2.4 Comparison Table

Feature Plex Jellyfin Emby
Price Partially Paid Completely Free Partially Paid
Open Source No Yes No
Account Required Yes (Plex Account) No No
UI Quality Excellent Good Very Good
Client Apps Very Rich Moderate Rich
Hardware Acceleration Yes (Paid) Yes (Free) Yes (Paid)
Community Large Active Medium

This guide focuses on Jellyfin. It's completely free while offering features comparable to paid services, and even hardware-accelerated transcoding is available at no cost.

3. Installing Jellyfin

3.1 Installing Jellyfin with Docker (Recommended)

Using Docker makes installation and updates simple. Here's how to install using docker-compose.

First, create the Jellyfin directories:

mkdir -p /opt/jellyfin/{config,cache}
mkdir -p /media/{movies,tvshows,music}

Create the docker-compose.yml file:

version: "3.8"
services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    user: 1000:1000
    network_mode: host
    volumes:
      - /opt/jellyfin/config:/config
      - /opt/jellyfin/cache:/cache
      - /media:/media:ro
    restart: unless-stopped
    environment:
      - JELLYFIN_PublishedServerUrl=http://your-server-ip:8096

Start the container:

cd /opt/jellyfin
docker-compose up -d

3.2 Direct Installation (Ubuntu/Debian)

If you're not using Docker, you can install Jellyfin directly:

# Add Jellyfin repository
sudo apt install apt-transport-https gnupg
wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo apt-key add -
echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list

# Install
sudo apt update
sudo apt install jellyfin

# Start service
sudo systemctl start jellyfin
sudo systemctl enable jellyfin

3.3 Initial Setup Wizard

Once installation is complete, access http://ServerIP:8096 in your web browser. When the initial setup wizard appears, follow these steps:

  1. Language Selection: Choose your preferred language.
  2. Create Admin Account: Set up your username and password.
  3. Add Media Libraries: You can skip this and configure later.
  4. Metadata Language: Set to your preferred language.
  5. Remote Access: Configure whether to allow external access.

4. Setting Up Media Libraries

4.1 Organizing Your Folder Structure

Organizing your media files systematically helps Jellyfin fetch metadata accurately. Here's the recommended folder structure:

/media/
├── movies/
│   ├── Parasite (2019)/
│   │   └── Parasite (2019).mkv
│   ├── Inception (2010)/
│   │   └── Inception (2010).mkv
│   └── ...
├── tvshows/
│   ├── Breaking Bad (2008)/
│   │   ├── Season 01/
│   │   │   ├── Breaking Bad - S01E01 - Pilot.mkv
│   │   │   ├── Breaking Bad - S01E02 - Cat's in the Bag.mkv
│   │   │   └── ...
│   │   └── Season 02/
│   │       └── ...
│   └── ...
└── music/
    ├── Artist Name/
    │   ├── Album Name (Year)/
    │   │   ├── 01 - Track Name.flac
    │   │   └── ...
    │   └── ...
    └── ...

4.2 Adding Libraries

Add libraries from the Jellyfin admin page:

  1. Dashboard > Libraries > Add Library
  2. Select Content Type: Movies, TV Shows, or Music
  3. Add Folder: Enter the path where your media is stored
  4. Metadata Language: Select your preferred language
  5. Country: Select your country

4.3 Metadata Configuration

To fetch metadata properly, additional configuration may be needed:

  • Movies: Use TheMovieDB as the metadata source. It has excellent support for multiple languages.
  • TV Shows: Use TheMovieDB or TheTVDB.
  • Music: Use MusicBrainz.

Enable the "Download images" options in library settings to automatically download posters and background images.

5. Transcoding Configuration

5.1 What is Transcoding?

Transcoding is the process of converting files in real-time when the playback device doesn't support the original codec or resolution. For example, if you have a 4K video encoded in HEVC (H.265) and want to play it on an older Smart TV, the server needs to convert it to H.264 before sending it.

5.2 Hardware Acceleration Setup

Transcoding is CPU-intensive. Using hardware acceleration offloads this work to the GPU, significantly reducing CPU load.

Intel Quick Sync (Integrated Graphics)

If using an Intel CPU with integrated graphics, add the following device to your Docker container:

devices:
  - /dev/dri:/dev/dri

In Jellyfin settings, go to Dashboard > Playback > Transcoding and set "Hardware acceleration" to "VAAPI" or "QSV".

NVIDIA GPU

If using an NVIDIA GPU, install nvidia-docker and add the following to your docker-compose:

deploy:
  resources:
    reservations:
      devices:
        - driver: nvidia
          count: 1
          capabilities: [gpu]

Set hardware acceleration to "NVENC" in Jellyfin.

5.3 Transcoding Optimization Tips

  • Prioritize Direct Play: When possible, let the client play the original file directly. Direct play means zero server load.
  • Use Compatible Formats: Encoding your videos in H.264 + AAC enables Direct Play on most devices.
  • Bandwidth Settings: Set maximum streaming quality to "Original" in client apps to avoid unnecessary transcoding.

6. External Access Setup

6.1 Port Forwarding

To access Jellyfin from outside your home, you need to configure port forwarding on your router:

  1. Access your router's admin page (usually 192.168.0.1 or 192.168.1.1)
  2. Find the Port Forwarding or Virtual Server settings menu
  3. Configure external port 8096 to forward to your server's internal IP on port 8096

6.2 HTTPS Setup (Recommended)

For security during external access, setting up HTTPS is recommended. We recommend using Nginx reverse proxy with Let's Encrypt.

server {
    listen 443 ssl http2;
    server_name jellyfin.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/jellyfin.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/jellyfin.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:8096;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

6.3 DDNS Setup

If you don't have a static IP, DDNS is convenient. Free DDNS services include DuckDNS, No-IP, and Dynu.

7. Automatic Subtitle Downloads with Bazarr

7.1 Introduction to Bazarr

Bazarr is a program that automatically downloads subtitles for movies and TV shows. When integrated with Jellyfin, it automatically finds subtitles whenever new media is added.

7.2 Installing Bazarr

version: "3.8"
services:
  bazarr:
    image: lscr.io/linuxserver/bazarr:latest
    container_name: bazarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - /opt/bazarr/config:/config
      - /media/movies:/movies
      - /media/tvshows:/tv
    ports:
      - 6767:6767
    restart: unless-stopped

7.3 Configuring Bazarr

  1. Subtitle Providers: Go to Settings > Providers and add OpenSubtitles, Subscene, etc.
  2. Language Settings: Go to Settings > Languages and add your preferred languages.
  3. Media Server Integration: Go to Settings > Sonarr/Radarr for integration, or specify paths directly.

Once configured, Bazarr periodically searches for and downloads subtitles. Downloaded subtitles are saved in the same folder as the video files, allowing Jellyfin to automatically detect them.

8. Client App Setup

8.1 Smart TVs

Install the Jellyfin app from your TV manufacturer's app store:

  • Samsung TV (Tizen): Search for "Jellyfin" in Samsung Apps
  • LG TV (webOS): Install "Jellyfin" from LG Content Store
  • Android TV: Install "Jellyfin" from Google Play Store
  • Apple TV: Install "Jellyfin" from App Store
  • Fire TV: Install "Jellyfin" from Amazon Appstore

If there's no official app available, you can use the web client by accessing the Jellyfin server address in a web browser.

8.2 Mobile Apps

Jellyfin apps are available for smartphones and tablets:

  • Android: Install "Jellyfin" from Google Play
  • iOS: Install "Jellyfin Mobile" or third-party app "Swiftfin" from App Store

After installing the app, enter your server address and log in with your account. For external access, enter your DDNS address or public IP.

8.3 Desktop

  • Web Browser: Access via web browser on any OS
  • Jellyfin Media Player: Official desktop app (Windows, macOS, Linux)
  • Kodi Plugin: If you use Kodi, install the Jellyfin plugin

9. Troubleshooting

9.1 Common Issues and Solutions

Incorrect Metadata Matching

Ensure your filename follows the format "Movie Title (Year).extension". If it still doesn't work, select the media and use the "Identify" feature for manual matching.

Playback Stuttering or Buffering

This likely indicates transcoding is occurring. Set quality to "Original" in client settings, or verify that hardware acceleration is working properly on the server.

External Access Not Working

Verify your port forwarding settings and check if the firewall has the port open. Some ISPs block certain ports, so try using a different port (e.g., 443).

Conclusion

In this guide, we covered how to build a media server on your home server. Jellyfin is completely free yet offers features comparable to commercial services, making it highly recommended for anyone building their first media server.

A media server is often called the crown jewel of home servers. Once set up, the whole family can enjoy it, and you can access your own streaming service even outside your home. In the next part, we'll explore how to easily deploy and manage various services using Docker.