How to change location of Hassio docker config files?

I’m dipping my toes into installing Hassio onto my NUC just to get a feel for how it works compared to non-hassio installs.

But I’d like to keep all of my docker related config files in the same directory in their own sub-directory.

I did a test install on my old Pi that is setup with Raspbian and a manual docker install using the setup script in the “alternative install” section. And when it installs the default config files they are located at '/usr/share/hassio/homeassistant". I’d like to alternatively locate them in a different directory - “/home/finity/docker/hassio”

Is there an easy way to do that?

When you run the script, specify a path with -d /path/to/directory

Or you can simply modify the script before running it, or modify the service that gets created.

It looks like I’ll try to run the script again with the path option.

I looked at the script to try to figure out where it specified where to put the files but there’s a lot going on in there and it wasn’t obvious with all of the variables how it was determining which directory to store stuff in.

Thanks for the help.

I’ll let you know how it turns out. :slightly_smiling_face:

PREFIX=${PREFIX:-/usr}
SYSCONFDIR=${SYSCONFDIR:-/etc}
DATA_SHARE=${DATA_SHARE:-$PREFIX/share/hassio}
CONFIG=$SYSCONFDIR/hassio.json

Thanks for that.

I looked all through that and didn’t see that needle in the haystack.

I tried using the “-d path” method and wasn’t having any success.

Once I modified the install script it worked great.

In case anybody else wants to do this and finds this later, this is what I did:

go to the link for the installer script at:

https://github.com/home-assistant/hassio-installer/blob/cbae7bc68adcec26b2a1eafd8849d25c0354e2f5/hassio_install.sh

then click the “raw” button.

Copy all of the info there and paste into a text file.

Modify the following line (line 68 at the time of this writing) to the path where you want to install the config files:

DATA_SHARE=${DATA_SHARE:-/home/pi/docker/hassio}

Then save that text file wherever you find convenient as whatever file name you want with the file extension".sh". I saved mine as install-hassio.sh.

Then you need to make that file executable:

chmod +x /path/<filename>.sh

Perform the rest of previous steps at:

https://www.home-assistant.io/hassio/installation/#arch-linux

but after you run “sudo -i” change to the directory where you stored the modified install script:

cd /path/to/file

then run the file (for installing on a RPi3):

./install-hassio.sh -m raspberrypi3

you will see a few lines of code executing.

The modifications above will force the install of the configuration files to the /home/pi/docker/hassio directory and you will end up with the following directory structure there:

ex

The config files will be stored in the “homeassistant” directory.

Navigate to the IP of your machine port:8123 and complete the initial configuration.

While we’re here…

Now that I’ve got a squeaky clean hassio running how do I do a downgrade to a previous version?

My running system currently is on v96.3 and I’d like to get everything running and stable in Hassio with that version before possibly fighting an update along with the migration.

hassio ha update --version 0.96.3

I tried that and got a “hassio: command not found”

You need to be in the hassio container or ssh add-on. It doesn’t work from the host because the host doesn’t know what hassio is.

Oh, ok.

I thought maybe the install script might have added some “hassio” scripts to the host.

I’ll give it a try.

Thanks again.

The install script doesn’t do anything but add the necessary services, and start the supervisor.

It’s all in the script. :wink:

1 Like