Optional settings when start a container does not work

This is my input. Mapping of local data folder does not work. All activities I perform in Node Red are lost when I restart Docker.

Starting this in the terminal works:
docker run -it -p 1881:1880 -v C:\Users\albac\MyNodeRed:/data --name MyNodeRed nodered/node-red

What is wrong?

The container path is correct according to the docs. Whatever is written inside the container into the /data folder, should be visible in the host directory C:\Users\albac\MyNodeRed.

Though, the noredred examples only use named volumes. It could be possible that files already exist in /data and need to be copied back into the volume (which is the default behavior if a named volume is empty) in order for nodered to work properly. Binds (=mounting a host path into a container path) do not copy back existing data. Usually the applications inside the container don’t start or misbehave if the image depends on the named volumes “copy data on first use” behavior.

New data will be written into named volumes and binds the same way.

Maybe you are missing the correct permissions (doc):

Note : Users migrating from version 0.20 to 1.0 will need to ensure that any existing /data directory has the correct ownership. As of 1.0 this needs to be 1000:1000 . This can be forced by the command sudo chown -R 1000:1000 path/to/your/node-red/data

So why does it work then when I’m using the teminal to start the container?

Can you reproduce the same issue with an nginx image for example?

Apologies, I didn’t notice that your wrote underneath the screenshot that it works from the terminal.

