g0Idfinger / docker-HTPC

Home Plex Server with Reverse Proxy
The Unlicense
14 stars 0 forks source link

Docker HTPC

This is built on Ubuntu

The following containers are in the the docker-compose-t2.yml file

FRONTENDS

DATABASE

DOWNLOADERS

INDEXERS

PVRS

MEDIA SERVER

SYSTEM

MAINTENANCE

Usage

Installation

Install Ubuntu, Docker and Docker Compose

Docker Install

Clone the repo.

  1. Create .env file for environmental variables, make sure to change USER to your username

    • mv $USERDIR/docker-HTPC/.env.example $USERDIR/docker-HTPC/.env
    • edit the variables to your liking, comment out ones you don't need and vice versa
  2. Create files for Traefik

    • mkdir $USERDIR/docker-HTPC/traefik2/
    • mkdir $USERDIR/docker-HTPC/traefik2/acme
    • touch $USERDIR/docker-HTPC/traefik2/acme/acme.json
    • chmod 600 $USERDIR/docker-HTPC/traefik2/acme/acme.json
    • touch $USERDIR/docker-HTPC/traefik2/traefik.log
    • For other providers other than cloudflare, check here.
  3. You will have to put your sensitive information in files. Create folder/files for Docker Secrets

    • mkdir $USERDIR/docker-HTPC/secrets
    • chmod 600 $USERDIR/docker-HTPC/secrets
    • sudo su
    • cd $USERDIR/docker-HTPC/secrets
    • make your files for each individual credentials or APIs that you want to use. I have created the following files and entered in the corresponding info:
      • authelia_duo_api_secret_key
      • authelia_jwt_secret
      • authelia_notifier_smtp_password
      • authelia_session_secret
      • authelia_storage_mysql_password
      • cloudflare_api_key
      • cloudflare_email
      • cloudflare_zoneid
      • google_client_id
      • google_client_secret
      • guac_db_name
      • guac_mysql_password
      • guac_mysql_user
      • my_email
      • mysql_root_password
      • oauth_secret
      • plex_claim
      • RADARR_API_KEY
  4. (Optional) Enable or use HTTP Basic Authentication by renaming shared\.htpasswd.example to shared\.htpasswd in the folder and adding username and hashed password to it.

  5. Configure environmental variables (.env file)

    • Rename the included .env.example to .env.
    • Edit variables in .env file.
    • All variables (ie. ${XXX}) in docker-compose.yml come from .env file stored in the same place as docker-compose.yml.
    • Ensure good permissions for the .env file (recommended: 640).
  6. Edit docker-compose-t2.yml to include only the services you want or add additional services to it.

  7. If using pihole ensure you create the files indicated below for dhcphelper, also if you have host DNS issues read below to troubleshoot/fix

  8. Start your docker stack "docker-compose -f docker-compose-t2.yml up -d"

Configuration Files:

Environment

Configure .env with the variables. see .env.example
Use .env file now for variables instead of /etc/environment

DHCP-Helper for use with PiHole

  1. Create folder dhcp-helper under ~/docker
  2. Create file Dockerfile in ~/docker-HTPC/dhcp-helper
  3. Add:

    FROM alpine:latest
    RUN apk --no-cache add dhcp-helper
    EXPOSE 67 67/udp
    ENTRYPOINT ["dhcp-helper", "-n"]

HOW TO FIX HOST DNS ISSUES

disable systemd-resolved service.

sudo systemctl disable systemd-resolved.service

Stop the service

sudo systemctl stop systemd-resolved.service

Then, remove the link to /run/systemd/resolve/stub-resolv.conf in /etc/resolv.conf

sudo rm /etc/resolv.conf

Add a manually created resolv.conf in /etc/

sudo vim /etc/resolv.conf

Add your prefered DNS server there

nameserver