My configuration for plex media center

EC

Esteban Campos / June 17, 2024

4 min read––– views

Building a Powerful Media Center with Docker Compose#

This guide explores setting up a robust media center leveraging the simplicity and efficiency of Docker Compose. Docker Compose allows you to define and orchestrate multi-container applications with a single command. This makes it ideal for deploying complex media centers with various functionalities.

Specific services#

  • VPN (gluetun): Secure your web browsing with anonymity and privacy.
  • Torrent Downloader (qbittorrent): Effortlessly download your desired media files.
  • Automated Media Management (Sonarr, Radarr, Readarr): Automate content discovery and download, eliminating manual intervention.
  • Media Organization (Prowlarr, Bazarr): Maintain a well-organized library with flawless subtitle management.
  • Optional Plex Monitoring (Tautulli): Keep an eye on your Plex Media Server's health (not included in this configuration).
  • Streaming Service Management (Overseerr): Streamline content management across various platforms.
  • Bonus Features:
    • AudiobookShelf (manage audiobooks)
    • tdarr (media transcoding)
    • Grabbing free games from Epic Games (currently disabled)

Potential Challenges to Address#

While Docker Compose simplifies deployment, consider these potential areas for optimization within qBittorrent, Gluetun, and qBittorrent-natmap:

  • qBittorrent:
    • Performance Optimization: Fine-tune settings for speed, port forwarding, and tracker management to maximize performance.
    • Security: Prioritize responsible downloading by verifying trusted sources and staying vigilant against malware.
    • Resource Monitoring: Monitor and manage resource usage, especially with heavy download activities.
  • Gluetun (VPN):
    • Free Tier Limitations: The free tier might have bandwidth or server restrictions. Consider upgrading for heavy use.
    • Basic VPN Knowledge: A foundational understanding of VPNs can be helpful for troubleshooting connection issues.
    • Security vs. Speed Trade-off: Using a VPN may introduce overhead, potentially impacting qBittorrent download speeds.
  • qBittorrent-natmap:
    • Redundancy Check: Verify if your chosen VPN provider already handles port forwarding automatically. This service might be unnecessary in such cases.
    • Dependency Management: qBittorrent-natmap relies on both qBittorrent and Gluetun functioning properly. Issues in either service can affect port forwarding requests.
    • Limited Support: As a third-party script, qBittorrent-natmap might have less support and documentation compared to official features.

Docker compose file#