Can you share the output of either `docker inspect or the container’s inspect tab from Docker Desktop for the container created using the Docker Desktop UI?

Hi meyay:
there is a lot off stuff inside. I’ve copied the Volume part ?

{
	"Id": "eb72360a55362395e26e5ffac23e8583f2ee5be4a01ff5d5b3458d491617338e",
	"Created": "2025-12-19T08:32:11.212197227Z",
	"Path": "./entrypoint.sh",
	"Args": [],
	"State": {
		"Status": "exited",
		"Running": false,
		"Paused": false,
		"Restarting": false,
		"OOMKilled": false,
		"Dead": false,
		"Pid": 0,
		"ExitCode": 143,
		"Error": "",
		"StartedAt": "2025-12-19T08:32:11.342871111Z",
		"FinishedAt": "2025-12-19T08:34:09.167765832Z",
		"Health": {
			"Status": "unhealthy",
			"FailingStreak": 0,
			"Log": [
				{
					"Start": "2025-12-19T08:32:41.548775372Z",
					"End": "2025-12-19T08:32:41.640019873Z",
					"ExitCode": 0,
					"Output": ""
				},
				{
					"Start": "2025-12-19T08:33:11.643926636Z",
					"End": "2025-12-19T08:33:11.789236957Z",
					"ExitCode": 0,
					"Output": ""
				},
				{
					"Start": "2025-12-19T08:33:41.789317747Z",
					"End": "2025-12-19T08:33:41.905038325Z",
					"ExitCode": 0,
					"Output": ""
				}
			]
		}
	},
	"Image": "sha256:216e7403aab9888f7e68de9e468fed31bb9d7b2d38117c08e645095a63658a2f",
	"ResolvConfPath": "/var/lib/docker/containers/eb72360a55362395e26e5ffac23e8583f2ee5be4a01ff5d5b3458d491617338e/resolv.conf",
	"HostnamePath": "/var/lib/docker/containers/eb72360a55362395e26e5ffac23e8583f2ee5be4a01ff5d5b3458d491617338e/hostname",
	"HostsPath": "/var/lib/docker/containers/eb72360a55362395e26e5ffac23e8583f2ee5be4a01ff5d5b3458d491617338e/hosts",
	"LogPath": "/var/lib/docker/containers/eb72360a55362395e26e5ffac23e8583f2ee5be4a01ff5d5b3458d491617338e/eb72360a55362395e26e5ffac23e8583f2ee5be4a01ff5d5b3458d491617338e-json.log",
	"Name": "/suspicious_gould",
	"RestartCount": 0,
	"Driver": "overlayfs",
	"Platform": "linux",
	"MountLabel": "",
	"ProcessLabel": "",
	"AppArmorProfile": "",
	"ExecIDs": null,
	"HostConfig": {
		"Binds": [
			"C:\\Users\\albac\\MyNodeRed⁠:\\data"
		],
		"ContainerIDFile": "",
		"LogConfig": {
			"Type": "json-file",
			"Config": {}
		},
		"NetworkMode": "bridge",
		"PortBindings": {
			"1880/tcp": [
				{
					"HostIp": "",
					"HostPort": "1881"
				}
			]
		},
		"RestartPolicy": {
			"Name": "no",
			"MaximumRetryCount": 0
		},
		"AutoRemove": false,
		"VolumeDriver": "",
		"VolumesFrom": null,
		"ConsoleSize": [
			0,
			0
		],
		"CapAdd": null,
		"CapDrop": null,
		"CgroupnsMode": "private",
		"Dns": null,
		"DnsOptions": null,
		"DnsSearch": null,
		"ExtraHosts": null,
		"GroupAdd": null,
		"IpcMode": "private",
		"Cgroup": "",
		"Links": null,
		"OomScoreAdj": 0,
		"PidMode": "",
		"Privileged": false,
		"PublishAllPorts": false,
		"ReadonlyRootfs": false,
		"SecurityOpt": null,
		"UTSMode": "",
		"UsernsMode": "",
		"ShmSize": 67108864,
		"Runtime": "runc",
		"Isolation": "",
		"CpuShares": 0,
		"Memory": 0,
		"NanoCpus": 0,
		"CgroupParent": "",
		"BlkioWeight": 0,
		"BlkioWeightDevice": null,
		"BlkioDeviceReadBps": null,
		"BlkioDeviceWriteBps": null,
		"BlkioDeviceReadIOps": null,
		"BlkioDeviceWriteIOps": null,
		"CpuPeriod": 0,
		"CpuQuota": 0,
		"CpuRealtimePeriod": 0,
		"CpuRealtimeRuntime": 0,
		"CpusetCpus": "",
		"CpusetMems": "",
		"Devices": null,
		"DeviceCgroupRules": null,
		"DeviceRequests": null,
		"MemoryReservation": 0,
		"MemorySwap": 0,
		"MemorySwappiness": null,
		"OomKillDisable": null,
		"PidsLimit": null,
		"Ulimits": null,
		"CpuCount": 0,
		"CpuPercent": 0,
		"IOMaximumIOps": 0,
		"IOMaximumBandwidth": 0,
		"MaskedPaths": [
			"/proc/acpi",
			"/proc/asound",
			"/proc/interrupts",
			"/proc/kcore",
			"/proc/keys",
			"/proc/latency_stats",
			"/proc/sched_debug",
			"/proc/scsi",
			"/proc/timer_list",
			"/proc/timer_stats",
			"/sys/devices/virtual/powercap",
			"/sys/firmware"
		],
		"ReadonlyPaths": [
			"/proc/bus",
			"/proc/fs",
			"/proc/irq",
			"/proc/sys",
			"/proc/sysrq-trigger"
		]
	},
	"GraphDriver": {
		"Data": null,
		"Name": ""
	},
	"Mounts": [
		{
			"Type": "bind",
			"Source": "C:\\Users\\albac\\MyNodeRed⁠",
			"Destination": "\\data",
			"Mode": "",
			"RW": true,
			"Propagation": "rprivate"
		}
	],
	"Config": {
		"Hostname": "eb72360a5536",
		"Domainname": "",
		"User": "node-red",
		"AttachStdin": false,
		"AttachStdout": false,
		"AttachStderr": false,
		"ExposedPorts": {
			"1880/tcp": {}
		},
		"Tty": false,
		"OpenStdin": false,
		"StdinOnce": false,
		"Env": [
			"PATH=/usr/src/node-red/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
			"NODE_VERSION=20.19.6",
			"YARN_VERSION=1.22.22",
			"NODE_RED_VERSION=v4.1.2",
			"NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules",
			"FLOWS=flows.json"
		],
		"Cmd": null,
		"Healthcheck": {
			"Test": [
				"CMD-SHELL",
				"node /healthcheck.js"
			]
		},
		"Image": "nodered/node-red:latest",
		"Volumes": null,
		"WorkingDir": "/usr/src/node-red",
		"Entrypoint": [
			"./entrypoint.sh"
		],
		"OnBuild": null,
		"Labels": {
			"authors": "Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan",
			"org.label-schema.arch": "",
			"org.label-schema.build-date": "2025-12-03T16:36:06Z",
			"org.label-schema.description": "Low-code programming for event-driven applications.",
			"org.label-schema.docker.dockerfile": ".docker/Dockerfile.alpine",
			"org.label-schema.license": "Apache-2.0",
			"org.label-schema.name": "Node-RED",
			"org.label-schema.url": "https://nodered.org",
			"org.label-schema.vcs-ref": "",
			"org.label-schema.vcs-type": "Git",
			"org.label-schema.vcs-url": "https://github.com/node-red/node-red-docker",
			"org.label-schema.version": "4.1.2",
			"org.opencontainers.image.source": "https://github.com/node-red/node-red-docker"
		},
		"StopTimeout": 1
	},
	"NetworkSettings": {
		"Bridge": "",
		"SandboxID": "",
		"SandboxKey": "",
		"Ports": {},
		"HairpinMode": false,
		"LinkLocalIPv6Address": "",
		"LinkLocalIPv6PrefixLen": 0,
		"SecondaryIPAddresses": null,
		"SecondaryIPv6Addresses": null,
		"EndpointID": "",
		"Gateway": "",
		"GlobalIPv6Address": "",
		"GlobalIPv6PrefixLen": 0,
		"IPAddress": "",
		"IPPrefixLen": 0,
		"IPv6Gateway": "",
		"MacAddress": "",
		"Networks": {
			"bridge": {
				"IPAMConfig": null,
				"Links": null,
				"Aliases": null,
				"MacAddress": "",
				"DriverOpts": null,
				"GwPriority": 0,
				"NetworkID": "70656e69439acc8fa606c9bd92eafdf8946f178114d0894e23e0df52be6d7eb4",
				"EndpointID": "",
				"Gateway": "",
				"IPAddress": "",
				"IPPrefixLen": 0,
				"IPv6Gateway": "",
				"GlobalIPv6Address": "",
				"GlobalIPv6PrefixLen": 0,
				"DNSNames": null
			}
		}
	},
	"ImageManifestDescriptor": {
		"mediaType": "application/vnd.oci.image.manifest.v1+json",
		"digest": "sha256:cfddc4abad871a7b7e420ba7919c6e12bb05112cb693bf10729e0d8f6f404102",
		"size": 3515,
		"platform": {
			"architecture": "amd64",
			"os": "linux"
		}
	}
}

Hi meyay, I’ve tried to reply with a code but did not work.


There is a lot of stuff inside. What do you want to see and how can I send?

Hi rimelek: What is a nginx image?

It doesn’t matter. It was an example, but if you type nginx on Google, you will find it as the first result.

The right side should be /data not \\data, Which container was that the output for? The one that was created on the GUI, or the from terminal?

It was blocked by the spam filter, but I accepted it so it is now visible.

When I create the container in DD, the same way you did, then /data is used. It doesn’t look right in your inspect output.

I tested it with Docker Desktop 4.55.0. Which Docker Desktop version are you using?

My mistake was \data instead of /data … simple :zany_face:

Sorry vor bothering you! Thanks in any way.

Even though, your original post had a screenshot that showed that /data is used?

I am glad it’s sorted out now.