Skip to content

Emby

Emby (think "M.B." or "Media Browser") is best described as "like Plex but different" 😁 - It's a bit geekier and less polished than Plex, but it allows for more flexibility and customization.

Emby Screenshot

I've started experimenting with Emby as an alternative to Plex, because of the advanced parental controls it offers. Based on my experimentation thus far, I have a "kid-safe" profile which automatically logs in, and only displays kid-safe content, based on ratings.

Ingredients

  1. Docker swarm cluster with persistent shared storage
  2. Traefik configured per design
  3. DNS entry for the hostname you intend to use, pointed to your keepalived IP

Preparation

Setup data locations

We'll need a location to store Emby's library data, config files, logs and temporary transcoding space, so create /var/data/emby, and make sure it's owned by the user and group who also own your media data.

1
mkdir /var/data/emby

Prepare environment

Create emby.env, and populate with PUID/GUID for the user who owns the /var/data/emby directory (above) and your actual media content (in this example, the media content is at /srv/data)

1
2
PUID=
GUID=

Setup Docker Swarm

Create a docker swarm config file in docker-compose syntax (v3), something like this:

Tip

I share (with my patreon patrons) a private "premix" git repository, which includes necessary docker-compose and env files for all published recipes. This means that patrons can launch any recipe with just a git pull and a docker stack deploy 👍

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
version: "3.0"

services:
  emby:
    image: emby/embyserver
    env_file: /var/data/config/emby/emby.env
    volumes:
      - /var/data/emby/emby:/config
      - /srv/data/:/data
    deploy:
      labels:
        - traefik.frontend.rule=Host:emby.example.com
        - traefik.docker.network=traefik_public
        - traefik.port=8096
    networks:
        - traefik_public
        - internal
    ports:
      - 8096:8096

networks:
  traefik_public:
    external: true
  internal:
    driver: overlay
    ipam:
      config:
        - subnet: 172.16.17.0/24

Note

Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See my list here.

Serving

Launch Emby stack

Launch the stack by running docker stack deploy emby -c <path -to-docker-compose.yml>

Log into your new instance at https://YOUR-FQDN, and complete the wizard-based setup to complete deploying your Emby.

Chef's Notes

  1. I didn't use an oauth2_proxy for this stack, because it would interfere with mobile client support.
  2. I used the LinuxServer docker container, even though still under "active development", to maintain consistency with the Plex and autopirate recipies.
  3. We don't bother exposing the HTTPS port for Emby, since Traefik is doing the SSL termination for us already.

Tip your waiter (donate) 👏

Did you receive excellent service? Want to make your waiter happy? (..and support development of current and future recipes!) See the support page for (free or paid) ways to say thank you! 👏

Your comments? 💬