Running temporary Home-Assistant on my laptop
Wanted to experiment a bit with Home-Assistant while travelling. And wanted to be able to run as much as possibly locally on the laptop instead of connecting to my home setup since network connectivity is not always reliable.
So here is a short summary how I set it up.
Docker Desktop
I already had Docker Desktop setup with a free Docker Personal account. If you do not have it setup already, download and install it.
HomeAssistant and MQTT
I found these two articles; Installing Docker, Home Assistant and Portainer on Ubuntu Linux and Configuring the Mosquitto MQTT Docker container for use with Home Assistant but they are dedicated to run Docker on Linux and since my laptop is a Mac I had to do some modifications.
Home Assistant
Create a folder on your laptop. I called mine home-assistant and then a number of subfolders in it:
mkdir home-assistant
cd home-assistant
mkdir homeassistant
mkdir homeassistant/config
Then run code docker-compose.yml
and add
version: '3.0'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- ./homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
restart: unless-stopped
privileged: true
ports:
- 8123:8123
Mosquitto
Optionally if you want to run Mosquitto for MQTT
mkdir mosquitto
mkdir mosquitto/data
mkdir mosquitto/logmkdir mosquitto/config
Then run code mosquitto/config/mosquitto.conf
and add
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
password_file /mosquitto/password_file
And add to docker-compose.yml
mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
volumes:
- ./mosquitto:/mosquitto
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
ports:
- 1883:1883
- 9001:9001
Start container/s
Then start the the container or containers with docker compose like
docker-compose up -d
Then visit localhost:8123 to create account and start using Home-Assistant