2025-12-20 12:42:19 -06:00
2025-12-20 12:42:19 -06:00
2025-12-20 12:42:19 -06:00
2025-12-20 12:42:19 -06:00
2025-12-20 12:42:19 -06:00

Media Server

Description

The media server currently runs the entire home lab.

The home lab consists of the server that hosts storage and services for the following content. The information below documents the setup and can be used to recover if needed.

  • movies
  • TV
  • music
  • photos
  • notes
  • documents

Mount points are used to allow the actual storage location to change as needed as storage demands change. A new external drive can be added and mounted to this directory without the need to modify the configurations of all the self-hosted services that use it.

Host Directory Setup

Media Content

Create a new directory named library and modify permissions to it. This will be used as the mount point for the external drive that stores movies, TV, music, and books.

sudo mkdir /library
sudo chmod 777 /library

insert instructions on attaching and mounting external drive

Now create separate directories for each type of content.

mkdir /library/tv
mkdir /library/movies
mkdir /library/music
mkdir /library/books

Paperless Content

Create a new directory named doc-archive and modify permissions to it. This w/ill be used as the mount point for the external drive that stores the paperless content.

sudo mkdir /doc-archive
sudo chmod 777 /doc-archive

Now create the sub directories for each use case

mkdir /doc-archive/artifacts   #Docs and thumbnails
mkdir /doc-archive/export
mkdir /doc-archive/consume

Usenet Download

Create a directory named downloads and modify permissions to it. This directory will be used by SabNZB for files it downloads.

mkdir /downloads
sudo chmod 777 /downloads

SabNZB uses two directories in the download process. One stores incomplete downloads and the other stores completed downloads. Create a directory for each in the /downloads directory.

mkdir /downloads/complete
mkdir /downloads/incomplete

Host / Container Directory Mapping

The table below displays the host and container directory mapping. This information is useful to know how you can access files and data in the container directly from the host. This information is also contained in the yaml used to create the container.

Host Directory Container Directory Container Name Description
/library/tv /tv Sonarr Sonarr moves TV shows to this directory after processing
/downloads/complete/tv /downloads/tv Sonarr Location SabNZB places downloaded TV shows and Sonarr monitors for processing
/library/movies /movie Radarr Radarr moves movies to this directory after processing
/downloads/complete/movies /downloads/movies Radarr Location SabNZB places downloaded movies and Radarr monitors for processing
/library/music /music Lidarr Lidarr moves music to this directory after processing
/downloads/complete/music /downloads/music Lidarr Location SabNZB places downloaded music and Lidarr monitors for processing
/library/books /books Readarr Readarr moves books to this directory after processing
/downloads/complete/books /downloads/books Readarr Location SabNZB places downloaded books and Readarr monitors for processing
/downloads/complete /complete SabNZB Top level directory for SabNZB completed downloads
/downloads/incomplete /incomplete SabNZB Directory used by SabNZB for incomplete downloads
Plex
Immich
Caddy
/home/mattspeer/paperless-ngx/redis/redisdata /data Paperless-ngx Redis Redis data
/home/mattspeer/paperless-ngx/postgress/pgdata /var/lib/postgresql/data Paperless-ngx Postgres Postgres DB
/home/mattspeer/paperless-ngx/web/data /usr/src/paperless/data Paperless-ngx web Paperless-ngx stores index and models here
/doc-archive/artifacts /usr/src/paperless/media Paperless-ngx web Paperless-ngx stores documents and thumbnails
/doc-archive/export /usr/src/paperless/export Paperless-ngx web Directory used when documents are exported
/doc-archive/consume /usr/src/paperless/consume Paperless-ngx web Directory monitored for ingesting documents

Docker Installation

Note

Refer to official docker documentation for installation on Ubuntu for more details. The information below was derived from this link. https://docs.docker.com/engine/install/ubuntu/

Setup Repo

Issue the following commands to setup the docker repo

sudo apt-get update  

sudo apt-get install ca-certificates curl gnupg  

sudo install -m 0755 -d /etc/apt/keyrings  

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg  

sudo chmod a+r /etc/apt/keyrings/docker.gpg echo   "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \  
   "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \  

sudo tee /etc/apt/sources.list.d/docker.list > /dev/null  

sudo apt-get update

Install Docker Engine

Execute the following command to install docker engine

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Portainer Installation

Note

The information below was pulled from the following link for reference https://phoenixnap.com/kb/docker-portainer-install

Execute the following command to create the docker volume

docker volume create portainer_data

Now execute the following command to install Portainer server

