Yazan Daradkeh

Senior Digital Project/Product Manager

Under the Hood: Powering Home Assistant with Docker on a Raspberry Pi 4

Under the Hood: Powering Home Assistant with Docker on a Raspberry Pi 4

If you are fair dinkum about taking your home lab to the next level, ditching the standard Home Assistant OS for a Docker-based installation is a bloody smart move. By containerizing your smart home brain, you get unparalleled flexibility and keep your host operating system completely clean. For my own setup, I run Home Assistant via a Docker installation on a Raspberry Pi 4, utilizing the default SqLite database. To make sure it can handle whatever I throw at it, this Pi is absolutely stacked with 8G of RAM and a 512G SSD. Accessing the system securely from anywhere in the outback—or the world—is crucial, so it is cloudflared at home.yazan.me. For secure backend management, SSH access is tailscaled at ssh.home.yazan.me.

The beauty of Docker is that you are not just limited to Home Assistant. On the exact same Raspberry Pi 4, I am also running ESPHome, which is cloudflared at esphome.yazan.me. Alongside that, I have Music Assistant running on the same board, cloudflared at music.yazan.me. By using a YAML configuration file, spinning up this entire ecosystem takes just a few lines of code. Here is a basic example of how you can structure your compose file to get Home Assistant up and running:

version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /path/to/your/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
network_mode: host

Just fire up that config with a simple command, and you will be sorted in no time:

docker compose up -d

Having everything neatly organized in containers makes updates an absolute breeze, ensuring your unified smart home never misses a beat.

"If you've got any questions or need a hand wrangling your own setup, don't hesitate to reach out at [email protected] or connect with me via www.yazan.me. I'm always keen to help out!"