# Installing Node-red on Linux server

**URL:** <https://discourse.nodered.org/t/installing-node-red-on-linux-server/7999>\
**Category:** General\
**Created:** [15 February 2019 09:58 UTC](https://discourse.nodered.org/t/installing-node-red-on-linux-server/7999 "2019-02-15T09:58:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankitha](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Ankitha](https://discourse.nodered.org/u/Ankitha)\
**Post date:** [15 February 2019 09:58 UTC](https://discourse.nodered.org/t/installing-node-red-on-linux-server/7999/1 "2019-02-15T09:58:48Z")

</div>

Hi All,

I am trying to install Node-red on Linux machine under specific user and inside some folder. But by default node-red is getting installed under user home directory. Is there a way to give path while installing node-red modules?

Below are the steps followed to install Node-red Module.

Step 1 : Log in to Linux machine as user(not root user)  
Step 2: Install node JS under some specific folder(ex: /opt/nodejs)  
Step 3 : install node-red using below command  
**npm install -g --unsafe-perm node-red**

Above step install node-red under user home directory. For example, suppose if I have logged in as ankuser then .nodered folder gets created under **/home/ankuser/.nodered**.  
But in my case i want to install node-red under "/opt/nodered" path.  
How can i do this? can any one suggest me the command to be used to install the same.

Thanks and Regards,

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 February 2019 10:02 UTC](https://discourse.nodered.org/t/installing-node-red-on-linux-server/7999/2 "2019-02-15T10:02:16Z")

</div>

Hi @Ankitha  
you are mixing up where node-red is installed and where it stores user data.

Installing node-red with `npm install -g --unsafe-perm node-red` will have installed it somewhere under `/usr/lib` (or maybe `/usr/local/lib`).

When you run Node-RED it, by default, uses `~/.node-red` as the user directory to store flow configuration etc. You can override the directory it uses for this using the `--userDir` argument to the `node-red` command. See [https://nodered.org/docs/getting-started/running](https://nodered.org/docs/getting-started/running) for details.

---

<div class="post-metadata">

**Author:** ![Ankitha](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Ankitha](https://discourse.nodered.org/u/Ankitha)\
**Post date:** [19 February 2019 08:26 UTC](https://discourse.nodered.org/t/installing-node-red-on-linux-server/7999/3 "2019-02-19T08:26:32Z")

</div>

Hi Knolleary,

Thanks a lot for clarifying.  
Now I am able to install and start node-red by specifying --userDir.  
Is it possible to install node-red without "npm install" command. If there is no internet to download node-red modules and install, in this case how can we install node-red? I mean through binaries is it possible to install?

Can you please help me on this.  
Thanks in advance.

Thanks and Regards,

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [19 February 2019 08:32 UTC](https://discourse.nodered.org/t/installing-node-red-on-linux-server/7999/4 "2019-02-19T08:32:26Z")

</div>

Have you tried the method described here? [https://stackoverflow.com/questions/23250805/how-to-install-nodejs-project-locally-without-internet-connection](https://stackoverflow.com/questions/23250805/how-to-install-nodejs-project-locally-without-internet-connection)

The first google result for "[https://www.google.com/search?client=safari&rls=en&q=how+to+npm+install+without+internet&ie=UTF-8&oe=UTF-8](https://www.google.com/search?client=safari&rls=en&q=how+to+npm+install+without+internet&ie=UTF-8&oe=UTF-8)"

---

<div class="post-metadata">

**Author:** ![Ankitha](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Ankitha](https://discourse.nodered.org/u/Ankitha)\
**Post date:** [19 February 2019 16:40 UTC](https://discourse.nodered.org/t/installing-node-red-on-linux-server/7999/5 "2019-02-19T16:40:31Z")

</div>

Hi Ukmoose,

Thanks for link. Yes I have tried above steps given in given link but I am getting errors while executing "npm install" command as it is unable to install all the node modules.

I could see below error.

/usr/lib/gcc/x86\_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/cxxabi-forced.h:29: error: expected declaration before end of line  
make: \*\*\* [Release/obj.target/fibers/src/fibers.o] Error 1  
make: Leaving directory `/opt/hpe/sis/nodered/node-red-0.19.5/node_modules/fibers/build' gyp ERR! build error gyp ERR! stack Error:`make`failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/opt/hpe/sis/nodejs/node-v8.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 2.6.32-573.el6.x86_64 gyp ERR! command "/opt/hpe/sis/nodejs/node-v8.12.0-linux-x64/bin/node" "/opt/hpe/sis/nodejs/node-v8.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" gyp ERR! cwd /opt/hpe/sis/nodered/node-red-0.19.5/node_modules/fibers gyp ERR! node -v v8.12.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-gyp exited with code: 1 Please make sure you are using a supported platform and node version. If you would like to compile fibers on this machine please make sure you have setup your build environment-- Windows + OS X instructions here: https://github.com/nodejs/node-gyp Ubuntu users please run:`sudo apt-get install g++ build-essential` **RHEL users please run:`yum install gcc-c++`and`yum groupinstall 'Development Tools'`** Alpine users please run:`sudo apk add python make g++`  
sh: nodejs: command not found  
npm WARN node-red-node-test-helper@0.1.7 requires a peer of node-red@~0.18.4 but none is installed. You must install peer dependencies yourself.  
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node\_modules/fsevents):  
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Installed yum install gcc-c++`and`yum groupinstall 'Development Tools as recommended but no luck.

Thanks and Regards,
