
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.
- Prerequisites
- How to install Docker?
- Create a Docker Compose File
- Start Home Assistant
- 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
- Create a directory for Home Assistant:
mkdir -p ~/homeassistant && cd ~/homeassistant
- Create and edit the
compose.yml
file:nano compose.yml
- 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
- Start the Home Assistant container:
docker compose up -d
- Verify that the container is running:
docker ps
- 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.
0 Comments