# Docker permissions

**URL:** https://discourse.nodered.org/t/docker-permissions/1097
**Category:** General
**Created:** [26 June 2018 11:18 UTC](https://discourse.nodered.org/t/docker-permissions/1097 "2018-06-26T11:18:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bsense](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@bsense](https://discourse.nodered.org/u/bsense)
#### Post date: [26 June 2018 11:18 UTC](https://discourse.nodered.org/t/docker-permissions/1097/1 "2018-06-26T11:18:49Z")

</div>

Dear experts,  
I run the dockerized version of node-red in a lubuntu 18.04LTS. In order to have storage persistance i run it the container as:  
$ sudo docker run -it -p 1880:1880 -v /home/bsense/docker-persistent/nodered/data:/data --name mynodered nodered/node-red-docker

I have previously copied the container data files to the host directory:  
$ sudo docker cp mynodered:/data /home/bsense/docker-persistent/nodered/

It starts coorectly but when i try to save the flows it gives an error of EACCESS  
{Deploy failed: {“error”:“EACCES”,“message”:“EACCES: permission denied, rename ‘/data/flows.json’ -\> ‘/data/.flows.json.backup’”}

I would like to keep the host to managet he directory so I do not see any chown.

Within the container the uid is 1001 (nodered) the host user is 1000 (bsense)

This is kind annoying. It is not happenning to me with other conatinerized apps (mariadb, mongodb)

What could I do?

Regards

---

<div class="post-metadata">

### Author: ![Just-Insane](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/just-insane/32/34518_2.png) [@Just-Insane](https://discourse.nodered.org/u/Just-Insane)
#### Post date: [31 December 2020 15:15 UTC](https://discourse.nodered.org/t/docker-permissions/1097/2 "2020-12-31T15:15:39Z")

</div>

Hello,

Did you ever find a solution to this?

I am running the docker container within Kubernetes, and randomly getting this error. Nothing has changed about the deployment, it just suddenly shows up.

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [1 January 2021 09:52 UTC](https://discourse.nodered.org/t/docker-permissions/1097/3 "2021-01-01T09:52:39Z")

</div>

You can pass the effective user id to a pod with the following section in the Deployment yaml

```auto
spec:
  securityContext:
    runAsUser: 1000
    runAsGroup: 3000
    fsGroup: 2000

```

More details [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod)

You can do the same with Docker using the `--user` flag on the command line (details [here](https://docs.docker.com/engine/reference/run/#user))

---

<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: [15 January 2021 09:52 UTC](https://discourse.nodered.org/t/docker-permissions/1097/4 "2021-01-15T09:52:40Z")

</div>

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