TypechoJoeTheme

Jim Tse

【Home Assistant】Docker 安装 Home Assistant

本文最后更新于2024年04月09日,已超过163天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!

首先安装docker

sudo curl -sSL https://get.docker.com | sh

HA安装方法一 docker直接拉取

使用docker拉取Home Assistant镜像

docker pull homeassistant/home-assistant

部署Home Assistant容器

docker run -d --name="home-assistants" -v /Users/tse/HomeAssistant:/config -p 8123:8123 homeassistant/home-assistant

HA安装方法二 docker-compose

创建文件夹home-assistant进去编写docker-compose.yml

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /home-assistant:/config #home-assistant为docker-compose.yml文件所在目录
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host
    ports:
      - 8123:8123

保存文件后,运行docker-compose

docker compose up -d

最后访问localhost:8123

赞(0)
版权属于:

Jim Tse

本文链接:

https://jimtse.eu.org:88/program/home-assistant.html(转载时请注明本文出处及文章链接)

评论 (0)