Node-Red on Synology/QNAP NAS

Anyone else out there that is thinking about running node-red, that does not have a Rpi, but does have a Synology NAS, you can use it to run Node-Red in Docker. It's easy, here's how.

For QNAP - see this post Thank you @jrfarrar for the assist.

Thank you @vreihen for the assist on which Synology can run this.

If not already installed, install the Docker app from the Synology package center.

Enable SSH on the NAS from Control Panel > Terminal & SNMP

Use PuTTY or whatever program you like to log into the NAS via SSH with an admin account.

For PuTTY be sure to click "SSH"

Execute the following command and provided the same password for the account you used to log into SSH again. It should then download/install all the current files for node-red and node.js

sudo docker run -it -p 1880:1880 --name mynodered nodered/node-red

You should see something like....

If you see "Stared Flows" your all set!! Use the browser of your liking to navigate to NASIP:1880 to start using Node-RED!

At this point Node-Red will also be installed and accessible via the Synology web GUI under Docker.

Recommended, but not required

To ensure Node-Red is running after a NAS reboot, open the Docker app in the Synology web GUI
Click, Image > nodered/node-red:latest. Check the "Execute container with highest privileges" (optional) box. Click the "Advanced Settings" button, and then check the "Enable auto-restart" (recommended) box.

Thank you @JasonJoel and @MRobi for assists

In order to use time base events you need to set your time zone as an environment variable. See this site for correct zone names

Thank you @tja for the assist

Create a volume mapping to store your user data outside the container. This way you can update NR just by destroying the old one and creating a new. If your running "nodered/node-red:latest" you can just update the image from the registry tab followed by "stop", "clear" and "start" on the running container.

BACKUP EXISTING FILES BEFORE CHANGING THIS SETTING

In Synology you can easily configure a mapping of the /data directory in the container through the interface.
edit_volume

EDIT: In order to use this feature with the newest version of NR you need to make some permission changes. Please see this post for details thanks @dcaton1220 for the assist :raised_hands:

Once running see this thread for node-red hubitat configuration and uses. Enjoy Node-Red automating!

11 Likes

I did mine on a QNAP to play with and its pretty awesome isn't it! :wink:

2 Likes

Loving it.

I tired to find docker in QNAP, and was going to post it as well, but since I have it up on Synology I would rather spend time playing/converting (RM/NR), than reinventing a wheel I don't need.

Care to post for QNAP commands some may thank you for it. (I'll change title to include both if you can/do)

1 Like

Well I kind of did it in a "roundabout" way. I installed a Debian docker first, and then did the manual way of installing. At least this gave me VNC etc, This is the docker I used. Just search for Debian.

Then installed Node Red

sudo npm install -g --unsafe-perm node-red

Reason for this was so I could easily backup the flows etc, using docker on QNAP, I couldnt find the right way to have the drive mapped, so back up was easier. Its all a little temporary not, as I've just bought a PI 4, so it will be going on there when I can face up to moving it all across :wink:

1 Like

You need to throw in a notice here that only the PLUS models of Synology NAS devices (Intel processors) support Docker. This does not work on the "J" models, probably not on the "play" models, and all of the others using ARM chips and not Intel. Ask me how I know, having whacked the web interface on my DS216j to the point of needing to factory reset and start over from scratch trying to side-load an ARM Docker package onto it. Don't say I didn't warn you. :wink:

On the bright side, the DS918+ that I replaced it with runs Intel Docker containers really nice. I'm running HOOBS/HomeBridge, Pi-Hole, and the UniFi controller in Docker containers on it right now, and will be porting AlarmDecoder over when I get a chance....

1 Like

Super easy on the QNAP. Just open up container station (install that if you have it uninstalled) and then click "create" which will pull up this screen:

type "nodered" into the search bar and the click on the "Docker" tab underneath it.

you should see this: (THE SECOND ONE DOWN IS THE LATEST VERSION)

Once installed (it will download first) you will see it listed under "Containers" on the left menu like this:

The little chain link is a link to run it. OR you can open up the container by clicking it's name. It will then show you the IP and PORT that it is running on. Again...you do need to know and understand networking to do this. That page is found under the "Advanced Settings" for the container.


Here is the container's page. You will see that "settings" button. Which will bring you here:

Click advanced, then "network on the left" you'll see this screen.

2 Likes

Had to go hunting for the link button but yeah pretty easy, thanks for sharing!

Can you add this to your post, so when I link it's included? :+1:

To open Node-Red click the chain link icon in ContainerStation (unless you know a different way to guess the port QNAP picked?)

thanks again for the assist.

1 Like

The thing I couldnt find for Node Red was the set up for the folders. This means you can find all your config easily and back it up.

Even though I set it, there is nothing there. Instead you have to go find it via SSH to back it up.

Edit.
Unlike my HA setup in docker, where you can add the folder /config and all your config will be in the physical path you specify (if you get me).

2 Likes

@jrfarrar Actually it looks like the container store only has the old version 0.28

I just backup the entire image.

**Note...I'm not using node red...just showing how to install it on a QNAP. Also again, different versions can be found under the Docker images.

Ok, so if you want to map a mount in your image to a location on the NAS here is how:
In that same advanced settings under "Shared Folders" you can do something like this.

Then the location of that folder is here:

Again..I'm not using this...(I use other containers) so hopefully this helps someone get going with it.

3 Likes

This guide is missing a step that will improve your seup a lot: Create a volume mapping to store your user data outside the container. This way you can update NR just by destroying the old one and creating a new. If your running "nodered/node-red:latest" you can just update the image from the registry tab followed by "stop", "clear" and "start" on the running container.

In Synology you can easily configure a mapping of the /data directory in the container through the interface.
edit_volume

4 Likes

Yep

fixed my post for relevancy

2 Likes

Yeah true, I appreciate that. :+1:

1 Like

Ah this is the nugget :smiley: Thx!!

1 Like

Not anymore, assist added, thank you. And added to my NR install TY!!

Testing a QNAP now with the /data added :+1:

1 Like

Let me know how that goes. Quite honestly I'm going to have to start at the top of this thread to even get this working with HE at this point...I mean...I'm half way there now.... :joy:

2 Likes

Yeah it works :slight_smile:

I set the Advanced, "Add volume from host" as below.

Created a flow and checked the folder.

This would make backup so much easier :wink:

3 Likes

Same for Synology, sweet!

1 Like

Apparently you were using an older version of node-red when you wrote this. The current version probably will not work on Synology and you'll get an error similar to:

Error: EACCES: permission denied, copyfile '/usr/src/node-red/node_modules/node-red/settings.js' -> '/data/settings.js'

Using your example, you need to execute this command:

sudo chown -R 1000:1000 /volume1/docker/node-red

Details are here: Permissions and Persistence · node-red/node-red-docker Wiki · GitHub

Doesn't matter if you give the folder full permissions to everyone in the world, node-red requires the owner to be 1000. No idea why, but I'm not a Linux guy.

1 Like

Download the Hubitat app