Your smart home is probably a mess of apps — one for lights, one for the thermostat, another for cameras — each with its own account and cloud. Home Assistant fixes that: it pulls every device into one local hub, lets you automate across brands, and keeps your data in your own home instead of a dozen corporate clouds.
This guide shows you how to self-host Home Assistant with Docker. It’s one of the most satisfying projects you can run on a homelab.
What is Home Assistant?
Home Assistant (HA) is open-source home automation software. It connects to thousands of devices and services — lights, switches, sensors, cameras, thermostats, and more — and gives you one place to control and automate them all.
The key difference from commercial hubs: it runs locally, works with almost everything, and you own the data and the rules.
Why self-host your smart home?
- Local-first. Your automations keep working even if the internet drops.
- Private. No cloud company sees when your lights turn on.
- One hub for everything. Replace a dozen brand apps with a single dashboard.
- Powerful automations. Trigger anything from anything, with real logic.
What you need
- A mini PC, Raspberry Pi, or always-on server with Docker.
- Optional but common: a Zigbee or Z-Wave USB dongle for direct device control.
Step 1: Create the Docker Compose file
services:
homeassistant:
image: ghcr.io/home-assistant/home-assistant:stable
container_name: homeassistant
restart: always
ports:
- "8123:8123"
volumes:
- ./config:/config
environment:
- TZ=Asia/Ho_Chi_Minh
Step 2: Start it
docker compose up -d
Open http://your-server-ip:8123 and create your account.
Step 3: Add your devices
From the dashboard, add integrations — search for your brand (Philips Hue, Tuya, Sonoff, and hundreds more) and follow the prompts. For local-only control of Zigbee devices, plug in a Zigbee USB dongle and pass it through to the container.
Step 4: Build automations
This is where the magic happens. Automations are simple “when X, then Y” rules:
- “When motion is detected after dark, turn on the porch light.”
- “When I leave home, turn off all lights and lock the doors.”
- “When the temperature drops below 20°C, turn on the heater.”
You can chain conditions, delays, and multiple actions to build genuinely smart routines.
Dashboards and mobile app
Home Assistant ships a configurable dashboard, and there’s a polished mobile app for iOS and Android. Set up both and you’ll have your entire home in your pocket.
The local-protocol advantage (Zigbee and Z-Wave)
The real power of Home Assistant is local control. Many cloud-based smart devices route every command through a vendor’s server — slow, and useless when the internet drops. Zigbee and Z-Wave are different: they’re local radio protocols that talk directly to your hub.
Plug a Zigbee or Z-Wave USB dongle into your server, pass it through to the container, and your devices respond instantly with no cloud in the loop. For a smart home that keeps working during an outage, local protocols are the way to go.
Energy monitoring
If you have smart plugs or an energy meter, Home Assistant can track your whole home’s power consumption. The Energy dashboard shows usage over time, breaks it down per device, and even integrates solar and battery systems.
It’s a genuinely useful feature that turns a smart home from a novelty into a practical tool for understanding — and lowering — your electricity bill.
Backups and upgrades
Home Assistant updates frequently, and automations are easy to accidentally break. Two habits will save you:
- Back up the config folder regularly — it holds every automation, dashboard, and setting.
- Snapshot before upgrading — if an update breaks something, you can roll back in minutes.
The config is plain text under the hood, so a simple folder copy is a complete backup.
The HACS community store
Home Assistant has a huge official integration catalog, but the community goes further. HACS (Home Assistant Community Store) adds thousands of extra integrations, cards, and themes that aren’t in the official list.
Installing HACS takes a few minutes — it’s a single integration you add once. After that, you get a community catalog inside the dashboard, installable in one click. It’s how most people add the long tail of niche devices and beautiful dashboard themes.
Integrations to start with
When you’re just getting going, a few integrations give you instant value:
- Your router — presence detection (who’s home) based on Wi-Fi.
- A weather service — power automations based on conditions.
- Your lights and switches — the core of most automations.
- A media player — control playback from the same dashboard.
Start small: add your lights first, build one automation, then expand. A smart home is grown, not built in a weekend.
Common mistakes to avoid
- Exposing it to the internet directly — use Tailscale or a reverse proxy with HTTPS instead.
- Skipping backups — the
configfolder holds all your automations. Back it up. - Going overboard on day one — start with a few devices and grow gradually.
FAQ
Does Home Assistant work without internet?
Yes — that’s the point. Local integrations and automations run entirely on your server.
Do I need a Zigbee dongle?
Not necessarily. Many devices connect over Wi-Fi or through brand-specific hubs. A dongle helps for direct Zigbee/Z-Wave control.
Can Home Assistant run on a Raspberry Pi?
Yes, it’s a popular choice. A Raspberry Pi 4 with an SSD runs a modest smart home comfortably.
The bottom line
Home Assistant turns a jumble of smart devices into one private, local, and genuinely smart home. It’s free, runs beautifully in Docker, and — like every other self-hosting project — it puts you back in control of your own data.