# Port 1880 in use

**URL:** https://discourse.nodered.org/t/port-1880-in-use/62988
**Category:** General
**Created:** [24 May 2022 06:13 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988 "2022-05-24T06:13:17Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)
#### Post date: [24 May 2022 06:13 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/1 "2022-05-24T06:13:17Z")

</div>

Wrote a For Loop in a function node that was erroneous which i accidentally deployed, thereafter node-red went unresponsive, saw the infinite for loop output that was being displayed in node-red console. Used the command "node-red-stop" and restarted node-red again but it shows the error: port in use message. Restarted my raspberry pi and also my Windows laptop, but it still does not work. How can I resolve this issue?

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [24 May 2022 06:38 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/2 "2022-05-24T06:38:33Z")

</div>

If you get 'error: port already in use' it means node-red is already running.  
Kill it first:

`ps -e | grep -i node-red`  
make note of the first number in the first line it returns.  
`kill <number>`

Then you can start it in safe mode with `node-red --safe`, fix the flows and redeploy.

---

<div class="post-metadata">

### Author: ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)
#### Post date: [24 May 2022 07:24 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/3 "2022-05-24T07:24:10Z")

</div>

Oddly enough typing the code in terminal

```auto
ps -e | grep -i node-red

```

returned nothing though. Did i do something wrong?

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [24 May 2022 07:26 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/4 "2022-05-24T07:26:58Z")

</div>

can you type `top` in the terminal and check if you see node-red ?

if not, you can try the --safe option.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [24 May 2022 07:30 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/5 "2022-05-24T07:30:53Z")

</div>

windows.....

Will that command work?

Ok, sorry. A RasPi is also mentioned.

But it isn't clear on which one NR is running.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [24 May 2022 07:32 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/6 "2022-05-24T07:32:03Z")

</div>

> raspberry pi

i assume node-red is running there, @Razz can clarify.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [24 May 2022 07:34 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/7 "2022-05-24T07:34:57Z")

</div>

Yeah, sorry. I read it and saw _windows_ mentioned..... That may need clarifying.

Just sometimes it is the silly things that trap us.

Especially when I saw:

> returned nothing though. Did i do something wrong?

Maybe `ps` is not installed on that machine.

---

<div class="post-metadata">

### Author: ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)
#### Post date: [24 May 2022 08:16 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/8 "2022-05-24T08:16:47Z")

</div>

Sorry, still a new user to Node-red and Linux.

Was running NR previously on both Windows and on Raspberry Pi.

Ran `top` , did not explicitly see NR running, only see 2 "Node" in the command line.

How do i also make sure that ps is installed?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [24 May 2022 08:40 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/9 "2022-05-24T08:40:50Z")

</div>

> [@Razz](#):
>
> How do i also make sure that ps is installed?

If you got no error, then `ps` is installed.

To see what has port 1880, try these...

```auto
sudo lsof | grep 1880
sudo ss -tulpn | grep :1880

```

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 May 2022 08:43 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/10 "2022-05-24T08:43:31Z")

</div>

Node-red is set to start up automatically when the machine is booted so if you rebooted after killing it, it would start up again.

You can see which process is using port 1880 with the command  
**ss -ltnup 'sport = :1880'**  
Assuming that ss is installed of course.

I doubt if any Linux system does not have ps installed, but you can tell by typing **ps** and enter!

Once you have identified and killed the application using port 1880, you can start up Node -red in safe mode to investigate further.

PS quick draw Steve beat me to it!

---

<div class="post-metadata">

### Author: ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)
#### Post date: [24 May 2022 08:58 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/11 "2022-05-24T08:58:24Z")

</div>

Thank you for the replies everybody,

When using the command

```auto
sudo lsof | grep 1880
sudo ss -tulpn | grep :1880

```

it returned the following below,

```auto
pi@raspberrypi:~ $ sudo lsof | grep 1880
sudo ss -tulpn | grep :1880
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
node 1914 pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1919 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1920 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1921 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1922 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1923 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1925 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1926 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1927 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1928 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
node 1914 1929 node pi 20u IPv4 22921 0t0 TCP *:1880 (LISTEN)
tcp LISTEN 0 511 0.0.0.0:1880 0.0.0.0:* users:(("node",pid=1914,fd=20))                      
pi@raspberrypi:~ $ ss -ltnup 'sport = :1880'
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process                   
tcp LISTEN 0 511 0.0.0.0:1880 0.0.0.0:*                                                

```

Am i supposed to close all of these? If so how can i go about doing it?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [24 May 2022 08:59 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/12 "2022-05-24T08:59:51Z")

</div>

> [@Razz](#):
>
> Am i supposed to close all of these?

No, just the parent (1914)

---

<div class="post-metadata">

### Author: ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)
#### Post date: [24 May 2022 09:15 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/13 "2022-05-24T09:15:17Z")

</div>

By parent I'm assuming the foremost one? How do I close it then?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [24 May 2022 09:17 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/14 "2022-05-24T09:17:08Z")

</div>

`sudo kill 1914`

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [24 May 2022 09:19 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/15 "2022-05-24T09:19:01Z")

</div>

If the process ignores that command, follow up with  
sudo kill -9 1914

---

<div class="post-metadata">

### Author: ![struland](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/struland/32/58587_2.png) [@struland](https://discourse.nodered.org/u/struland)
#### Post date: [24 May 2022 18:56 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/16 "2022-05-24T18:56:38Z")

</div>

I had a similar problem. After a while I figured out, that I had startet node-red with PM2 and forgot about it.

---

<div class="post-metadata">

### Author: ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)
#### Post date: [25 May 2022 09:21 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/17 "2022-05-25T09:21:25Z")

</div>

Ah yes, the issue has since been resolved with this command, thanks to Steve and everyone.

---

<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: [8 June 2022 09:22 UTC](https://discourse.nodered.org/t/port-1880-in-use/62988/18 "2022-06-08T09:22:16Z")

</div>

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