Skip to content

Latest commit

 

History

History
127 lines (92 loc) · 8.02 KB

README.md

File metadata and controls

127 lines (92 loc) · 8.02 KB

Homelab with Docker Compose

Collection of Docker Compose files to easily install and manage your homelab. This includes containers I use myself. Feel free to suggest new containers of fork this repository and add your own.

Included containers

Applications Media Administration
Home Assistant Jellyfin Nginx Proxy Manager
Actual Budget Jellyseerr Dozzle
Mealie Prowlarr* qBitTorrent*
Nextcloud Radarr* Uptime Kuma
Homebox Sonarr* Gluetun
Immich Bazarr* CloudFlare DDNS
Readarr* Duplicati
Metube Docker Volume Backup
Podgrab FlareSolverr

Disclaimer: these containers are only used for managing legal Linux distro's.

Requirements

Folder structure

├── /opt
│  └── homelab (this repo)
|     ├── application folder
│     |  └── .env
│     |  └── compose.yaml
|     └── compose.yaml
├── /srv
│  └── homelab (docker data)
|  |  └── application folder
│  |     └── * (config & data folder)
│  |        └── *
|  └── backup
|      └── volume (backups by docker-volume-backup)
|      └── duplicati (backups by duplicati)
└── /mnt/storage (media storage)
   ├── nextcloud
   ├── photos
   ├── downloads
   │  ├── books
   │  ├── movies
   │  └── tv
   └── media
      ├── books
      ├── movies
      ├── podcasts
      ├── tv
      └── metube

Installation

Clone this repository

$ cd /opt
$ git clone https://github.com/shaunjanssens/homelab

Change .env files for all containers

Each container has it's own .env file with container specific config. Each container contains and README.md with more info.

Getting user and group ID

By default, Docker containers run as root. This entails dangers, that's why most containers run as a non-root user.

$ id

The output of this command should be something like uid=1000(homelabuser) gid=1000(homelabuser) groups=1000(homelabuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),105(lxd),994(docker) when 1000 is your user and group id and 994 your Docker group.

Create data directories for all containers

$ sudo mkdir /srv/homelab
$ cd /srv/homelab
$ sudo mkdir {actual-budget,duplicati,home-assistant,homebox,homer,immich-database,immich-machine-learning,immich-machine-learning-gecoding,immich-redis,immich-typesense,jellyfin,mealie,gluetun,qbittorrent,prowlarr,radarr,sonarr,readarr,bazarr,jellyseerr,metube,nextcloud,nextcloud-db,nginx-proxy-manager,podgrab,uptime-kuma}

Change ownership of data and media directories

$ sudo chown -R $USER:$USER /srv/homelab
$ sudo chown -R $USER:$USER /media/storage
$ sudo chmod -R a=,a+rX,u+w,g+w /media/storage

Start all containers

Change directory to the stack you want to start.

$ docker compose up -d

Accessing containers

It's possible to access all apps with the server IP and container port but Nginx Proxy Manager is included to access the containers with a user-friendly domain. Cloudflare DDNS is also included to update your domains with your IP address. With Cloudflare it's possible to proxy all traffic so your IP address is not exposed.

Dashboard

To get an overview of all containers there's a dashboard (homer) included. This dashboard needs some configuration to view all containers. There's also a custom theme included. dashboard-icons is used for app icons but it's also possible to use own images. A custom theme file is located at homer/assets/custom.css.

Screenshot of Homer dashboard

Backup and restore

All Docker container config data is stored in /srv/homelab and is backed up every night to /srv/backup/volume. Duplicati is also installed to backup other data like media storage and Nextcloud data.

Recommendations

  • LazyDocker for managing Docker containers
  • btop for monitoring server resources

Roadmap

  • Add Diun for getting notifications when a Docker image is updated