# Docker Port Mapping

**URL:** <https://discourse.nodered.org/t/docker-port-mapping/45079>\
**Category:** General\
**Created:** [3 May 2021 01:48 UTC](https://discourse.nodered.org/t/docker-port-mapping/45079 "2021-05-03T01:48:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheadehAnank](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@TheadehAnank](https://discourse.nodered.org/u/TheadehAnank)\
**Post date:** [3 May 2021 01:48 UTC](https://discourse.nodered.org/t/docker-port-mapping/45079/1 "2021-05-03T01:48:01Z")

</div>

I'm new to docker, and trying to install Nod-Red in docker using port mapping. Any ideas what I am dowing wrong. The following as expected:

```auto
docker run –restart=unless-stopped -it -p 1880:1880 -v /home/pi/node-red-01:/data --name node-red-01 nodered/node-red:latest

```

But when changing the port mapping, the connection to the web gui fails:

```auto
docker run –restart=unless-stopped -it -p 1880:1881 -v /home/pi/node-red-01:/data --name node-red-01 nodered/node-red:latest

```

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [3 May 2021 02:13 UTC](https://discourse.nodered.org/t/docker-port-mapping/45079/2 "2021-05-03T02:13:08Z")

</div>

Far from a docker export, but I think your second one is saying when a connection comes to 1880 on the host send to 1881 on the container. Assuming you have NR on default 1880 then you are trying to connect to a port without anything listening.

Pretending you are connecting to xyz:1880/ and it works, then you could change your mapping to be 1881:1880 and then xyz:1881/ should work as you would connect to the host port 1881 which would then look to the container as if you were connecting to port 1880.

---

<div class="post-metadata">

**Author:** ![TheadehAnank](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@TheadehAnank](https://discourse.nodered.org/u/TheadehAnank)\
**Post date:** [3 May 2021 13:47 UTC](https://discourse.nodered.org/t/docker-port-mapping/45079/3 "2021-05-03T13:47:11Z")

</div>

Thank you. I was staring at the command line too long yesterday

---

<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:** [2 July 2021 13:47 UTC](https://discourse.nodered.org/t/docker-port-mapping/45079/4 "2021-07-02T13:47:42Z")

</div>

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