Best Home Assistant Docker Compose Template (2026)

Deploy Home Assistant Core via Docker Compose with host network mode for optimal smart home integration.

Welcome to the ultimate guide on setting up Home Assistant using Docker Compose. Deploy Home Assistant Core via Docker Compose with host network mode for optimal smart home integration.

Why Use This Setup?

Using Docker Compose ensures that your Home Assistant deployment is reproducible, easy to update, and perfectly isolated from your host system.

The docker-compose.yml

Copy the following highly optimized configuration:

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

Quick Start Guide

  1. Create a dedicated directory for Home Assistant on your server.
  2. Create a file named docker-compose.yml and paste the code above into it.
  3. Run the following command to spin up your container: docker compose up -d
  4. Access the Home Assistant web interface via your server’s IP address.

🚀 Need a reliable server for your self-hosted apps? We highly recommend deploying Docker containers on a high-performance VPS. Click here to get the best VPS for Docker with an exclusive discount!