Make sure you have docker and dcker compose installed
docker --version
docker-compose --version
Create a docker-compose.yaml
file inside a relevant directory
mkdir homeassistant
cd homeassistant
sudo nano docker-compose.yaml
Paste and edit the configuration
version: '3'
services:
home-assistant:
container_name: home-assistant
image: ghcr.io/home-assistant/home-assistant:stable
volumes:
- ~/homeassistant:/config
environment:
- TZ=Europe/Rome
network_mode: host
restart: always
Create and spin the container
docker-compose up -d home-assistant
Visit the assistant web page:
http://[PI_IP]:8123
Create an account filling the form
cd ~/homeassistant
docker-compose pull home-assistant
docker-compose up --build -d home-assistant
docker image prune -f
Configure a new Proxy Host on Nginx Proxy Manager
Domain Names: homeassistant.[duckdns domain]
Scheme: http
Forward Hostname / IP: [raspberry ip]
Forward port: 8123
Block Common Exploits: true
Websockets Support: true
Force SSL: true
HTTP/2 Support: true
HSTS Enabled: true
On the raspberry edit the home assistant config file
sudo nano ~/homeassistant/configuration.yaml
And add the following code:
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24 # Leave this
- 172.X.X.X # Ip address of nginx docker container
Restart the container
docker restart home-assistant