mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Fix title
This commit is contained in:
parent
92344f1833
commit
9532732c81
@ -13,7 +13,7 @@ There are several reasons why it makes sense to run Home Assistant in a virtual
|
||||
|
||||
Virtualenvs are pretty easy to setup. This example will walk through one method of setting one up (there are certainly others). 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.
|
||||
|
||||
## {% linkable_title Step 0: Install some dependencies %}
|
||||
### {% linkable_title Step 0: Install some dependencies %}
|
||||
|
||||
```bash
|
||||
$ sudo apt-get update
|
||||
@ -22,7 +22,7 @@ $ sudo apt-get install python-pip python3-dev
|
||||
$ sudo pip install --upgrade virtualenv
|
||||
```
|
||||
|
||||
## {% linkable_title Step 1: Create a Home Assistant user %}
|
||||
### {% linkable_title Step 1: Create a Home Assistant user %}
|
||||
|
||||
This step is optional, but 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).
|
||||
|
||||
@ -38,7 +38,7 @@ If you plan to use a Z-Wave controller, you will need to add this user to the `d
|
||||
$ sudo usermod -G dialout -a hass
|
||||
```
|
||||
|
||||
## {% linkable_title Step 2: Create a directory for Home Assistant %}
|
||||
### {% linkable_title Step 2: Create a directory for Home Assistant %}
|
||||
|
||||
This can be anywhere you want. AS example we put it in `/srv`. You also need to change the ownership of the directory to the user you created above (if you created one).
|
||||
|
||||
@ -46,7 +46,8 @@ This can be anywhere you want. AS example we put it in `/srv`. You also need to
|
||||
$ sudo mkdir /srv/hass
|
||||
$ sudo chown hass /srv/hass
|
||||
```
|
||||
## {% linkable_title Step 3: Become the new user %}
|
||||
|
||||
### {% linkable_title Step 3: Become the new user %}
|
||||
|
||||
This is obviously only necessary if you created a `hass` 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.
|
||||
|
||||
@ -56,7 +57,7 @@ $ sudo su -s /bin/bash hass
|
||||
|
||||
The `su` command means 'switch' user. We use the '-s' flag because the `hass` 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).
|
||||
|
||||
## {% linkable_title Step 4: Set up the virtualenv %}
|
||||
### {% linkable_title Step 4: Set up the virtualenv %}
|
||||
|
||||
All this step does is stick a Python environment in the directory we're using. That's it. It's just a directory. There's nothing 'special' about it, and it is entirely self-contained.
|
||||
|
||||
@ -74,7 +75,7 @@ $ source /srv/hass/bin/activate
|
||||
|
||||
After that, your prompt should include `(hass)`.
|
||||
|
||||
## {% linkable_title Step 6: Install Home Assistant %}
|
||||
### {% linkable_title Step 6: Install Home Assistant %}
|
||||
|
||||
Once your virtualenv has been activated, you don't need to `sudo` any of your `pip` commands. `pip` will be installing things in the virtualenv, which the `hass` user has permission to modify.
|
||||
|
||||
@ -84,7 +85,7 @@ Once your virtualenv has been activated, you don't need to `sudo` any of your `p
|
||||
|
||||
And that's it... you now have Home Assistant installed, and you can be sure that every bit of it is contained in `/srv/hass`.
|
||||
|
||||
## {% linkable_title Finally... Run Home Assistant %}
|
||||
### {% linkable_title Finally... Run Home Assistant %}
|
||||
|
||||
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 it's configuration in the user's home directory, we need to be the user `hass` user or specify the configuration with `-c`.
|
||||
|
||||
@ -94,15 +95,15 @@ $ sudo -u hass -H /srv/hass/bin/hass
|
||||
|
||||
The `-H` flag is important. It sets the `$HOME` environment variable to `/home/hass` so `hass` can find its configuration.
|
||||
|
||||
## {% linkable_title Upgrading Home Assistant %}
|
||||
### {% linkable_title Upgrading Home Assistant %}
|
||||
|
||||
Upgrading Home Assistant is simple, just repeat steps 3, 5 and 6.
|
||||
|
||||
## {% linkable_title Starting Home Assistant on boot %}
|
||||
### {% linkable_title Starting Home Assistant on boot %}
|
||||
|
||||
The [autostart instructions](/getting-started/autostart/) will work just fine, just be sure to replace `/usr/bin/hass` with `/srv/hass/bin/hass` and specify the `hass` user where appropriate.
|
||||
|
||||
## {% linkable_title Installing python-openzwave %}
|
||||
### {% linkable_title Installing python-openzwave %}
|
||||
|
||||
If you want to use Z-Wave devices, you will need to install `python-openzwave` in your virtualenv. This requires a small tweak to the instructions on home-assistant.io
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user