# Multiple Docker Node-RED containers without orphan containers

**URL:** <https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176>\
**Category:** General\
**Created:** [8 July 2021 11:34 UTC](https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176 "2021-07-08T11:34:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DuncanCT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duncanct/32/41639_2.png) [@DuncanCT](https://discourse.nodered.org/u/DuncanCT)\
**Post date:** [8 July 2021 11:34 UTC](https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176/1 "2021-07-08T11:34:43Z")

</div>

I'm trying to run multiple docker container, see compose file below...

```auto
version: "3.7"

services:
  node-red:
    image: nodered/node-red:latest
    environment:
      - TZ=Europe/Amsterdam
    ports:
      - "1880:1880"
    networks:
      - node-red-net
    volumes:
      - node-red-data:/data

volumes:
  node-red-data:

networks:
  node-red-net:

```

and

```auto
version: "3.7"

services:
  node-red-dev:
    image: nodered/node-red:latest
    environment:
      - TZ=Europe/Amsterdam
    ports:
      - "1881:1880"
    networks:
      - node-red-dev-net
    volumes:
      - node-red-dev-data:/data

volumes:
  node-red-dev-data:

networks:
  node-red-dev-net:

```

After running compose up I'm getting "Found orphan containers". Have read that correct way to fix this is specify Project Name. I don't fully understand the all of this but would the correct way be to specify the same project name for both containers or individual project names?

---

<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:** [8 July 2021 13:28 UTC](https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176/2 "2021-07-08T13:28:03Z")

</div>

Well by default the project is the based on the directory name containing the compose file - so either they need to be in different directories. (or use the -p projectname flag when you start it up - yes they need to be different)

However I would normally put both servers within the same compose file so I know they would share a network and it all gets set up etc... - but maybe that isn't what you want.

---

<div class="post-metadata">

**Author:** ![DuncanCT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duncanct/32/41639_2.png) [@DuncanCT](https://discourse.nodered.org/u/DuncanCT)\
**Post date:** [8 July 2021 14:11 UTC](https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176/3 "2021-07-08T14:11:48Z")

</div>

Thank you, any assistance is greatly appreciated.

Can you define project name in the compose file, from a search it doesn't seem possible. If that is the case then how can you differentiate projects if you are using Docker compose.

Also is it possible to view the project name one a container has been created? "eg sudo docker project-name ls" as an example.

This might all make no sense to someone who knows what they are talking about. 🤣

---

<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:** [8 July 2021 14:58 UTC](https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176/4 "2021-07-08T14:58:42Z")

</div>

as I said the project name usually just comes from the directory the compose file is located in... and usually you put all the servers you want inside one single compose file... that is usually the point of compose... to create them all at once.

Or you can use -p on the command line when you call docker-compose...

Once created the containers look like projectname\_servername\_01 etc  
which you should be able to see in the Names column of `docker ps -a`

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [9 July 2021 04:21 UTC](https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176/5 "2021-07-09T04:21:02Z")

</div>

Or install Portainer and you will get much more management and visibility of the containers you are running

Craig

---

<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:** [7 September 2021 04:21 UTC](https://discourse.nodered.org/t/multiple-docker-node-red-containers-without-orphan-containers/48176/6 "2021-09-07T04:21:31Z")

</div>

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