Skip to content

vakshit/pi-home-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

home-server

How to run

Make sure to setup environment variables first. Improper configuration may lead to unexpected behavior.

docker network create intranet -d bridge
docker compose up -d

Storage Structure

  • ~/databases contains databases of all the services so that hdd is not constantly read/written to save hdd life. Currently has databases for:
    • immich (postgres folder for db)
    • nextcloud (postgres and nextcloud config files)
    • portainer (just autogenerated html files, can be skipped for backup)
    • pvt-immich (postgres folder for db)
  • /media/akshit/seagate/app-data/ contains all the files other than databases of the services. Media for immich and nextcloud are stored here.
    • immich
    • nextcloud
    • pvt-immich

Directory structure walkthrough

ansible

Contains ansible scripts to install docker to the server you are trying to setup.

bakups

In my opinion the most important folder to have, it contains the scripts which is required to create a google drive backup of the databases of immich and nextcloud.

How does this work

on running the docker container, it runs the database_backup.sh script. This script creates dumps of databases in the BACKUP_LOCATION directory. Then the python script runs to upload these dumps to google drive, overwriting any backup previously created. NOTE: Make sure to run this as a cron daily at around 4am.

cloudflared

Simple but most important. It creates a tunnel to cloudflare. If you want to create one. Fetch a token from Zero Trust in Cloudflare dashboard and place it in the .env file. More instructions on the dashboard itself.

Note: As cloudflared is running inside docker, it uses docker networking, so in cloudflare dashboard, redirect to nginx:port rather than localhost:port

immich

In v1.105.1 it has 5 components note these are service names, container names are similar:

  • immich-server
  • immich-microservices
  • immich-machine-learning
  • immich-redis
  • immich-database

Self sufficient by itself. Importance of env variables:

  • IMMICH_VERSION: ⚠️ This might be breaking. Do not migrate if things work good for you. Do update regularly but with caution only after reading changelog.
  • UPLOAD_LOCATION: Place where all the media is stored, on external media.
  • DB_DATA_LOCATION: Database data path, on SD card now to save hdd life.
  • ARCHIVE_PATH, ALBUM_PATH: External Library path.
  • Rest others are self explainatory.

jellyfin

To be populated

nextcloud

v29.0.0-fpm has these 3 services running:

  • nextcloud-mariadb
  • nextcloud-redis
  • nextcloud

Importance of env variables:

  • BACKUP_LOCATION: ⚠️ This location needs to be identical with the backup location in backups folder as this is the place where nextcloud-mariadb places its dumps for upload.
  • DB_DATA_LOCATION: Database location for mariadb of nextcloud. Inside the ~/databases folder for now.
  • HTML_LOCATION: This is where html and stuff will be stored. This is also currently points to ~/databases directory.
  • DATA_LOCATION: This is where actual data is stored, i.e files. This points to the external mounted drive.

nginx

This was the most important and cluttered until cloudflared was integrated, which made life and security a lot easier. All Services are now listed under sites-enabled folder. All they do is recirect to the specific port on which each server is running. This will be changed to nginx-proxy soon as its a lot easier to configure with cloudflared.

portainer

This is just a stateless application, mostly for monitoring.

pvt-immich

Ditto replica of immich.

rocket-chat

Yet to be explored, looking for self hosted chat applications.

docker-compose.yml

Main docker-compose file, which defines network intranet and calls all other services.