diff --git a/atom.xml b/atom.xml index 3c17cd4015..2d1881e33d 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
-Beginners should check our getting started guide first. +
If you alreacy have Python 3.5 or later installed, you can easily give Home Assistant a spin.
+It’s recommended when installing Python packages that you use a virtual environment. This will make sure that your Python installation and Home Assistant installation won’t impact one another.
+(If you’re on a Debian based system, you will need to install Python virtual environment support using apt-get install python3-pip python3-venv
)
python3 -m venv homeassistant
+
+ cd homeassistant
+
+ source bin/activate
+
+ python3 -m pip install --upgrade homeassistant
+
+ hass --open-ui
+
+ +Looking for more advanced guides? Check our available guides.
-There are several reasons why it makes sense to run Home Assistant in a virtual environment. A virtualenv encapsulates all aspect of a Python environment within a single directory tree. That means the Python packages you install for Home Assistant won’t interact with the rest of your system and vice-versa. It means a random upgrade for some other program on your computer won’t break Home Assistant, and it means you don’t need to install Python packages as root.
-Virtualenvs are pretty easy to setup. We’ll be using Debian in this example (as many Home Assistant users are running Raspbian on a Raspberry Pi), but all of the Python related steps should be the same on just about any platform.
-The basic guide is for testing Home Assistant. Also check the advanced guide for instances used in production.
-$ sudo apt-get update
-$ sudo apt-get upgrade
-$ sudo apt-get install python3-pip python3-dev python3-venv
-$ sudo pip3 install --upgrade virtualenv
-
-$ python3 -m venv $HOME/homeassistant
-
-$ source $HOME/homeassistant/bin/activate
-(homeassistant)$ pip3 install --upgrade homeassistant
-
-$ $HOME/homeassistant/bin/hass
-
-It’s a good idea to give services like Home Assistant their own user. It gives you more granular control over permissions, and reduces the exposure to the rest of your system in the event there is a security related bug in Home Assistant. This is a reasonably Linux oriented step, and will look different on other operating systems (or even other Linux distributions).
-$ sudo adduser --system homeassistant
-$ sudo addgroup homeassistant
-
-Home Assistant stores its configuration in $HOME/.homeassistant
by default, so in this case, it would be in /home/homeassistant/.homeassistant
.
If you plan to use a Z-Wave controller, you will need to add this user to the dialout
group:
$ sudo usermod -G dialout -a homeassistant
-
-This can be anywhere you want. We chose to put it in /srv
. You also need to change the ownership of the directory to the user you created above.
$ sudo mkdir /srv/homeassistant
-$ sudo chown homeassistant:homeassistant /srv/homeassistant
-$ python3 -m venv /srv/homeassistant
-
-This is obviously only necessary if you created a homeassistant
user, but if you did, be sure to switch to that user whenever you install things in your virtualenv, otherwise you’ll end up with mucked up permissions.
$ sudo su -s /bin/bash homeassistant
-
-The su
command means ‘switch’ user. We use the ‘-s’ flag because the homeassistant
user is a system user and doesn’t have a default shell by default (to prevent attackers from being able to log in as that user).
$ source /srv/homeassistant/bin/activate
-(homeassistant)$ pip3 install --upgrade homeassistant
-
-There are two ways to launch Home Assistant. If you are in the virtualenv, you can just run hass
and it will work as normal. If the virtualenv is not activated, you just use the hass
executable in the bin
directory mentioned earlier. There is one caveat… Because Home Assistant stores its configuration in the user’s home directory, we need to be the user homeassistant
or specify the configuration with -c
.
$ sudo -u homeassistant -H /srv/homeassistant/bin/hass
-
-The -H
flag is important. It sets the $HOME
environment variable to /home/homeassistant
so hass
can find its configuration.
The autostart instructions will work just fine, just be sure to replace /usr/bin/hass
with /srv/homeassistant/bin/hass
and specify the homeassistant
user where appropriate.