Www folder location for /local documents

Hi

I’ve installed Hass.io on my Raspberry Pi 3 and I like it so far.
My instance is configured with HTTPS using Let’s Encrypt.

I’m trying to put some static documents (images) on it to be served by the http(s) server.
I’m not sure where the www folder should be. Documentation states it should be in the .homeassistant configuration folder but there is no .homeassistant folder with Hass.io. I tried to dump it in the /config folder (/config/www) but no joy.

Any advise?

Cheers

3 Likes

You ever figure this out? trying to find it now.

1 Like

I created my www folder manually within config, works just fine.

1 Like

It was working all along I just didnt know it. I was going to https://my-ip:8123/local and expecting to see a directory of files, but got 403 forbidden instead. I finally just went to https://my-ip:8123/local/file.mp3 and it worked.

1 Like

I’ve found this place looking for answers. It was not working for me (manually created the www directory, but could not find the content by calling …/local/…

Turns out that with hass.io a restart of the HA instance is necessary in order to see that data.

I have not looked into the details, but it might be that upon starting, the core container copies the content of the configuration (and the www directory) into the container…

4 Likes

I have followed all these instructions: created “www” folder in the config file, placed JPEG files in folder; I still cannot get the files to show up by calling …/local/… and cannot get the images to work with my device tracker image. Any help much appreciated.

So, I know this is old, but I’ve been searching forever. I finally added the unsecured local url http://192.168.1.xx:8123/local/the_file_to_serve.ext to the frontend key: - extra_html_url: [real SSL url]

2 Likes

In the hass.io environment, you are correct with the /config/www. Remember in your coding that to address it, HA is looking for /local for that directory.

2 Likes

Thank You!

How can I execute a py script from the local folder?
Something like:
https://MY_HA_URL:8123/local/test.py

There is something like cgi that I can use to execute the test.py?

Thank you!

I read WWW as directory name in official documentation, No Joy, however when I used www, so no capitals, for the directory name it worked…

1 Like

It worked for me.
Just to clarify, after creating the “www” folder inside the “config” folder, the “testfile.txt” is accessible through the URL: http://localhost:8123/local/testfile.txt

2 Likes

Just to double triple clarify if anyone lands on this…

Files you put in your [config]/www folder are available at /local within the home assistant dashboard.

Example: [config]/www/pictures/myphoto.jpg would be at the path /local/pictures/myphoto.jpg

9 Likes

Quadruple clarify…
After creating the /www folder you have to reboot Home Assistant.

4 Likes

Could someone put the whole path here?

I have a Home Assistant OS installed in a LXC in Proxmox and as far as I can tell the directory it is running in is:
/root/.homeassistant/
In this directory there is no config/ directory but I created it and in here created the directory www/. In this directory I created a file: test.txt.
In the Home Assistant settings I rebooted Home Assistant.

When going to http://my.ip.address:8123/local/test.txt it says 404: not found.

So for me it is not working… Any ideas?

Ok, I found it. It did not need the config/ directory.
So for me the path where the local files go into: /root/.homeassistant/www/, that’s it.

Path /config/www/ no longer works for me.
Had to change to /homeassistant/www/

image

For future readers, in common parlance, “/config” or [config] refers to your homeassistant configuration folder, usually ~/.homeassistant or /homeassistant or wherever your configuration yaml files live. The folder “config” is not an actual folder.

Place the “www” folder in your homeassistant configuration folder directly.

3 Likes

Just adding one more thing to the above: reset after adding the www. Otherwise you wont access the folder. I almost got crazy.

What would be my api address if I use tunneling with cloudflare?