NR on Synology NAS

6,520 views
Skip to first unread message

Shem Jamieson

unread,
Mar 14, 2017, 7:59:12 AM3/14/17
to Node-RED
Dear panel of infinite Node-RED wisdom,

It has occurred to me that my Synology NAS is a good place to install Node-RED, for a number of reasons.... It's on 24/7 & stable & secure, runs on Linux, easily accessible over the network and internet via Synology software, etc.

I note that you can get packages for node.js(v4) and mosquitto(via SynoCommunity)... Which also strengthens the case.

Anyway I did some searching on this group and main time 'Synology' appears is when Julian is talking about it. But nothing really in the way of how to install NR on there.

Before I spend a sleepless night hacking around does anyone know of a nice and easy way to install Node-RED on a Synology NAS? The ultimate of course would be a Node-RED package in the Synology or SynoCommunity package center, that would be oh-so-beautiful but doesn't look like anyone has attempted that yet. So if that isn't possible maybe just a simple guide on what you have to do to get NR up and running and playing nicely with the NAS.

Thanks!

Nathanaël Lécaudé

unread,
Mar 14, 2017, 1:54:58 PM3/14/17
to Node-RED
Does your Synology support Docker ?
If so that's the easiest way to install Node-RED.
It's rather simple otherwise but Docker makes it even easier.

Shem Jamieson

unread,
Mar 14, 2017, 6:07:37 PM3/14/17
to Node-RED
Thanks for suggestion. No even though it is a recent 2-bay model, docker isn't supported on my model unfortunately.

It looks like it is mainly the higher end models that support it - https://www.synology.com/en-global/dsm/applied_models

Nathanaël Lécaudé

unread,
Mar 15, 2017, 11:49:20 AM3/15/17
to Node-RED
It's still fairly easy to install without Docker:

Make sure the nodejs package is installed.

Login with ssh and you can npm install node-red or any package you want.
If you want to run node-red automatically at boot you can use upstart, I have a config file here:

Julian Knight

unread,
Mar 15, 2017, 8:03:28 PM3/15/17
to Node-RED
Hi there, sorry I've been out at a conference.

Yes, you can install Node.JS on the Synology, then you can use an SSH connection to create a suitable location on disk and install Node-RED. You don't really need a package for Node-RED but you might find it easier to install it in embedded form, I have a description on how to do that on GitHub (look for my repos under the name TotallyInformation). To keep it running, it's probably somewhat harder than on a full Linux machine as I don't think you get access to systemd. But you could use CRON to get it started, something like PM2 would keep it running. Sorry, I've not done this for a while because I already have rather a lot running on my NAS ;-)

Docker does work on Synology's but I think only the Intel based ones. I made sure I chose one of those knowing that it would be easier to run stuff on it.

I've also upgraded the memory on mine as the default can be rather thin on resources. This is easy enough on some of the NAS's but not all.

Julian Knight

unread,
Mar 15, 2017, 8:04:37 PM3/15/17
to Node-RED
Oops, I should have read your post before I waded in! Good catch on upstart. Been a while since I did that.

Shem Jamieson

unread,
Mar 20, 2017, 10:51:13 PM3/20/17
to Node-RED
Thanks N & J for your helpful comments.

So I gave it a go and it worked with only a 4 step process, which I will list below for anyone else attempting in future. You could probably install node via the command line but I did it via package manager for simplicity.

Install Node-RED on Synology NAS:
  1. Install Node.js using the package center
  2. Make sure user home service is enabled under user > advanced > user home (I didn't originally and node-red failed to start because it couldn't access the home dir!)
  3. SSH into it and install node-red using command from official documentation (sudo npm install -g --unsafe-perm node-red)
  4. Type 'node-red' and it should be running at [nas-ip-address]:1880 !
Now I just have to work out how to run it on boot and iron out any other problems and then I will report back here.

S

Julian Knight

unread,
Mar 21, 2017, 4:14:45 PM3/21/17
to Node-RED

Rene Auberger

unread,
Mar 21, 2017, 5:49:12 PM3/21/17
to Node-RED
Hi Shem,

