# TCP Server Issue with Docker

**URL:** <https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658>\
**Category:** General\
**Tags:** docker\
**Created:** [17 January 2024 14:14 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658 "2024-01-17T14:14:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![IoTG](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@IoTG](https://discourse.nodered.org/u/IoTG)\
**Post date:** [17 January 2024 14:14 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658/1 "2024-01-17T14:14:03Z")

</div>

New to Node-Red but learning from the last few days.

Here is my setup and my issue. I would appreciate it if someone guided me on what I miss here.

My Ubuntu server IP address is - 192.168.1.34  
My Node-Red is running as Docker Compose on port # 8123

My setup is listed in the image. I am able to establish communication on localhost, and everything is working as expected. Still, I like to make sure my IP address 192.168.1.34 on port 2000 should work so other computers in my network can communicate with my node-red TCP server on port 2000.

Can you please let me know what I am missing here in the setup?

(Firewall is whitelisted in local same network)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8bcc92014250d2e915c4bd164656f481ae17817d.png)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [17 January 2024 14:20 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658/2 "2024-01-17T14:20:38Z")

</div>

Welcome to the forums @IoTG

I am afraid this is more for the Docker expert community, most here do not use docker for their Node RED.

A hint will be, to setup your docker container with an interface that is within your local lan.  
I don't know the correct terminology, but I'm sure the docker community will

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 January 2024 15:44 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658/3 "2024-01-17T15:44:27Z")

</div>

Also, generally the advise is not to use docker unless you have a good reason.

---

<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:** [17 January 2024 15:47 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658/4 "2024-01-17T15:47:23Z")

</div>

as well as exposing Node-RED on port 8213 you will need to add tcp port 2000 to the compose ports section to allow it to be seen on the host - and thence externally.

---

<div class="post-metadata">

**Author:** ![Madjarx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/madjarx/32/87412_2.png) [@Madjarx](https://discourse.nodered.org/u/Madjarx)\
**Post date:** [17 January 2024 16:00 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658/5 "2024-01-17T16:00:11Z")

</div>

Yeah, docker networking is quite complex. Do `docker exec -it <nodered_container_id> sh` and try pinging entities in the outside world. Networks act differently on Linux / Mac / Windows for whatever reason (might be the daemon itself). Let us know the results here so we might be able to help you furthermore.

I had quite some issues with getting nodeRED connected to the outside world when running it with docker.

---

<div class="post-metadata">

**Author:** ![IoTG](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@IoTG](https://discourse.nodered.org/u/IoTG)\
**Post date:** [17 January 2024 16:29 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658/6 "2024-01-17T16:29:56Z")

</div>

Thank you. This was the answer.

It worked.

---

<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:** [31 January 2024 16:30 UTC](https://discourse.nodered.org/t/tcp-server-issue-with-docker/84658/7 "2024-01-31T16:30:31Z")

</div>

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