---
version: "3.1"
services:
  gluetun:
    # See https://github.com/qdm12/gluetun-wiki/tree/main/setup#setup
    image: ghcr.io/qdm12/gluetun:v3
    container_name: gluetun
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    volumes:
      - /config/gluetun-config:/gluetun
      - /config/tmp/gluetun:/tmp/gluetun
    environment:
      - UPDATER_PERIOD=24h
      - VPN_SERVICE_PROVIDER=custom
      - VPN_TYPE=wireguard
      - VPN_PORT_FORWARDING=on
      - VPN_PORT_FORWARDING_PROVIDER=protonvpn
      - VPN_ENDPOINT_IP=${VPN_ENDPOINT_IP}
      - VPN_ENDPOINT_PORT=${VPN_ENDPOINT_PORT}
      - WIREGUARD_PUBLIC_KEY=${WIREGUARD_PUBLIC_KEY}
      - WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
      - WIREGUARD_ADDRESSES=${WIREGUARD_ADDRESSES}
      - TZ=${TIMEZONE}
      - PUID=${PUID_GLUETUN}
      - PGID=${PGID}
    ports:
      - 8080:8080/tcp 

  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    network_mode: "service:gluetun"
    depends_on:
      gluetun:
        condition: service_healthy
    environment:
      - PUID=${PUID_QBITTORRENT}
      - PGID=${PGID}
      - TZ=${TIMEZONE}
      - UMASK=002
      - WEBUI_PORT=8080
    volumes:
      - /config/qbittorrent-config:/config
      - /data/torrents:/data/torrents
      - /data:/data
    restart: unless-stopped

  qbittorrent-natmap:
    image: ghcr.io/soxfor/qbittorrent-natmap:latest
    container_name: qbittorrent-natmap
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /config/qbittorrent-natmap-config:/config
      - /config/qbittorrent-natmap-config/certs:/etc/ssl/certs
    network_mode: "service:gluetun"
    environment:
      - PUID=${PUID_QBITTORRENT_NATMAP}
      - PGID=${PGID}
      - TZ=${TIMEZONE}
      - QBITTORRENT_SERVER=localhost
      - QBITTORRENT_PORT=8080
      - QBITTORRENT_USER=admin
      - QBITTORRENT_PASS=adminadmin
    depends_on:
      qbittorrent:
        condition: service_started
      gluetun:
        condition: service_healthy

  sonarr:
    image: lscr.io/linuxserver/sonarr:latest
    container_name: sonarr
    environment:
      - PUID=${PUID_SONARR}
      - PGID=${PGID}
      - UMASK=002
      - TZ=${TIMEZONE}
    volumes:
      - /config/sonarr-config:/config
      - /data:/data
    ports:
      - "8989:8989"
    restart: unless-stopped

  radarr:
    image: lscr.io/linuxserver/radarr:latest
    container_name: radarr
    environment:
      - PUID=${PUID_RADARR}
      - PGID=${PGID}
      - UMASK=002
      - TZ=${TIMEZONE}
    volumes:
      - /config/radarr-config:/config
      - /data:/data
    ports:
      - "7878:7878"
    restart: unless-stopped

  readarr-ebooks:
    image: lscr.io/linuxserver/readarr:develop
    container_name: readarr_ebooks
    environment:
      - PUID=${PUID_READARR}
      - PGID=${PGID}
      - TZ=${TIMEZONE}
      - UMASK=002
    volumes:
      - /config/readarr-config:/config
      - /data:/data
    ports:
      - "8787:8787"
    restart: unless-stopped

  readarr-audiobooks:
    image: lscr.io/linuxserver/readarr:develop
    container_name: readarr_audiobooks
    environment:
      - PUID=${PUID_READARR_AUDIOBOOKS}
      - PGID=${PGID}
      - TZ=${TIMEZONE}
      - UMASK=002
    volumes:
      - /config/readarr-audiobooks-config:/config
      - /data:/data
    ports:
      - "8788:8787"
    restart: unless-stopped

  prowlarr:
    image: lscr.io/linuxserver/prowlarr:latest
    container_name: prowlarr
    environment:
      - PUID=${PUID_PROWLARR}
      - PGID=${PGID}
      - UMASK=002
      - TZ=${TIMEZONE}
    volumes:
      - /config/prowlarr-config:/config
    ports:
      - "9696:9696"
    restart: unless-stopped

  tautulli:
    image: lscr.io/linuxserver/tautulli:latest
    container_name: tautulli
    # depends_on:
    # - plex
    environment:
      - PUID=${PUID_TAUTULLI}
      - PGID=${PGID}
      - TZ=${TIMEZONE}
    volumes:
      - /config/tautulli-config:/config
    ports:
      - "8181:8181"
    restart: unless-stopped 

  overseerr:
    image: sctx/overseerr:latest
    container_name: overseerr
    environment:
      - PUID=${PUID_OVERSEERR}
      - PGID=${PGID}
      - UMASK=002
      - TZ=${TIMEZONE}
    volumes:
      - /config/overseerr-config:/app/config
    ports:
      - "5055:5055"
    restart: unless-stopped

  bazarr:
    image: lscr.io/linuxserver/bazarr:latest
    container_name: bazarr
    environment:
      - PUID=${PUID_BAZARR}
      - PGID=${PGID}
      - TZ=${TIMEZONE}
    volumes:
      - /config/bazarr-config:/config
      - /data:/data
    ports:
      - "6767:6767"
    restart: unless-stopped

  tdarr:
    container_name: tdarr
    image: ghcr.io/haveagitgat/tdarr:latest
    restart: unless-stopped
    network_mode: bridge
    ports:
      - 8265:8265 # webUI port
      - 8266:8266 # server port
      - 8267:8267 # Internal node port
    environment:
      - TZ=${TIMEZONE}
      - PUID=${PUID_TDARR}
      - PGID=${PGID}
      - UMASK_SET=002
      - serverIP=0.0.0.0
      - serverPort=8266
      - webUIPort=8265
      - internalNode=true
      - inContainer=true
      - nodeName=MyInternalNode
    volumes:
      - /config/tdarr-server-config:/app/server
      - /config/tdarr-server-config:/app/configs
      - /config/tdarr-server-config/logs:/app/logs
      - /data/media:/media
      - /transcode_cache:/temp

  tdarr-node:
    container_name: tdarr-node
    image: ghcr.io/haveagitgat/tdarr_node:latest
    restart: unless-stopped
    network_mode: service:tdarr
    environment:
      - TZ=${TIMEZONE}
      - PUID=${PUID_TDARR_NODE}
      - PGID=${PGID}
      - UMASK_SET=002
      - nodeName=MainNode
      - serverIP=0.0.0.0
      - serverPort=8266
      - inContainer=true
    volumes:
      - /config/tdarr-client-config:/app/configs
      - /config/tdarr-client-config/logs:/app/logs
      - /data/media:/media
      - /transcode_cache:/temp

  ersatztv:
    container_name: ersatztv
    image: jasongdove/ersatztv:latest-arm64
    restart: unless-stopped
    environment:
      - TZ=${TIMEZONE}
      - PUID=${PUID_ERSATZTV}
      - PGID=${PGID}
    ports:
      - "8409:8409/tcp"
    volumes:
      - /config/ersatztv-config:/root/.local/share/ersatztv
      - /data:/data:ro

  audiobookshelf:
    container_name: audiobookshelf
    image: ghcr.io/advplyr/audiobookshelf:latest
    restart: unless-stopped
    environment:
      - TZ=${TIMEZONE}
      - PUID=${PUID_AUDIOBOOKSHELF}
      - PGID=${PGID}
    ports:
      - 13378:80
    volumes:
      - /data/audiobooks:/audiobooks
      - /data/podcasts:/podcasts
      - /config/audiobookshelf-config:/config
      - /data/metadata:/metadata