Change Node-red dash port number

Hi all,

I am needing to change the port number of the node-red dash it does not matter if it effects both the flow editor and the dash.

does anyone have any experience with this? I am struggling to find any information, any hints are much appreciated.

Thanks

1 Like

Have a look at your settings.js file in the node-red installation dir.

Hi thank you for your response. I have found 6 files in different locations all named settings.js, please could you be more specific about which one I am to look at making alterations too?

please see screen shot, your input is much appreciated thank you.

It's neither.

The one Node-RED uses is printed at startup and will usually be in your home directory in ~/.node-red/settings.js if you didn't change anything.

You can also pass the port with the -p parameter, depending on how you start Node-RED.

Here's more info about that from the documentation:
https://nodered.org/docs/getting-started/local#running

Hi Kuema, thank you for your input. is this true even if node-red is installed as a snap on ubuntu server?

I used the locate command which normally finds every instance of a file name in every location on the machine, I double checked in the home directory and cannot find a any settings.js file in that location.

I have taken a look at the document you have linked me and attempted to start node-red using the following

sudo snap enable node-red -p 1980

unfortunately node-red does not understand the flag i am sending it, I am wondering if this information still applies when installed as a snap.

many thanks.

That won't work that way.

I don't use snap myself, so I can't tell where it stores the user data.

Is there a way to view the logs of snap apps? That would give a clue where to search for the workspace directory.

Any snap experts here? :sweat_smile:

It appears that the name snap is appropriate snaps seem to be the cause of all my issues lately making me ready to snap my keyboard :smile:

thank you for the help Kuema I will keep trying am sure I will figure it out eventually.

Yep, I dislike the fact that Canonical had to introduce yet another package management system. They even migrated Chromium to snap which caused me some trouble. But that's another topic. :see_no_evil:

You could try something like snap logs node-red to view the logs. :thinking:

Or maybe the ReadMe will help - https://github.com/dceejay/nodered.snap

Hi dceejay thank you for your help. I have taken a look at the link you have sent me.

I found the settings.js file at the location shown in the ReadMe.

/root/snap/node-red/current/

I than change the port number the server is to listen too.

nodered port

I then restarted node-red snap restart node-red

unfortunately node-red is still listening to port 1880 :confused:

You need to stop and restart it... you can use the journalctl command mentioned to see the log and see what port it starts up on.

thank you for your reply dceejay, I have confined that the settings.js file has been altered and saved with the new port number, I have defiantly stopped, started, and restarted node-red.

and I can confirm by using the journalctl that the server is still listening to the default port, from the documentation you kindly provided I cannot find any reason why the changes are not taken effect?

thank you for your support it is much appreciated.

How have you changed that line ? - removed the process.env.PORT part and just left the number hopefully. I have just checked mine here and doing a sudo snap stop node-red and sudo snap start node-red def picks it up. (as long as you are fixing the correct file.

dceejay, please see image to see how I have changed the line.

port mod

I will remove to process.env.PORT and leave the number as you have instructed and get back to you.

thank you

changing the uiport line to this, seems to stop node-red listening all together.

port mod

thanks

Remove the || as well - otherwise it isn't a valid javascript statement.

Hi Knolleary,

Ah thank you silly me. and big thanks to dceejay this has worked.

many thanks

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.