docker.recipes

Home Assistant

beginner

Open-source home automation platform that puts local control and privacy first, supporting thousands of devices and integrations.

Overview

Home Assistant is a powerful open-source home automation platform that emerged in 2013 to address the fragmented smart home ecosystem by providing unified control over diverse IoT devices while prioritizing local control and user privacy. Unlike cloud-dependent solutions, Home Assistant runs entirely on your local network, supporting over 2000 integrations including popular protocols like Zigbee, Z-Wave, WiFi, and Bluetooth devices from manufacturers ranging from Philips Hue to Tesla. This Docker deployment leverages Home Assistant's containerized distribution to simplify installation and maintenance while maintaining full functionality. The configuration uses host networking mode to enable automatic device discovery across your local network, essential for protocols like mDNS and SSDP that many smart home devices rely on for initial setup. The persistent configuration volume ensures your automations, dashboards, and device settings survive container updates. This setup is ideal for smart home enthusiasts who want comprehensive device integration without vendor lock-in, privacy-conscious users seeking local control over their automation data, and homelab operators building sophisticated home automation systems. Home Assistant's visual automation editor, customizable dashboards, and extensive add-on ecosystem make it accessible to beginners while offering the depth that advanced users demand for complex multi-room automation scenarios.

Key Features

  • 2000+ device integrations including Zigbee, Z-Wave, WiFi, and Bluetooth protocols
  • Visual automation editor with triggers, conditions, and actions for complex scenarios
  • Customizable Lovelace dashboards with drag-and-drop interface and custom cards
  • Built-in energy monitoring and management with solar panel and battery support
  • Voice assistant integration with Google Assistant, Alexa, and native Assist
  • Mobile companion apps with GPS tracking, notifications, and remote control
  • Add-on supervisor system for extending functionality with additional services
  • Advanced templating engine using Jinja2 for dynamic automations and sensors

Common Use Cases

  • 1Unified smart home control consolidating devices from multiple manufacturers
  • 2Privacy-focused home automation without cloud dependencies or data sharing
  • 3Complex multi-room lighting and climate control with occupancy-based automation
  • 4Home security systems with camera integration, motion detection, and notifications
  • 5Energy management and monitoring for solar installations and smart appliances
  • 6Elderly or accessibility assistance with voice control and automated daily routines
  • 7Homelab integration connecting home automation with network monitoring and media servers

Prerequisites

  • Minimum 1GB RAM recommended, 2GB+ for extensive integrations and add-ons
  • Port 8123 available for web interface access
  • USB device access if using Zigbee or Z-Wave controllers
  • Host networking capability for automatic device discovery and mDNS protocols
  • Basic understanding of YAML configuration for advanced customization
  • Familiarity with smart home protocols (Zigbee, Z-Wave, WiFi) for device integration

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 homeassistant:
3 image: ghcr.io/home-assistant/home-assistant:stable
4 container_name: homeassistant
5 restart: unless-stopped
6 privileged: true
7 network_mode: host
8 volumes:
9 - ./config:/config
10 - /etc/localtime:/etc/localtime:ro
11 - /run/dbus:/run/dbus:ro
12 environment:
13 - TZ=${TZ:-UTC}
14
15# Alternative without host network mode:
16# services:
17# homeassistant:
18# image: ghcr.io/home-assistant/home-assistant:stable
19# container_name: homeassistant
20# restart: unless-stopped
21# volumes:
22# - ./config:/config
23# - /etc/localtime:/etc/localtime:ro
24# ports:
25# - "8123:8123"
26# environment:
27# - TZ=${TZ:-UTC}

.env Template

.env
1# Home Assistant Configuration
2TZ=Europe/London
3
4# Note: Home Assistant uses network_mode: host by default
5# This allows auto-discovery of devices on your network
6# If you don't need auto-discovery, use the alternative config with ports

Usage Notes

  1. 1Access at http://localhost:8123 (or your server IP)
  2. 2First-time setup will create an admin account
  3. 3Uses host network mode for device auto-discovery
  4. 4Add integrations via Settings > Devices & Services
  5. 5For Zigbee/Z-Wave, add USB device passthrough

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 homeassistant:
5 image: ghcr.io/home-assistant/home-assistant:stable
6 container_name: homeassistant
7 restart: unless-stopped
8 privileged: true
9 network_mode: host
10 volumes:
11 - ./config:/config
12 - /etc/localtime:/etc/localtime:ro
13 - /run/dbus:/run/dbus:ro
14 environment:
15 - TZ=${TZ:-UTC}
16
17# Alternative without host network mode:
18# services:
19# homeassistant:
20# image: ghcr.io/home-assistant/home-assistant:stable
21# container_name: homeassistant
22# restart: unless-stopped
23# volumes:
24# - ./config:/config
25# - /etc/localtime:/etc/localtime:ro
26# ports:
27# - "8123:8123"
28# environment:
29# - TZ=${TZ:-UTC}
30EOF
31
32# 2. Create the .env file
33cat > .env << 'EOF'
34# Home Assistant Configuration
35TZ=Europe/London
36
37# Note: Home Assistant uses network_mode: host by default
38# This allows auto-discovery of devices on your network
39# If you don't need auto-discovery, use the alternative config with ports
40EOF
41
42# 3. Start the services
43docker compose up -d
44
45# 4. View logs
46docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/home-assistant/run | bash

Troubleshooting

  • Device discovery not working: Ensure host network mode is enabled or configure device IPs manually in bridge mode
  • USB Zigbee/Z-Wave stick not detected: Add device mapping with --device /dev/ttyUSB0:/dev/ttyUSB0 in Docker run command
  • Configuration.yaml syntax errors: Use Home Assistant's built-in configuration checker before restarting
  • Integrations failing after updates: Clear browser cache and check integration compatibility with current HA version
  • High CPU usage: Disable recorder for unnecessary entities and adjust history purge settings
  • Add-ons not appearing: Enable Advanced Mode in user profile and ensure Supervisor is running properly

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space