# How to a Create Static Files

**URL:** <https://discourse.nodered.org/t/how-to-a-create-static-files/43396>\
**Category:** General\
**Created:** [30 March 2021 11:40 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396 "2021-03-30T11:40:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwy6283](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mwy6283/32/39382_2.png) [@mwy6283](https://discourse.nodered.org/u/mwy6283)\
**Post date:** [30 March 2021 11:40 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/1 "2021-03-30T11:40:47Z")

</div>

Hi , I am looking for help in understanding and how to create a static file in HA / node red. I have removed the // httpStatic" there is a node-red-static file however when i use this in File node i receive the following error "failed to write to file: Error: ENOENT: no such file or directory, open 'home/.node-red/static' If i create a file config/reolink\_snapshot.jpg i can see the snapshot. question is this the only way . I was looking to store them to my hard drive if possible?

I await any comments or advice.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [30 March 2021 12:21 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/2 "2021-03-30T12:21:42Z")

</div>

I think HA runs Node-RED in a docker container - if so then that would need to mount a volume from outside the container as a directory inside that it can then write to - the file node needs to specify a complete path - but to a place inside the container . I suspect you will find more help on the HA forum as there aren't so many HA folk over here.

---

<div class="post-metadata">

**Author:** ![mwy6283](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mwy6283/32/39382_2.png) [@mwy6283](https://discourse.nodered.org/u/mwy6283)\
**Post date:** [30 March 2021 13:00 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/3 "2021-03-30T13:00:44Z")

</div>

Hi dceejay, thanks for your reply. asking HA is a nightmare, most people i don't think they realise that newbies need to learn, they spout computer jargon in stead of plain english.

thanks again for reply

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 March 2021 14:37 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/4 "2021-03-30T14:37:01Z")

</div>

You could ditch HA and use node-red for everything.

---

<div class="post-metadata">

**Author:** ![mwy6283](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mwy6283/32/39382_2.png) [@mwy6283](https://discourse.nodered.org/u/mwy6283)\
**Post date:** [30 March 2021 15:20 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/5 "2021-03-30T15:20:27Z")

</div>

I most likely will when I get used to and the learn the basic, hence looking for advise on why the httpStatic, now that i have removed // from setting js. What else i need to do?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 March 2021 16:30 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/6 "2021-03-30T16:30:10Z")

</div>

If, as Dave say's, HA runs NR in a docker container, you need to understand a bit about containers. They provide a semi-isolated virtual environment. That means that whatever you put in settings.js relates to the inside of the container. The usual way around that is, as Dave says, to add an extra container that just provides a virtual filing system that maps to a real folder.

If that sounds complex - it should! Because it is! And it is for that reason that lots of us recommend not using that kind of approach unless you really have to.

For you, it may even be simpler to run up a stand-alone copy of Node-RED and then just use it to serve up the static folder for now but then move over your other flows later.

Of course, you could also run up a simple web server instead. Caddy is very easy to install and configure and it comes pre-configured with a static folder. As does NGINX.

---

<div class="post-metadata">

**Author:** ![mwy6283](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mwy6283/32/39382_2.png) [@mwy6283](https://discourse.nodered.org/u/mwy6283)\
**Post date:** [30 March 2021 17:20 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/7 "2021-03-30T17:20:07Z")

</div>

TotallyInformation, , thanks for the information at least you gave me some to look at. thanks you . I will look into it. I have HA on a PI3+and my iMac to learn the pros and many cons , when hopefully i will transfer over to my Pi3.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 May 2021 17:20 UTC](https://discourse.nodered.org/t/how-to-a-create-static-files/43396/8 "2021-05-29T17:20:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
