Home Assistant (Docker) - uthomelabs/guides GitHub Wiki
The following instructions assume you have a host ready to run Docker containers. Please see: https://docs.docker.com/get-docker/ for instructions on setting up your docker host. In the following sections be sure to replace the following placeholder values with values that match your system:
Placeholder | Example | Description |
---|---|---|
PATH_TO_YOUR_CONFIG |
${PWD}/homeassistant/config |
This points to the folder where you want your configuration to live on the host disk |
MY_TIMEZONE |
America/Denver |
TZ database name |
Installation with Docker is pretty straight-forward. Just run the following command (replacing the noted placeholders):
docker run -d \
--name homeassistant \
--privileged \
--network=host \
--restart=unless-stopped \
-e TZ=<MY_TIMEZONE> \
-v <PATH_TO_YOUR_CONFIG>:/config \
ghcr.io/home-assistant/home-assistant:stable
It is often really nice to use Compose for Docker services because it makes it super easy to manage a set of related services, tear things down and bring them back up again, update containers with new image versions, etc. To run Home Assistant with Docker Compose make sure you have the plugin installed (check with docker compose --version
to see that it is set up correctly) and then set up a location to run it from and a docker-compose.yml
file:
# Make a place to work from
mkdir lab-guides && cd lab-guides
# Make the needed paths
mkdir -p homeassistant/config
vim docker-compose.yml # or another editor if you prefer :D
docker-compose.yml
services:
homeassistant:
image: "ghcr.io/home-assistant/home-assistant:stable"
container_name: "homeassistant"
privileged: true
network_mode: "host"
environment:
TZ: "<MY_TIMEZONE>"
volumes:
- <PATH_TO_YOUR_CONFIG>:/config
restart: "unless-stopped"
Once the Home Assistant container is running Home Assistant should be accessible using http://<host>:8123
(replace with the hostname or IP of the system). You can continue with onboarding.