you can install Debian Linux alongside the DSM. You can find a short howto in this article (it's goal is to install openHAB but simply ignore that part and only look at installing Debian): http://internet-of-things.blog/en/installing-openhab-in-only-2-steps-on-a-diskstation/
Then within the Debian system simply follow the instructions to install node.js and Node-RED for Debian Linux. I did it the same way on my Diskstation.

Regards,
René

Julian Knight

unread,
Mar 21, 2017, 8:33:35 PM3/21/17
to Node-RED
Interesting. What is performance like and what device did you run it on?

I tried using Docker for something but I found the performance pretty appalling on my Atom based device with 1GB RAM. I've not tried it again since upgrading to 2GB RAM.

Nathanaël Lécaudé

unread,
Mar 21, 2017, 9:05:37 PM3/21/17
to Node-RED
On my end I use it with the DS716+II and RS815+ and in both cases it's pretty speedy. I have 4 or 5 Node-RED instances running on a single device + mosquitto and mogodb.

Julian Knight

unread,
Mar 22, 2017, 4:16:09 AM3/22/17
to Node-RED
Well I'm not surprised on the DS716, that's a monster with 6GB RAM!

The 815+ has the same RAM as my upgraded 412+ but has a quad-core processor instead of the dual-core Atom in mine.

Nathanaël Lécaudé

unread,
Mar 22, 2017, 8:03:11 AM3/22/17
to node...@googlegroups.com
The 716 also has 2GB.


--
--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/GohGwfhCJJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/1a708c5a-1357-4a8e-b4a5-bffe87355c40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rene Auberger

unread,
Mar 22, 2017, 5:04:19 PM3/22/17
to Node-RED
I am running it on a DS414 which has 1GB RAM and uses a MARVELL Armada XP MV78230 with 1.33GHz dual-core and has DSM 6 installed. I run a plenty of services on it including Node-RED, mosquitto, a mail server, openHAB, ... Performance is good, memory usage of the whole system is always around 50-70%.

Julian Knight

unread,
Mar 22, 2017, 5:57:29 PM3/22/17
to Node-RED
Cool. Sounds good. If I ever get time, I'll have a look at the chroot method as it seems it might be lighter weight than docker?

I really run too much on my NAS - that's why I upgraded the memory, well worth it. The hogs are the file indexing, especially for images and Crashplan which can be a monster as the number of files creeps up. I should really split the backups to fix that but it is just another thing on a long list. I decided though some time back that I would let the NAS be a NAS and not take it over with too many other services that a Pi can happily run. Though actually my Pi2 is close to capacity and I should probably consider splitting that up too.

Sigh, always more ideas and projects than time to play with them :-/

Steven De Clerck

unread,
Apr 29, 2017, 12:51:16 PM4/29/17
to Node-RED

Hey Shem,

Did you already found a solution to run Node Red on boot?

Steven

Matha Goram

unread,
May 4, 2017, 11:22:35 AM5/4/17
to Node-RED
Hello! Sorry to butt at a later date on this thread.

Are there any "Hello Docker/Node-RED" instructions for a beginner like myself? I have Docker running in a Synology box that has some spare capacity for further load. How do I "create" a container with Docker to run Node-RED? (Yes, I am at that basic level.). I can type in the rest of your instructions once I am assured that the work is being done in an isolated mode. Thanks for your understanding.

Regards.

Julian Knight

unread,
May 5, 2017, 3:02:31 AM5/5/17
to Node-RED
Hi Matha, I think you need to have a look at some forums for Synology. I set one or two up when the capability was launched but decided against in the end for various reasons, I can't really remember all the steps now. But there is plenty of help in the Synology forum.

Matha Goram

unread,
May 5, 2017, 11:37:08 AM5/5/17
to node...@googlegroups.com
OK. Thx for letting me know. Rgds.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/GohGwfhCJJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

For more options, visit https://groups.google.com/d/optout.



--
Thanks,

Luis GCU

unread,
Sep 2, 2017, 11:40:18 AM9/2/17
to Node-RED
Hello guys,
I manage to install NR on Synology  DS716 II , but now i need to know the way to start NR automatically .
I followed some of  instructions on this thread  but I can't  get it work.
I tried to use  this syno-upstarter , I installed it ok  but  i am stopped at this point :


In the root of your project, run: ( I am not sure what root of the project to pick?, I tried that on node-red installation directory, npm, and some other directories but always i got "no such file or directory"  )

$ sudo syno-upstarter

Any help would be appreciated.
Thanks

Nathanaël Lécaudé

unread,
Sep 2, 2017, 1:30:04 PM9/2/17
to node...@googlegroups.com
The 716 supports Docker, would be easier to run Node-Red via Docker.


--
--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/GohGwfhCJJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Gilles Manzato

unread,
Sep 3, 2017, 6:03:07 AM9/3/17
to Node-RED
I've managed to run Node-Red with PM2 on a Synology DS414.

Install node-red and pm2 from the NPM , and create a start-stop-status file => https://gist.github.com/GManzato/43e6c8c67a3e87b2f1830d957036f5f6 so PM2 start on boot.

After you need to add the node-red app as a PM2 process with `pm2 start /usr/local/bin/node-red` and `pm2 save` for saving.

Luis GCU

unread,
Sep 3, 2017, 1:15:52 PM9/3/17
to Node-RED
is there any limitation with node-red  when using Dockers?
other than the easy installation   What advantages we may get  using dockers?
Thanks 

Luis GCU

unread,
Sep 3, 2017, 1:17:07 PM9/3/17
to Node-RED
I am not sure what I missed I follow exactly your instructions but pm2  seems is not starting automatically.

Nathanaël Lécaudé

unread,
Sep 3, 2017, 1:37:15 PM9/3/17
to node...@googlegroups.com
There is no limitation to using docker at all. It's easy to manage and no need to mess with config files over ssh.


--
--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/GohGwfhCJJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Luis GCU

unread,
Sep 3, 2017, 2:47:14 PM9/3/17
to Node-RED

Thanks @ Nathanaël , it worked!

Luis GCU

unread,
Sep 3, 2017, 3:55:42 PM9/3/17
to Node-RED
The only problem that I have with Dockers so far is I can't found where are located   node-red settings and user directory with flows.json
the log says in in the following locations, i guess is inside a container, but i cant located where it installed that.

                     Settings file         : /data/settings.js


        User directory    : /data


[info] Flows file      : /data/flows.json

Luis GCU

unread,
Sep 3, 2017, 4:55:20 PM9/3/17
to Node-RED
It seems I learned how to acces to the nodered settings.

Nathanaël Lécaudé

unread,
Sep 3, 2017, 6:12:52 PM9/3/17
to node...@googlegroups.com
That's right, you mount a local volume that represents your user directory.


--

Shem Jamieson

unread,
Sep 3, 2017, 8:22:06 PM9/3/17
to Node-RED
Really late reply sorry, but others seem to be talking about same thing, I found an easy way to start NR on boot using the inbuilt Synology task manager.

Create a script file (I called it nodered-start.sh) and put it somewhere on the NAS (I put it in my home dir), make the contents this (or you could probably improve):
#!/bin/sh
HOME=/root
source $HOME/.profile
PATH=/opt/bin:/opt/sbin:$PATH
/usr/local/bin/node-red

After you have created that script then:
  • Goto DSM>Control_Panel>Task_Scheduler
  • Create a new task, make user as 'root' (maybe change in future for security!) and set event as 'boot-up'
  • In Task_Settings>Run_Command add this text: /volume1/PATH/TO/SCRIPT/nodered-start.sh &
Save the task and now NR should start every time you boot the NAS. It's probably not the best way but it works for me and I like the simplicity of it.

Tobias Braun

unread,
Feb 25, 2018, 2:54:37 PM2/25/18
to Node-RED
Hi Shem,

I am currently try your approach and it works with root. I would like to set it up with the user NodeRed I created for this task. The paths in your file then need to be adapted. Could you explain how to do this? Thanks,
Tobias

Julian Knight

unread,
Feb 26, 2018, 12:09:49 PM2/26/18
to Node-RED
The only thing you should need to change is the HOME variable. Change that to point to the home folder of your user. It would normally be something like:

/homes/username

Shem Jamieson

unread,
Feb 26, 2018, 6:00:01 PM2/26/18
to Node-RED
Hey Tobias, try what Julian said and if you get it working with another user maybe report back. I only got it working with the root user as I had a few problems trying to get it to work with another user then gave up.
Reply all
Reply to author
Forward
0 new messages