[Unit] Description=homeassistant After=network.target [Service] User=homeassistant Group=homeassistant EnvironmentFile=/etc/default/homeassistant ExecStartPre=python3 -m venv /var/lib/homeassistant/.venv ExecStartPre=/var/lib/homeassistant/.venv/bin/pip install -r /usr/share/homeassistant/requirements.txt ExecStartPre=/var/lib/homeassistant/.venv/bin/python3 /usr/share/homeassistant/manage.py migrate ExecStartPre=/var/lib/homeassistant/.venv/bin/python3 /usr/share/homeassistant/manage.py createcachetable ExecStart=/var/lib/homeassistant/.venv/bin/python3 /usr/share/homeassistant/manage.py runserver 0.0.0.0:8000 WorkingDirectory=/var/lib/homeassistant StandardOutput=inherit StandardError=inherit Restart=always [Install] WantedBy=multi-user.target