The following configuration is optimized for using MCU devices like Arduino that communicate via serial data with a Docker container. Refer to the original documentation for further information.
Compose File
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
# Adjusted to match your server's structured app data folder
- /DATA/AppData/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
restart: unless-stopped
privileged: true
network_mode: host
devices:
# This is the crucial bridge for your Arduino!
# (We will verify this exact path in Step 1 below)
- /dev/ttyACM0:/dev/ttyACM0
environment:
TZ: Europe/IstanbulStep 1: Find Your Arduino’s Exact Address
Before you deploy this in Dockhand, we need to make sure /dev/ttyACM0 is actually the correct name for your Arduino. Depending on the specific Arduino board (Uno, Mega, Nano) and its serial chip, Ubuntu might name it differently.
-
Plug the Arduino into a USB port on your server.
-
Open your Mac terminal, SSH into your server (
ssh filika@192.168.1.6), and run this command to list attached serial devices:ls /dev/ttyA* /dev/ttyU* -
You will see a result like
/dev/ttyACM0or/dev/ttyUSB0. -
Update the
devices:block in the YAML code above to match exactly what your terminal outputs.
Step 2: Deploy in Dockhand
-
Go to your Dockhand Dashboard.
-
Create a New Stack and name it something like
home-assistant. -
Paste the completed YAML code into the raw text editor.
-
Click Deploy.
How to Connect it Inside Home Assistant
Because we kept network_mode: host and privileged: true (which are officially required by Home Assistant for auto-discovery features), and explicitly mapped the USB device, your Arduino is fully exposed to the container.
Once Home Assistant boots up (access it at http://<ip_address>:8123):
-
Go to Settings -> Devices & Services.
-
Click Add Integration.
-
Search for the specific protocol you are using to flash/control the Arduino. The most popular and powerful integrations for this are ESPHome or Firmata.
-
When it asks for the serial port, you can select the
/dev/tty...path you mapped!