Trying to install Home Assistant via Docker Compose, but I get this Error.
ERROR: The Compose file './docker-compose.yaml' is invalid because:
'homeassistant' does not match any of the regexes: '^x-'
You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
This is what I have in my docker-compose.yaml
version: '3.0'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /opt/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
Error appears when I run
docker-compose up -d
mwav3
(Tim)
December 28, 2022, 12:33am
2
I think your version should be 3.3. Indentation also looks off. This should work
version: '3.3'
services:
home-assistant:
container_name: homeassistant
volumes:
- '/opt/homeassistant/config:/config'
environment:
- TZ=America/New_York
restart: unless-stopped
network_mode: host
image: 'ghcr.io/home-assistant/home-assistant:stable'
Replace with your time zone from this list
This is a list of time zones from release 2022g of the tz database.
Standard Time (STD) and Daylight Saving Time (DST) offsets from UTC in hours and minutes.
For zones in which Daylight Saving is not observed, the DST offset shown in this table is a simple duplication of the STD offset.
The UTC offsets are based on the current or upcoming database rules. This table does not attempt to document any of the historical data which resides in the database.
Time zone abbreviations for both Standard ...
Thx 4 reply
Same error with your suggestion.
I followed this Linux - Home Assistant
Must be something I’m missing. Installed portainer the same way without any problems
My bad
Had a wrong indention in one line.
I had the same error and it took me a while to realise I had to indent the word homeassistant one step and it all worked