mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 16:27:19 +00:00
Update docker.markdown
This commit is contained in:
parent
185be375c5
commit
180ecac744
@ -11,19 +11,19 @@ Installation with Docker is straightforward. Adjust the following command so tha
|
||||
### Linux
|
||||
|
||||
```bash
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/New_York" -v /PATH_TO_YOUR_CONFIG:/config --net=host homeassistant/home-assistant
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/New_York" -v /PATH_TO_YOUR_CONFIG:/config --net=host homeassistant/home-assistant:stable
|
||||
```
|
||||
|
||||
### Raspberry Pi 3 (Raspbian)
|
||||
|
||||
```bash
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/New_York" -v /PATH_TO_YOUR_CONFIG:/config --net=host homeassistant/raspberrypi3-homeassistant
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/New_York" -v /PATH_TO_YOUR_CONFIG:/config --net=host homeassistant/raspberrypi3-homeassistant:stable
|
||||
```
|
||||
|
||||
You need to replace `/PATH_TO_YOUR_CONFIG` with your path to the configuration, for example if you choose your configuration path to be `/home/pi/homeassistant`, then command would be:
|
||||
|
||||
```bash
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/New_York" -v /home/pi/homeassistant:/config --net=host homeassistant/raspberrypi3-homeassistant
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/New_York" -v /home/pi/homeassistant:/config --net=host homeassistant/raspberrypi3-homeassistant:stable
|
||||
```
|
||||
|
||||
### macOS
|
||||
@ -33,7 +33,7 @@ When using `docker-ce` (or `boot2docker`) on macOS, you are unable to map the lo
|
||||
If you wish to browse directly to `http://localhost:8123` from your macOS host, meaning forward ports directly to the container, replace the `--net=host` switch with `-p 8123:8123`. More detail can be found in [the docker forums](https://forums.docker.com/t/should-docker-run-net-host-work/14215/10).
|
||||
|
||||
```bash
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/Los_Angeles" -v /PATH_TO_YOUR_CONFIG:/config -p 8123:8123 homeassistant/home-assistant
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/Los_Angeles" -v /PATH_TO_YOUR_CONFIG:/config -p 8123:8123 homeassistant/home-assistant:stable
|
||||
```
|
||||
|
||||
Alternatively, `docker-compose` works with any recent release of `docker-ce` on macOS. Note that (further down this page) we provide an example `docker-compose.yml` however it differs from the `docker run` example above. To make the .yml directives match, you would need to make _two_ changes: first add the equivalent `ports:` directive, then _remove_ the `network_mode: host` section. This is because `Port mapping is incompatible with network_mode: host:`. More details can be found at [Docker networking docs](https://docs.docker.com/engine/userguide/networking/#default-networks). Note also the `/dev/tty*` device name used by your Arduino etc. devices will differ from the Linux example, so the compose `mount:` may require updates.
|
||||
@ -41,7 +41,7 @@ Alternatively, `docker-compose` works with any recent release of `docker-ce` on
|
||||
### Windows
|
||||
|
||||
```powershell
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/Los_Angeles" -v /PATH_TO_YOUR_CONFIG:/config --net=host homeassistant/home-assistant
|
||||
$ docker run --init -d --name="home-assistant" -e "TZ=America/Los_Angeles" -v /PATH_TO_YOUR_CONFIG:/config --net=host homeassistant/home-assistant:stable
|
||||
```
|
||||
|
||||
When running Home Assistant in Docker on Windows, you may have some difficulty getting ports to map for routing (since the `--net=host` switch actually applies to the hypervisor's network interface). To get around this, you will need to add port proxy ipv4 rules to your local Windows machine, like so (Replacing '192.168.1.10' with whatever your Windows IP is, and '10.0.50.2' with whatever your Docker container's IP is):
|
||||
@ -91,7 +91,7 @@ Adjust the following Terminal command as follows :
|
||||
Run it in Terminal.
|
||||
|
||||
```bash
|
||||
sudo docker run --restart always -d --name="homeassistant" -v /PATH_TO_YOUR_CONFIG:/config --device=/PATH_TO_YOUR_USB_STICK -e TZ=Australia/Melbourne --net=host homeassistant/home-assistant
|
||||
sudo docker run --restart always -d --name="homeassistant" -v /PATH_TO_YOUR_CONFIG:/config --device=/PATH_TO_YOUR_USB_STICK -e TZ=Australia/Melbourne --net=host homeassistant/home-assistant:stable
|
||||
```
|
||||
|
||||
Complete the remainder of the Z-Wave configuration by [following the instructions here.](/docs/z-wave/installation)
|
||||
@ -148,7 +148,7 @@ If you want to use a USB Bluetooth adapter or Z-Wave USB stick with Home Assista
|
||||
The above command should show you any USB devices plugged into your NAS. If you have more than one, you may get multiple items returned. Like : `ttyACM0`
|
||||
|
||||
- Run Docker command:
|
||||
`docker run --init --name home-assistant --net=host --privileged -itd -v /share/CACHEDEV1_DATA/Public/homeassistant/config:/config -e variable=TZ -e value=Europe/London --device /dev/ttyACM0 homeassistant/home-assistant`
|
||||
`docker run --init --name home-assistant --net=host --privileged -itd -v /share/CACHEDEV1_DATA/Public/homeassistant/config:/config -e variable=TZ -e value=Europe/London --device /dev/ttyACM0 homeassistant/home-assistant:stable`
|
||||
|
||||
`-v` is your config path
|
||||
`-e` is set timezone
|
||||
@ -166,7 +166,7 @@ That will tell Home Assistant where to look for our Z-wave radio.
|
||||
|
||||
- Connect to your NAS over SSH
|
||||
- Run Docker command:
|
||||
`docker run --init --name home-assistant --net=host --privileged -itd -v /share/CACHEDEV1_DATA/Public/homeassistant/config:/config -e variable=TZ -e value=Europe/London -v /dev/bus/usb:/dev/bus/usb -v /var/run/dbus:/var/run/dbus homeassistant/home-assistant`
|
||||
`docker run --init --name home-assistant --net=host --privileged -itd -v /share/CACHEDEV1_DATA/Public/homeassistant/config:/config -e variable=TZ -e value=Europe/London -v /dev/bus/usb:/dev/bus/usb -v /var/run/dbus:/var/run/dbus homeassistant/home-assistant:stable`
|
||||
|
||||
First `-v` is your config path
|
||||
`-e` is set timezone
|
||||
@ -194,7 +194,7 @@ As the docker command becomes more complex, switching to `docker-compose` can be
|
||||
services:
|
||||
homeassistant:
|
||||
container_name: home-assistant
|
||||
image: homeassistant/home-assistant
|
||||
image: homeassistant/home-assistant:stable
|
||||
volumes:
|
||||
- /PATH_TO_YOUR_CONFIG:/config
|
||||
environment:
|
||||
@ -222,7 +222,7 @@ In order to use Z-Wave, Zigbee or other integrations that require access to devi
|
||||
```bash
|
||||
$ docker run --init -d --name="home-assistant" -v /PATH_TO_YOUR_CONFIG:/config \
|
||||
-e "TZ=Australia/Melbourne" --device /dev/ttyUSB0:/dev/ttyUSB0 \
|
||||
--net=host homeassistant/home-assistant
|
||||
--net=host homeassistant/home-assistant:stable
|
||||
```
|
||||
|
||||
or in a `docker-compose.yml` file:
|
||||
@ -232,7 +232,7 @@ or in a `docker-compose.yml` file:
|
||||
services:
|
||||
homeassistant:
|
||||
container_name: home-assistant
|
||||
image: homeassistant/home-assistant
|
||||
image: homeassistant/home-assistant:stable
|
||||
volumes:
|
||||
- /PATH_TO_YOUR_CONFIG:/config
|
||||
devices:
|
||||
|
Loading…
x
Reference in New Issue
Block a user