# How to install Home Assistant on a Raspberry Pi - 1/6/2025
sudo apt update && sudo apt upgrade -y
sudo apt install -y python3 python3-venv python3-pip libffi-dev libssl-dev autoconf build-essential \
libjpeg-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev git
sudo -u homeassistant -H bash
sudo useradd -rm homeassistant -G dialout,gpio,i2c
rm -Rf /srv/homeassistant/
python -VV
python -m venv /srv/homeassistant
source /srv/homeassistant/bin/activate
pip install wheel
pip install homeassistant
pip install --upgrade pip
# set up autostart
exit
sudo nano /etc/systemd/system/home-assistant.service
# contents:
[Unit]
Description=Home Assistant
After=network.target
[Service]
Type=simple
User=homeassistant
WorkingDirectory=/home/homeassistant/.homeassistant
ExecStart=/srv/homeassistant/bin/python3 -m homeassistant --config /home/homeassistant/.homeassistant
Restart=always
RestartSec=10
Environment="PATH=/home/homeassistant/.virtualenv/bin:/usr/bin:/bin"
Environment="VIRTUAL_ENV=/srv/homeassistant"
[Install]
WantedBy=multi-user.target
#
sudo systemctl daemon-reload
sudo systemctl enable home-assistant.service
sudo systemctl start home-assistant.service
sudo systemctl status home-assistant.service
tail -F /home/homeassistant/.homeassistant/home-assistant.log