docker run -d -p 9000:9000 --name portainer \  
 --restart=always \  
 -v /var/run/docker.sock:/var/run/docker.sock \  
 -v portainer_data:/data \  
 portainer/portainer-ce:latest

Access Portainer at https://localhost:9000

Port to Service Mapping

Software Applications Setup

SabNZB

Sonarr

Radarr

Lidarr

Readarr

Jellyfin

Plex

Immich

Vaultwarden

Paperless-ngx

Docker compose

# Docker Compose file for running paperless from the Docker Hub.
# This file contains everything paperless needs to run.
# Paperless supports amd64, arm and arm64 hardware.
#
# All compose files of paperless configure paperless in the following way:
#
# - Paperless is (re)started on system boot, if it was running before shutdown.
# - Docker volumes for storing data are managed by Docker.
# - Folders for importing and exporting files are created in the same directory
#   as this file and mounted to the correct folders inside the container.
# - Paperless listens on port 8010.
#
# In addition to that, this Docker Compose file adds the following optional
# configurations:
#
# - Instead of SQLite (default), PostgreSQL is used as the database server.
#
# To install and update paperless with this file, do the following:
#
# - Open portainer Stacks list and click 'Add stack'
# - Paste the contents of this file and assign a name, e.g. 'paperless'
# - Click 'Deploy the stack' and wait for it to be deployed
# - Open the list of containers, select paperless_webserver_1
# - Click 'Console' and then 'Connect' to open the command line inside the container
# - Run 'python3 manage.py createsuperuser' to create a user
# - Exit the console
#
# For more extensive installation and update instructions, refer to the
# documentation.

version: "3.4"
services:
  broker:
    image: docker.io/library/redis:7
    restart: unless-stopped
    volumes:
      - /home/mattspeer/paperless-ngx/redis/redisdata:/data

  db:
    image: docker.io/library/postgres:15
    restart: unless-stopped
    volumes:
      - /home/mattspeer/paperless-ngx/postgress/pgdata:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: paperless

  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:latest
    restart: unless-stopped
    depends_on:
      - db
      - broker
    ports:
      - "8010:8000"
    volumes:
      - /home/mattspeer/paperless-ngx/web/data:/usr/src/paperless/data
      - /doc-archive/artifacts:/usr/src/paperless/media
      - /doc-archive/export:/usr/src/paperless/export
      - /doc-archive/consume:/usr/src/paperless/consume
    environment:
      PAPERLESS_REDIS: redis://broker:6379
      PAPERLESS_DBHOST: db
# The UID and GID of the user used to run paperless in the container. Set this
# to your UID and GID on the host so that you have write access to the
# consumption directory.
      USERMAP_UID: 1000
      USERMAP_GID: 1000
# Additional languages to install for text recognition, separated by a
# whitespace. Note that this is
# different from PAPERLESS_OCR_LANGUAGE (default=eng), which defines the
# language used for OCR.
# The container installs English, German, Italian, Spanish and French by
# default.
# See https://packages.debian.org/search?keywords=tesseract-ocr-&searchon=names&suite=buster
# for available languages.
      #PAPERLESS_OCR_LANGUAGES: tur ces
# Adjust this key if you plan to make paperless available publicly. It should
# be a very long sequence of random characters. You don't need to remember it.
      #PAPERLESS_SECRET_KEY: change-me
# Use this variable to set a timezone for the Paperless Docker containers. If not specified, defaults to UTC.
      #PAPERLESS_TIME_ZONE: America/Los_Angeles
# The default language to use for OCR. Set this to the language most of your
# documents are written in.
      #PAPERLESS_OCR_LANGUAGE: eng

volumes:
  data:
  media:
  pgdata:
  redisdata:

Launch Portainer and create a new stack, paste the above yaml code into ...

Once the stack is deployed and runnning enter the container's terminal and execute the following command to create the initial super user.

python3 manage.py createsuperuser

Paperless-ngx is now ready for login and use

Backup

Execute the following commands to backup important configurations

sudo rsync -avz /etc/fstab /mnt/5TB-Disk1/backup/server/os

Ports in Use

80 Caddy 443 Caddy 2283 Immich 32400 Plex 5055 Overseerr 6595 Lidarr on Steroids 7878 Radarr 8001 Vaultwarden 8010 Paperless-ngx 8020 Stirling PDF 8085 ntfy 8080 Sabnzb 8686 Lidarr 8687 Lidarr on Steriods 8787 Readarr 8989 Sonarr 9000 Portainer

Description
No description provided
Readme 37 KiB
Languages
Shell 100%