# Change Node-red dash port number

**URL:** <https://discourse.nodered.org/t/change-node-red-dash-port-number/22580>\
**Category:** Dashboard\
**Created:** [3 March 2020 19:14 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580 "2020-03-03T19:14:11Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [3 March 2020 19:14 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/1 "2020-03-03T19:14:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [3 March 2020 19:40 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/2 "2020-03-03T19:40:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 06:50 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/3 "2020-03-04T06:50:55Z")

</div>

![settingsJS](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b90e5c5358cbf72de5296c4d76be37d244892f8e.png)

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.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [4 March 2020 07:31 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/4 "2020-03-04T07:31:43Z")

</div>

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](https://nodered.org/docs/getting-started/local#running)

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 07:49 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/5 "2020-03-04T07:49:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [4 March 2020 07:55 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/6 "2020-03-04T07:55:20Z")

</div>

> [@AUsername](#):
>
> sudo snap enable node-red -p 1980

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? 😅

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 07:59 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/7 "2020-03-04T07:59:33Z")

</div>

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 😄

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

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [4 March 2020 08:05 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/8 "2020-03-04T08:05:49Z")

</div>

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. 🙈

You could try something like `snap logs node-red` to view the logs. 🤔

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 March 2020 08:21 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/9 "2020-03-04T08:21:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 08:28 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/10 "2020-03-04T08:28:46Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/495bc7006675d40c7841cbc4bf46adbaf37d5001.png)

I then restarted node-red snap restart node-red

unfortunately node-red is still listening to port 1880 😕

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 March 2020 09:11 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/11 "2020-03-04T09:11:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 09:23 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/12 "2020-03-04T09:23:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 March 2020 10:30 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/13 "2020-03-04T10:30:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 10:33 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/14 "2020-03-04T10:33:19Z")

</div>

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

![port mod](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/729eeb9918af4d1cbfd6117e6ff6b942661daf09.png)

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

thank you

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 10:37 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/15 "2020-03-04T10:37:43Z")

</div>

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

![port mod](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4beef30fa31c995a6cca4fd5fabee74cd10b176d.png)

thanks

---

<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:** [4 March 2020 10:38 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/16 "2020-03-04T10:38:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AUsername](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@AUsername](https://discourse.nodered.org/u/AUsername)\
**Post date:** [4 March 2020 10:42 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/17 "2020-03-04T10:42:29Z")

</div>

Hi Knolleary,

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

many thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 March 2020 10:50 UTC](https://discourse.nodered.org/t/change-node-red-dash-port-number/22580/18 "2020-03-18T10:50:50Z")

</div>

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