How to start HA if Raspberry PI is rebooted

Hi guys,

A silly question, I installed HA following manual installation.

I did some changes to the yaml config and wanted to restart the service, which I was not able to do.
[email protected]:~ $ sudo service hass-daemon restart
Failed to restart hass-daemon.service: Unit hass-daemon.service not found.
[email protected]:~ $ sudo systemctl restart home-assistant.service
Failed to restart home-assistant.service: Unit home-assistant.service not found.
[email protected]:~ $

So I decided to reboot raspberry and now I cannot understand how to start HA after pi is rebooted.

This commands helped me, but looks like it just reinstalled or reset the config file:
$ sudo su -s /bin/bash homeassistant
$ cd /srv/homeassistant
$ python3 -m venv .
$ source bin/activate
(homeassistant) $ hass

I am a complete noob in linux and feels like I am doing something wrong. Can you give me a hint please, how to restart HA and how to start it if pi is rebooted.

you can use this one:
sudo systemctl start homeassistant.service on ssytemd enabled linux and if used the AIO to install HA.

IMO you’re better off with either the All In One, or Hassbian installs if you’re new to Linux.

That said, place the following in /etc/systemd/system/ and call it home-assistant.service (you’ll need to use sudo to create and edit files there). If you don’t have your HA configuration files in /home/homeassistant/.homeassistant then change that path as appropriate.

Description=Home Assistant

ExecStart=/srv/homeassistant/venv/bin/hass -c "/home/homeassistant/.homeassistant"


Once you’ve done that, run the following commands:

sudo systemctl daemon-reload
sudo systemctl enable home-assistant
sudo systemctl start home-assistant

The documented instructions are here

Hi @Tinkerer. I notice your script varies from the one provided in the link from @gpbenton (from the HA docs) in the following ways:

  1. instead of
  2. ExecStart=/srv/homeassistant/venv/bin/hass instead of ExecStart=/srv/homeassistant/bin/hass

Can you explain these differences? Not too familiar with systemd and trying to figure out how to set this up.

The second is the easy one to explain - mine’s in a different location. I have multiple virtual environments, so that I can test out things like Python upgrades safely and easily.

The first is more complicated, but very (very) briefly:

  • the network stack exists
  • … and the network interfaces are configured

Of course, you’re asking about something from two years ago - these days I use

Glad you’re still around two years later to help me out. Thanks!

1 Like