# How to install node-red-admin in docker image

**URL:** <https://discourse.nodered.org/t/how-to-install-node-red-admin-in-docker-image/10877>\
**Category:** General\
**Created:** [7 May 2019 08:30 UTC](https://discourse.nodered.org/t/how-to-install-node-red-admin-in-docker-image/10877 "2019-05-07T08:30:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauog](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mauog/32/4679_2.png) [@mauog](https://discourse.nodered.org/u/mauog)\
**Post date:** [7 May 2019 08:30 UTC](https://discourse.nodered.org/t/how-to-install-node-red-admin-in-docker-image/10877/1 "2019-05-07T08:30:05Z")

</div>

Hello,  
I would like to secure my node-red installation using user/password.  
So I would need to use node-red-admin tool to generate the password hash.  
I am using the nodered/node-red-docker docker image.  
I tried to login into container and then to install node-red-admin via npm but I got a permission error

```auto
node-red@europa:/data$ npm install -g node-red-admin
npm info it worked if it ends with ok
npm info using npm@5.0.3
npm info using node@v8.1.3
npm http fetch GET 200 https://registry.npmjs.org/node-red-admin 128ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/bcryptjs 167ms (from cache)
[snip]
npm http fetch GET 200 https://registry.npmjs.org/psl 22ms (from cache)
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /usr/src/node-red/.npm/_logs/2019-05-07T08_15_26_430Z-debug.log

```

How can I fix it?  
Is the tool already installed? In this case what is the path?  
Is there any other way o generate password hashes?

Thank You

Regards

---

<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:** [7 May 2019 11:46 UTC](https://discourse.nodered.org/t/how-to-install-node-red-admin-in-docker-image/10877/2 "2019-05-07T11:46:54Z")

</div>

See the alternative command in the docs  
[https://nodered.org/docs/security](https://nodered.org/docs/security)

---

<div class="post-metadata">

**Author:** ![m\_elias](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@m\_elias](https://discourse.nodered.org/u/m_elias)\
**Post date:** [8 February 2021 16:13 UTC](https://discourse.nodered.org/t/how-to-install-node-red-admin-in-docker-image/10877/3 "2021-02-08T16:13:27Z")

</div>

```auto
node -e "console.log(require('bcryptjs').hashSync(process.argv[1], 8));" your-password-here

```

This command? Where in the docker container is the directory Node-RED has been installed to?
