# Using serial port on docker

**URL:** <https://discourse.nodered.org/t/using-serial-port-on-docker/83573>\
**Category:** General\
**Tags:** docker\
**Created:** [10 December 2023 11:56 UTC](https://discourse.nodered.org/t/using-serial-port-on-docker/83573 "2023-12-10T11:56:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![poitf098](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/poitf098/32/85691_2.png) [@poitf098](https://discourse.nodered.org/u/poitf098)\
**Post date:** [10 December 2023 11:56 UTC](https://discourse.nodered.org/t/using-serial-port-on-docker/83573/1 "2023-12-10T11:56:33Z")

</div>

How can I configure serial communication, specifically with an Arduino device, within a Node-RED Docker container using the provided docker-compose.yml file?

this is my docker-compose.yml

```auto
version: "3"

services:
  node-red:
    image: nodered/node-red:latest
    environment:
      - TZ = Asia/Jakarta
      - NODE_RED_ADMIN_PW=${NODE_RED_PW_1}
    container_name: secure_noderedx
    ports:
      - "1880:1880"
      - "1883:1883"
    command:
      - "/settings/settings.js"
    volumes:
      - volume_server_1:/data
      - ./settings/settings.js:/data/settings.js
    devices:
      - /dev/ttyACM0
    env_file:
      - .env
  influxdb:
    container_name: influxdb
    image: influxdb:latest
    environment:
      - TZ = Asia/Jakarta
    volumes:
      - influxdb-lib:/var/lib/influxdb2
    env_file:
      # BE SURE TO CHANGE THIS LINE BEFORE GOING TO PRODUCTION
      - ./influx2.env
    ports:
      - 8086:8086
    restart: always
    privileged: true

  grafana:
    container_name: grafana
    image: grafana/grafana:latest
    volumes:
      # Note: The 'ro' option specifies that the volume is mounted in read-only mode.
      # However, certain files such as grafana.ini may require write access. Be mindful of security implications when removing ':ro'.
      # Docs : https://docs.docker.com/compose/compose-file/compose-file-v3/#short-syntax-3
      - grafana-lib:/var/lib/grafana
      - grafana-log:/var/log/grafana
    links:
      - influxdb:influxdb
    env_file:
      # BE SURE TO CHANGE THIS LINE BEFORE GOING TO PRODUCTION
      - ./grafana.env
    ports:
      - 3000:3000
    depends_on:
      - influxdb
    restart: always
    privileged: true

volumes:
  volume_server_1:
  influxdb-lib:
    external: false

  grafana-lib:
    external: false

  grafana-log:
    external: false

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 December 2023 14:28 UTC](https://discourse.nodered.org/t/using-serial-port-on-docker/83573/2 "2023-12-10T14:28:43Z")

</div>

A docker question, not really a Node-RED one?

> **[docker access host serial port - Bing](https://www.bing.com/search?q=docker%2Baccess%2Bhost%2Bserial%2Bport)**
>
> Intelligent search from Bing makes it easier to quickly find what you’re looking for and rewards you.

---

<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 February 2024 14:29 UTC](https://discourse.nodered.org/t/using-serial-port-on-docker/83573/3 "2024-02-08T14:29:09Z")

</div>

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