Why Self-Host Home Automation with Home Assistant on Docker
Home Assistant is the leading open-source home automation platform, integrating over 2,000 devices and services into a single privacy-focused dashboard. Running it locally means your lights, sensors, and automations keep working even when your internet goes down — no cloud dependency, no subscription fees, no data leaving your network.
Home Assistant Installation Methods Compared
Home Assistant offers several installation paths:
| Method | Pros | Cons | Best For |
|---|---|---|---|
| Home Assistant OS | Full supervisor, add-ons, OTA updates | Heavy VM, less flexible | Plug-and-play users |
| Home Assistant Supervised | Add-ons on existing OS | Complex setup, fragile | Advanced OS users |
| Home Assistant Core (Docker) | Lightweight, full control, easy backups | Manual add-on management | Homelab operators |
| Home Assistant Container | Pre-packaged Docker image | Same as Core | Docker-first setups |
For a Proxmox homelab where you already run Docker, Home Assistant Core in Docker is the sweet spot. You get:
- Minimal resource footprint (~500 MB RAM at idle)
- Complete control over the stack (MQTT, Zigbee2MQTT, backups)
- Easy migration and version pinning via Docker tags
- Integration with your existing Traefik, monitoring, and backup infrastructure
Architecture Overview
The stack runs in a single Docker Compose project on a Debian 12 VM or LXC container:
Internet → Traefik (SSL) → Home Assistant (port 8123)
├── Mosquitto (MQTT broker, port 1883)
├── Zigbee2MQTT (serial via USB)
└── Code Server (optional — config editor)
Hardware Requirements
- VM/LXC: 2 vCPUs, 2 GB RAM, 20 GB disk (Debian 12)
- Zigbee Coordinator: Sonoff Zigbee 3.0 USB dongle (CC2652P) or Conbee II
- Network: Static IP on your management VLAN
Proxmox VM Prerequisites for Home Assistant Docker
Create the Debian 12 VM
On your Proxmox host, create a lightweight VM:
|
|
Alternatively, use an LXC container for lighter overhead (no separate kernel):
|
|
Enable USB Passthrough for Zigbee Coordinator
If using a VM, attach the USB Zigbee dongle:
|
|
For an LXC container, bind-mount the USB device:
|
|
Install Docker on the VM/LXC
SSH into the new VM/LXC and install Docker:
|
|
Docker Compose Configuration for Home Assistant Stack
Create the project directory and files:
|
|
Create docker-compose.yml:
|
|
Expose Home Assistant and Mosquitto only on localhost — Traefik handles external access. Zigbee2MQTT does not need port exposure.
Mosquitto MQTT Broker Setup for Home Automation
Create the Mosquitto configuration:
|
|
Create /opt/homeassistant/mqtt/config/mosquitto.conf:
|
|
Create MQTT users:
|
|
Restart Mosquitto to load the config:
|
|
Zigbee2MQTT Docker Integration with USB Passthrough
Zigbee2MQTT bridges your Zigbee coordinator to MQTT, allowing Home Assistant to control all Zigbee devices through a single integration.
Create /opt/homeassistant/zigbee2mqtt/data/configuration.yaml:
|
|
Generate the network key and PAN ID:
|
|
Replace GENERATE_ME in the configuration with your generated values. The channel setting should match the least congested 2.4 GHz channel in your environment. Channels 15, 20, and 25 are preferred because they avoid common Wi-Fi channels (1, 6, 11).
Pairing Zigbee Devices
To pair a new device, temporarily enable joining:
|
|
Or set permit_join: true in the configuration, pair your devices, then set it back to false. Never leave permit_join enabled permanently — it is a security risk.
Verify devices appear via MQTT:
|
|
Home Assistant Core Configuration and Integrations
Home Assistant auto-generates a basic configuration.yaml on first launch. Start the stack to initialize it:
|
|
Wait for the log to show:
Home Assistant Core is running! Listening on http://0.0.0.0:8123
Access the VM IP on port 8123 (or via Traefik once configured). Complete the initial onboarding — create your user account, set your location, and name your home.
Adding Integrations
From the Home Assistant web UI, navigate to Settings → Devices & Services → Add Integration:
- MQTT — Click configure, enter
mosquittoas broker, port1883, usernamehass, and the MQTT password. No SSL needed since Mosquitto binds to localhost. - Zigbee2MQTT — Search and add. It auto-discovers via MQTT topics. All paired Zigbee devices appear automatically.
Essential configuration.yaml Additions
Over time, add these to /opt/homeassistant/config/configuration.yaml:
|
|
Using Secrets
Create /opt/homeassistant/config/secrets.yaml to keep sensitive values out of configuration.yaml:
|
|
Home Assistant’s !env_var directive reads environment variables from the Docker container. Set them under environment: in the compose file.
Traefik Reverse Proxy Configuration for Home Assistant
Add Traefik labels to the homeassistant service in docker-compose.yml:
|
|
If using a Traefik dynamic config file instead:
|
|
Add an external network to the compose file so Traefik and Home Assistant can communicate:
|
|
The http.use_x_forwarded_for and trusted_proxies settings in configuration.yaml ensure Home Assistant sees the real client IP behind Traefik.
Home Assistant Backup Automation and Recovery
Use Home Assistant’s supported backup workflow
Use the installed release’s Backup integration and recovery documentation. Current releases provide backup configuration through the UI across installation types. Check the capabilities of the older image used elsewhere in this historical deployment example before following current UI steps.
Create a backup, save an independent copy, and retain the encryption/recovery materials outside this host. Record which Home Assistant data is included. Separate Compose services such as MQTT and Zigbee2MQTT need their own configuration and data recovery plan; a Home Assistant backup does not automatically include every adjacent container.
The previous script paused the stack and then attempted exec into a paused container. It also excluded authentication state and copied a SQLite database without establishing a complete database recovery point. That procedure and its timer are removed. Do not extract a database file over a running Home Assistant instance or remove volumes to prepare a restore.
Test restoration in a separate instance with fresh storage and device/network isolation. Prevent the test from issuing real automations, MQTT commands, or duplicate radio/network identities. Verify login, configuration, history as required, integrations, and attachments. Keep the original data until the recovery test and any planned cutover succeed.
For ordinary prepared files, the Restic recovery lab demonstrates encrypted copies. It does not by itself validate a Home Assistant or SQLite backup. This source revision does not claim a new Home Assistant runtime restore test.
Docker Image Updates with Watchtower
Add Watchtower to monitor the Home Assistant Docker images:
|
|
Tag your compose services with com.centurylinklabs.watchtower.scope=hass-stack to scope updates:
|
|
Conclusion
Running Home Assistant Core with Docker on Proxmox gives you a production-grade home automation stack that is fully local, fully under your control, and easy to maintain alongside your other homelab services.
The stack cost:
- 2 vCPUs, ~1.5 GB RAM at idle (with Zigbee2MQTT and Mosquitto)
- 4 Docker containers, all on a single bridge network
- Zero cloud dependency for core functionality
From here, explore:
- Energy dashboard — connect Shelly or Zigbee energy monitoring plugs
- Local voice pipeline — run Whisper + Piper for fully offline voice control
- ESPHome — flash ESP32/ESP8266 devices as custom sensors and relays
- Node-RED — visual automation flows beyond Home Assistant’s built-in automations
For official documentation, visit home-assistant.io and the Zigbee2MQTT docs.