๐ 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


๐งฐ 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
- Copy
.env.example to .env and configure credentials and storage paths
- Generate a secure key for Homarr:
openssl rand -hex 32
- Launch the stack:
๐ ๏ธ 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.