# Emby Media Server

> Media server to organize and stream your media collection.

- Category: Media & Entertainment
- Difficulty: intermediate
- Components: emby
- Tags: media-server, emby, streaming, movies, tv
- Source: https://docker.recipes/media/emby-server

## Overview

Emby Media Server is a powerful personal media server that organizes, manages, and streams your digital media collection across multiple devices and platforms. Originally forked from MediaBrowser in 2013, Emby has evolved into a comprehensive media solution that automatically fetches metadata, artwork, and subtitles for your movies, TV shows, music, and photos while providing transcoding capabilities to ensure content plays smoothly on any device. The server includes advanced features like user management, parental controls, live TV integration, and mobile sync for offline viewing.

This Docker deployment leverages the official Emby container with hardware acceleration support through device mapping to /dev/dri, enabling efficient GPU-based transcoding that significantly reduces CPU load during media streaming. The configuration includes proper user ID mapping to maintain file permissions, read-only media mounting to protect your original files, and network isolation for security. The setup exposes both HTTP (8096) and HTTPS (8920) ports, allowing for secure remote access to your media library.

This stack is ideal for home media enthusiasts, families wanting centralized entertainment management, and users seeking an alternative to subscription streaming services. Emby excels in mixed-device households where content needs to stream reliably to smart TVs, mobile devices, gaming consoles, and web browsers while maintaining high quality playback and providing detailed viewing analytics and user management features.

## Features

- Automatic media library organization with metadata fetching from TheMovieDB, TheTVDB, and MusicBrainz
- Hardware-accelerated transcoding using Intel Quick Sync, NVIDIA NVENC, or AMD VCE
- Multi-user support with individual libraries, viewing history, and parental controls
- Live TV and DVR functionality with HDHomeRun and other tuner integration
- Mobile device sync for offline viewing and automatic quality optimization
- Plugin ecosystem for enhanced functionality including trakt.tv integration and advanced notifications
- Web-based administration interface with detailed server statistics and user analytics
- DLNA/UPnP media server capabilities for legacy device compatibility

## Use cases

- Home media center replacing cable TV with personal movie and TV show collections
- Family entertainment hub with individual user profiles and age-appropriate content filtering
- Remote media streaming for accessing home library while traveling or at work
- Cord-cutting solution combining local media with live TV recording capabilities
- Multi-location media sharing between family members or friends with controlled access
- Backup streaming service during internet outages using locally stored content
- Photo and music streaming server for comprehensive household media management

## Prerequisites

- Minimum 2GB RAM for basic operation, 4GB+ recommended for multiple concurrent streams
- Fast storage system (SSD preferred) for media metadata and transcoding cache
- GPU with hardware encoding support (Intel iGPU, NVIDIA, or AMD) for optimal transcoding performance
- Properly organized media files in standard formats (MP4, MKV, AVI for video; MP3, FLAC for audio)
- Network bandwidth planning: 10-20 Mbps per 4K stream, 5-10 Mbps per 1080p stream
- Understanding of user ID mapping and file permissions for media access

## docker-compose.yml

```yaml
services:
  emby:
    image: emby/embyserver:latest
    container_name: emby
    environment:
      - UID=1000
      - GID=1000
      - GIDLIST=1000
    volumes:
      - emby-config:/config
      - /path/to/media:/media:ro
    ports:
      - "8096:8096"
      - "8920:8920"
    devices:
      - /dev/dri:/dev/dri
    networks:
      - emby-network
    restart: unless-stopped

volumes:
  emby-config:

networks:
  emby-network:
    driver: bridge
```

## .env

```bash
# Emby
# Change /path/to/media to your media directory
# Remove devices section if no hardware transcoding
```

## Usage notes

- Web UI at http://localhost:8096
- Complete setup wizard
- Premiere for additional features
- Hardware transcoding support
- Mobile and TV apps

## Troubleshooting

- Hardware transcoding not working: Verify /dev/dri device mapping and ensure user has render group permissions
- Media files not detected: Check file permissions, ensure UID/GID 1000 can read media directory structure
- Slow library scanning: Move Emby config to SSD storage and verify network speed to media locations
- Remote access issues: Configure port forwarding for 8096/8920 and verify firewall settings
- High CPU usage during playback: Enable hardware transcoding in server settings and verify GPU driver installation
- Database corruption after unexpected shutdown: Restore from automatic backup in /config/data/backup directory

