Skip to content

A docker-compose setup ready to spin up a bunch of useful media, file-sharing, programming, web tools, databases...

Notifications You must be signed in to change notification settings

mpascu/SmartHomeStack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏠 SmartHomeStack

A docker-compose stack to deploy a full homelab with media management, smart home automation, monitoring, and utility services. All persistent data is stored in the ./config folder and Duplicati is provided for backups.

πŸ“ Repository Structure

SmartHomeStack/
β”œβ”€β”€ docker-compose.yml      # Main compose file (core infrastructure)
β”œβ”€β”€ compose/                # Additional service modules
β”‚   β”œβ”€β”€ ai.yml              # AI services (Open WebUI, Ollama)
β”‚   β”œβ”€β”€ dashboards.yml      # Dashboards (Heimdall, Organizr, Homarr)
β”‚   β”œβ”€β”€ ebooks.yml          # E-book management (Calibre, Calibre-web)
β”‚   β”œβ”€β”€ nextcloud.yml       # File hosting (Nextcloud + MariaDB)
β”‚   β”œβ”€β”€ immich.yml          # Photo management (Immich)
β”‚   β”œβ”€β”€ smarthome.yml       # Smart home (Home Assistant, Zigbee, MQTT)
β”‚   └── media.yml           # Media management (Plex, Sonarr, Radarr, etc.)
β”œβ”€β”€ config/                 # Persistent data for all services (gitignored)
β”œβ”€β”€ scripts/                # Helper scripts
β”‚   └── Makefile            # Common operations (up, down, update, logs, etc.)
β”œβ”€β”€ .env.example            # Environment variables template
└── README.md

πŸ“Έ Screenshots

Heimdall screenshot

Organizr screenshot

🧰 Tools included

πŸ”§ Core Infrastructure (docker-compose.yml)

  • Traefik: Reverse proxy with automatic HTTPS certificate management
  • Pi-hole: DNS sinkhole that blocks ads and malware
  • PostgreSQL: Database for Restyaboard
  • Adminer: Database management UI
  • Postfix: SMTP relay for sending emails
  • SFTP: File transfer server

☁️ File Hosting (compose/nextcloud.yml)

  • Nextcloud: Self-hosted file sync and share platform
  • MariaDB: Database for Nextcloud

πŸ“· Photo Management (compose/immich.yml)

  • Immich: Self-hosted photo and video backup solution with ML-powered features

πŸ“Š Dashboards (compose/dashboards.yml)

  • Heimdall: Application dashboard
  • Organizr: Unified tab interface for all services
  • Homarr: Modern dashboard with Docker integration

🐳 Docker Management

πŸ“ˆ Monitoring & Maintenance

πŸ”Œ Remote Access & Utilities

πŸ“š E-books (compose/ebooks.yml)

πŸ’‘ Smart Home (compose/smarthome.yml)

🎬 Media Management (compose/media.yml)

πŸ€– AI (compose/ai.yml)

  • Open WebUI: Chat interface for LLMs
  • OpenClaw: Claude AI coding assistant with gateway and CLI (access at openclaw.${hostname})

βœ… Prerequisites

  • A domain name
  • Docker and Docker Compose installed

πŸš€ Installation

  1. Copy .env.example to .env and configure credentials and storage paths
  2. Generate a secure key for Homarr: openssl rand -hex 32
  3. Launch the stack:
    docker compose up -d

πŸ› οΈ Helper Commands

A Makefile is provided in scripts/ for common operations:

cd scripts
make up        # Start all services
make down      # Stop all services
make logs      # Follow logs for all services
make update    # Pull latest images and restart
make status    # Show container status
make help      # Show all available commands

βš™οΈ Enabling/Disabling Services

Optional compose files

The stack is split into multiple compose files in the compose/ folder. By default, smarthome.yml and ai.yml are included. To enable media services, uncomment the media.yml include in docker-compose.yml:

include:
  - compose/ai.yml
  - compose/smarthome.yml
  - compose/media.yml  # Uncomment to enable

Disabling individual services

To disable a specific service without removing it from the compose file, add the DONOTDEPLOY profile:

myservice:
  image: someimage
  profiles:
    - DONOTDEPLOY
  # ... rest of config

Services with this profile will be skipped during docker compose up unless explicitly requested.

πŸ”¨ Post-installation configuration

Pi-hole DNS setup (Ubuntu/Debian)

Disable the system DNS resolver so Pi-hole can bind to port 53:

sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service

Edit NetworkManager config:

sudo nano /etc/NetworkManager/NetworkManager.conf

Add dns=default under [main]:

[main]
plugins=ifupdown,keyfile
dns=default

Rename the existing resolv.conf and restart NetworkManager:

sudo mv /etc/resolv.conf /etc/resolv.conf.bak
sudo service network-manager restart

Nextcloud trusted domain

Add your domain to config/nextcloud/config/config.php:

  • Under 'trusted_domains'
  • At 'overwrite.cli.url'

For external storage and reverse proxy support, also add:

'check_data_directory_permissions' => false,
'overwriteprotocol' => 'https',

Media services security

⚠️ Important: Set up authentication on Sonarr, Radarr, and Lidarr immediately after first deployment, otherwise they will be exposed without password protection.

OpenClaw setup

OpenClaw connects to Claude AI via your claude.ai session. Configure OPENCLAW_GATEWAY_TOKEN in .env (generate with openssl rand -hex 32) and add your Claude session credentials (CLAUDE_AI_SESSION_KEY, CLAUDE_WEB_SESSION_KEY, CLAUDE_WEB_COOKIE). See the OpenClaw documentation for obtaining these values. The openclaw-cli service uses the DONOTDEPLOY profileβ€”run it manually with docker compose run --rm openclaw-cli when needed.

About

A docker-compose setup ready to spin up a bunch of useful media, file-sharing, programming, web tools, databases...

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published