Deployment Issue: Node-RED on Windows Server with IIS

Hi everyone,

I'm currently working on deploying the Node-RED server on a Windows server, and I have some specific requirements to fulfill. Here's what I've done so far:

  1. Installed Node-RED
  2. Run 'npm run dev'

After these steps, I'm able to access the server thought localhost.

However, my goal is to integrate it with IIS (Internet Information Services). To achieve this, I added a "web.config" file pointing to "packages/node_modules/node-red/red.js" . But upon trying to access it, I encountered an error stating that it couldn't create the ".node-red" folder.

To solve this issue, I manually created the folder and its necessary files. However, now I'm encountering a new error: "Error: EPERM: operation not permitted, lstat 'C:\WINDOWS\system32\config\systemprofile.node-red\settings.js'".

My question is, why is Node-RED attempting to create files in the "system32" directory? How can I set it to create these files in the root directory instead?

Any thoughts or solutions? Thanks in advance!

My question is why on earth would you want to use IIS? Far far far faaaaar simpler to run Node-RED as a service (search NSSM on this forum) e.g: Running Multiple Instances of Node-red using NSSM - #2 by Steve-Mcl


Start node-red using the node-red command and pass in the -u of your choice.

See node-red CLI docs

Hi Steve, thanks for the reply.

Unfortnatly I have to use IIS and I just need to be able to create the user in the root directory.

Thanks.

  1. To take advantage of Windows native authentication (Active Directory or Azure Active Directory)
  2. For the same reason why people want to use any proxy for micro-service architectures - efficiency and security.

Had you asked "why on earth would you want to use Windows for this", I'd have given a different answer :slight_smile:

The correct way to do this is to use iisnode as the reverse proxy. This is how Microsoft themselves run node.js services on Azure.

Azure/iisnode: Hosting node.js applications in IIS on Windows (github.com)
tjanczuk/iisnode: Hosting node.js applications in IIS on Windows (github.com)

iisnode directly manages the node.js app - rather like how PM2 works but integrated to IIS. So it will restart the service if it fails, etc.