Node-Red on home assistant – does not want to write to sd disk with system

Hi.
I have installed home assistant on raspberry pi and I am trying node-red.
OS Version: Home Assistant OS 14.2
Home Assistant Core: 2025.1.4

Node write file does not have access to write to sd card where system is.
I have tried /dev/shm/ testfile.txt, /config/testfile.txt
How to solve this problem?
Thank you.

Home assistant runs node-red inside a docker container and so is isolated from the host operating system.

There may be settings in HA to instruct it to map things like the SD card but you will need to ask on the home assistant forum

Alternatively, run node red yourself on the host operating system (natively).

Can I find instructions somewhere on how to map the SD card?
Thank you.

I'm sure you can, but this is not a node-red thing. This is a home assistant and/or docker thing.

1 Like

By default /config/www/ is the only folder that you can save files to. However www has no auth protection and is exposed to the internet. Setting up your media folder is advised. That location when exposed can be used to store files and is protected by home assistant. Then you would use the path /media/testfile.txt.

https://www.youtube.com/watch?v=TAkU-Q6YAsk

Can't you enable another directory?
/dev/shm/ to ramDisk.

mkdir -p /media/ramdisk
mount -t tmpfs -o size=512M tmpfs /media/ramdisk
mount: mounting tmpfs on /media/ramdisk failed: Permission denied

With haos everything is containerized. If you're using the web terminal, your in the terminal container not home assistant. I've never tried to create directories from the cli, so I'm not sure how to do it.

If you set up samba you can go to the folder, right click and create a new folder. You can also check the box in the write file node to create directory.

Edit: the terminal add on in the community section of addons has elevated permissions. You maybe able to make dir with that. Otherwise this portainer addon has full permissions and you can open a terminal in any container. To get full permissions from a standard terminal google home assistant enable ssh port 22222.

Good directions

Essentially (for the OP) you need to understand the relationship between NR, HA and HAOS

HAOS is a very cut down Linux OS that is used to run Home Assistant, any addons (such as Node Red) are done by launching a docker container from HAOS (not HA) - you therefore need to get in and communicate with HAOS

As you are asking these questions it would appear you are new to all of this - so Portainer installed into HA (which is its own container as well) is the easiest way to manage all of this.

You will however need to get into HAOS and create the directories on the SD card where you want to store the NR files (and no putting them into a RAMDISK is not a good idea as it will disappear on a restart)

Craig

I'm completely new to HA. I'm a week old.
I've been using node red on raspberry - raspios-bookworm.
I wanted to try Home Assistant Voice Preview Edition.
I'll probably go back to bookworm.