Try this for your compose.
services:
# python-matter-server
matter-server:
image: ghcr.io/home-assistant-libs/python-matter-server:stable
container_name: matter-server
restart: unless-stopped
# Required for mDNS to work correctly
network_mode: host
security_opt:
# Needed for Bluetooth via dbus
- apparmor:unconfined
volumes:
# Create an .env file that sets the USERDIR environment variable.
- ${USERDIR:-$HOME}/docker/appdata/matter-server/data:/data/
# Required for Bluetooth via D-Bus
- /run/dbus:/run/dbus:ro
# If you adjust command line, make sure to pass the default CMD arguments too:
#command: --storage-path /data --paa-root-cert-dir /data/credentials --bluetooth-adapter 0
sysctls: # Necessary for the container to receive the routes from the remote Thread network managed by my Google Nest Hub.
net.ipv6.conf.eth0.accept_ra: 2
net.ipv6.conf.eth0.accept_ra_rt_info_max_plen: 64
net.ipv6.conf.eth0.forwarding: 1