Home Assistant is a powerful open-source home automation platform that allows you to control smart devices, automate tasks, and monitor your home environment. Running Home Assistant in Docker on Linux provides flexibility, easy updates, and isolation from the host system. This guide walks you through installing Home Assistant in a Docker container on a Linux machine.

  1. Prerequisites
  2. How to install Docker?
  3. Create a Docker Compose File
  4. Start Home Assistant
  5. Initial Configuration

Prerequisites

Before you begin, ensure you have:

  • A Linux system (Ubuntu, Debian, or any other distribution with Docker support)
  • Docker and Docker Compose installed (see next section)
  • Basic command-line knowledge

How to install Docker?

For detailed instructions and troubleshooting, see the official Docker Engine installation guide for:

Create a Docker Compose File

  1. Create a directory for Home Assistant:
    mkdir -p ~/homeassistant && cd ~/homeassistant
  2. Create and edit the compose.yml file:
    nano compose.yml
  3. Paste the following configuration into the file:
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - ./config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

Save and exit the file (CTRL + X, then Y, then Enter)

This configuration pulls the latest stable Home Assistant image, mounts a local directory for persistent configuration data, and uses host networking for easier device integration.

Start Home Assistant

  1. Start the Home Assistant container:
    docker compose up -d
  2. Verify that the container is running:
    docker ps
  3. Access Home Assistant in your web browser at:
    http://your-server-ip:8123

Initial Configuration

When you first access Home Assistant, you’ll be prompted to create an account. Follow the setup wizard to configure your home automation settings. You can later add integrations and customize your dashboard from the Home Assistant UI.

Rate this post

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *