1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-13 17:56:26 +00:00
Files
geek-cookbook/docs/recipes/plex.md
David Young cf44acda27 Add recipe for searxng (#274)
* Add recipe for searxng

Signed-off-by: David Young <davidy@funkypenguin.co.nz>

* Fussy linter

Signed-off-by: David Young <davidy@funkypenguin.co.nz>

---------

Signed-off-by: David Young <davidy@funkypenguin.co.nz>
2023-03-10 17:47:52 +00:00

2.8 KiB

title, description, recipe
title description recipe
Run Plex in Docker Play back all your media on all your devices Plex

Plex in Docker

Plex is a client-server media player system and software suite comprising two main components (a media server and client applications)

Plex Screenshot

{{ page.meta.recipe }} Requirements

--8<-- "recipe-standard-ingredients.md"

Preparation

Setup data locations

We'll need a directories to bind-mount into our container for Plex to store its library, so create /var/data/plex:

mkdir /var/data/plex

Prepare {{ page.meta.recipe }} environment

Create plex.env, and populate with the following variables. Set PUID and GUID to the UID and GID of the user who owns your media files, on the local filesystem

EDGE=1
VERSION=latest
PUID=42
PGID=42

{{ page.meta.recipe }} Docker Swarm config

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

--8<-- "premix-cta.md"

version: "3.0"

services:
  plex:
    image: lscr.io/linuxserver/plex
    env_file: plex.env
    volumes:
      - /var/data/config/plex:/config
      - /var/data/media:/media
    deploy:
      labels:
        # traefik common
        - traefik.enable=true
        - traefik.docker.network=traefik_public

        # traefikv1
        - traefik.frontend.rule=Host:plex.example.com
        - traefik.port=32400     

        # traefikv2
        - "traefik.http.routers.plex.rule=Host(`plex.example.com`)"
        - "traefik.http.services.plex.loadbalancer.server.port=32400"
        - "traefik.enable=true"
    networks:
        - traefik_public
        - internal
    ports:
      - 32469:32469
      - 32400:32400
      - 32401:32401
      - 3005:3005
      - 8324:8324
      - 1900:1900/udp
      - 32410:32410/udp
      - 32412:32412/udp
      - 32413:32413/udp
      - 32414:32414/udp

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

--8<-- "reference-networks.md"

Serving

Launch Plex stack

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

Log into your new instance at https://YOUR-FQDN (You'll need to setup a plex.tv login for remote access / discovery to work from certain clients)

--8<-- "recipe-footer.md"