You just won the lottery. How do you build the most stable HA server?

@afreelan

Step by step, because I’m sat at work bored so may as well…

(Assumes you have a privileged user, and an unprivileged account called homeassistant upon which you run your instance, and that the venv is located at /srv/homeassistant)

STOP HOMEASSISTANT FIRST

Starting as privileged user…

sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev

wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar xzvf Python-3.6.4.tgz
cd Python-3.6.4/
./configure
make
sudo make install

Make tea

cd /srv/homeassistant 
sudo rm *
cd .. 
sudo chown homeassistant:homeassistant homeassistant
sudo su -s /bin/bash homeassistant
cd
mv .homeassistant/ .homeassistant_backup
cd /srv/homeassistant
python3.6 -m venv .
source bin/activate
pip3 install homeassistant
hass

Wait a minute, press ctrl + c

deactivate 
cd .homeassistant 
rm *
cd .. 
mv .homeassistant_backup/* .homeassistant/
exit
sudo reboot 

Presuming your autostart service was working before and we’ve installed everything back to the exact same place should be back up and running pretty sharpish. Remember that when it restarts it will be downloading all the requirements and dependencies specific to your installation so it may take a while.

Hope this helps.

8 Likes