Skip to content

Instantly share code, notes, and snippets.

@mrpjevans
Last active November 30, 2021 16:39
Show Gist options
  • Save mrpjevans/c20e728c0dfd4cddc35a6e19e32d8381 to your computer and use it in GitHub Desktop.
Save mrpjevans/c20e728c0dfd4cddc35a6e19e32d8381 to your computer and use it in GitHub Desktop.
Install Home Assistant Core
Please run the following commands line-by-line, not as a script:
sudo apt -y update && sudo apt -y upgrade
sudo apt install -y python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0 tzdata
sudo useradd -rm homeassistant -G dialout,gpio,i2c
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
source bin/activate
python3 -m pip install wheel
sudo pip3 install homeassistant
To test everything is working:
hass
To run on boot:
sudo nano /usr/lib/systemd/hass.service
Add the following text (without the snips):
--SNIP--
[Unit]
Description=hass
[Service]
ExecStart=/srv/homeassistant/bin/hass
Restart=on-failure
User=homeassistant
Group=homeassistant
[Install]
WantedBy=multi-user.target
--SNIP--
To activate:
sudo systemctl enable /usr/lib/systemd/hass.service
sudo systemctl start hass.service
@jimcuk
Copy link

jimcuk commented Nov 22, 2021

Is there a line missing after wheel install
$ pip3 install homeassistant ?

@mrpjevans
Copy link
Author

Thanks. Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment