ChirpStack in Docker fails to connect to MQTT

Viewed 17
PS C:\Docker\Chirpstack3> docker ps
CONTAINER ID   IMAGE                                             COMMAND                  CREATED          STATUS          PORTS                                                                                      NAMES
6c4a458e7508   chirpstack/chirpstack-application-server:3.17.9   "/usr/bin/chirpstack…"   4 minutes ago    Up 4 minutes    0.0.0.0:7237->8080/tcp, [::]:7237->8080/tcp, 0.0.0.0:7257->9090/tcp, [::]:7257->9090/tcp   chirpstack3-chirpstack-application-server-1
b14ab71a45ee   chirpstack/chirpstack-network-server:3.13         "/usr/bin/chirpstack…"   46 minutes ago   Up 46 minutes                                                                                              chirpstack-network-server
a4ddf92625b6   chirpstack/chirpstack-gateway-bridge:3.11         "/usr/bin/chirpstack…"   46 minutes ago   Up 46 minutes                                                                                              chirpstack-gateway-bridge
c9d658967fb7   redis:6                                           "docker-entrypoint.s…"   46 minutes ago   Up 46 minutes   6379/tcp                                                                                   chirpstack-redis
9f73a258becd   postgres:12                                       "docker-entrypoint.s…"   46 minutes ago   Up 46 minutes   5432/tcp                                                                                   chirpstack-postgres
3b8b57e46829   eclipse-mosquitto:2.0                             "/docker-entrypoint.…"   46 minutes ago   Up 46 minutes   0.0.0.0:1883->1883/tcp, [::]:1883->1883/tcp


PS C:\Docker\Chirpstack3> docker logs -f chirpstack3-chirpstack-application-server-1
time="2025-10-09T19:38:02.992432573Z" level=info msg="starting ChirpStack Application Server" docs="https://www.chirpstack.io/" version=
time="2025-10-09T19:38:02.992555897Z" level=info msg="storage: setting up storage package"
time="2025-10-09T19:38:02.992560321Z" level=info msg="storage: setup metrics"
time="2025-10-09T19:38:02.992567982Z" level=info msg="storage: setting up Redis client"
time="2025-10-09T19:38:02.992603065Z" level=info msg="storage: connecting to PostgreSQL database"
time="2025-10-09T19:38:02.995886662Z" level=debug msg="sql query executed" args="[]" duration="211.701µs" query="lock table code_migration"
time="2025-10-09T19:38:02.996612847Z" level=debug msg="sql query executed" args="[migrate_to_golang_migrate 2025-10-09 19:38:02.995926202 +0000 UTC m=+0.036123240]" duration="682.327µs" query="\n\t\t\tinsert into code_migration (\n\t\t\t\tid,\n\t\t\t\tapplied_at\n\t\t\t) values ($1, $2)\n\t\t\ton conflict\n\t\t\t\tdo nothing\n\t\t"
time="2025-10-09T19:38:02.998394275Z" level=debug msg="sql query executed" args="[]" duration="240.175µs" query="lock table code_migration"
time="2025-10-09T19:38:02.998707982Z" level=debug msg="sql query executed" args="[validate_multicast_group_devices 2025-10-09 19:38:02.99844976 +0000 UTC m=+0.038646802]" duration="253.076µs" query="\n\t\t\tinsert into code_migration (\n\t\t\t\tid,\n\t\t\t\tapplied_at\n\t\t\t) values ($1, $2)\n\t\t\ton conflict\n\t\t\t\tdo nothing\n\t\t"
time="2025-10-09T19:38:02.999622997Z" level=info msg="storage: applying PostgreSQL data migrations"
time="2025-10-09T19:38:03.005211884Z" level=debug msg="sql query executed" args="[]" duration="229.161µs" query="lock table code_migration"
time="2025-10-09T19:38:03.005897484Z" level=debug msg="sql query executed" args="[migrate_gw_stats 2025-10-09 19:38:03.005242334 +0000 UTC m=+0.045439379]" duration="649.869µs" query="\n\t\t\tinsert into code_migration (\n\t\t\t\tid,\n\t\t\t\tapplied_at\n\t\t\t) values ($1, $2)\n\t\t\ton conflict\n\t\t\t\tdo nothing\n\t\t"
time="2025-10-09T19:38:03.007390401Z" level=debug msg="sql query executed" args="[]" duration="223.158µs" query="lock table code_migration"
time="2025-10-09T19:38:03.007729414Z" level=debug msg="sql query executed" args="[migrate_to_cluster_keys 2025-10-09 19:38:03.007407964 +0000 UTC m=+0.047605012]" duration="318.111µs" query="\n\t\t\tinsert into code_migration (\n\t\t\t\tid,\n\t\t\t\tapplied_at\n\t\t\t) values ($1, $2)\n\t\t\ton conflict\n\t\t\t\tdo nothing\n\t\t"
time="2025-10-09T19:38:03.008650359Z" level=info msg="integration: configuring global integrations"
time="2025-10-09T19:38:03.008903598Z" level=info msg="integration/mqtt: TLS config is empty"
time="2025-10-09T19:38:03.008922303Z" level=info msg="integration/mqtt: connecting to mqtt broker" server="tcp://localhost:1883"
time="2025-10-09T19:38:03.009431605Z" level=error msg="integration/mqtt: connecting to broker error, will retry in 2s: network Error : dial tcp [::1]:1883: connect: connection refused"
time="2025-10-09T19:38:05.011266316Z" level=error msg="integration/mqtt: connecting to broker error, will retry in 2s: network Error : dial tcp [::1]:1883: connect: connection refused"
time="2025-10-09T19:38:07.012532018Z" level=error msg="integration/mqtt: connecting to broker error, will retry in 2s: network Error : dial tcp [::1]:1883: connect: connection refused"
time="2025-10-09T19:38:09.013747052Z" level=error msg="integration/mqtt: connecting to broker error, will retry in 2s: network Error : dial tcp [::1]:1883: connect: connection refused"
time="2025-10-09T19:38:11.014882787Z" level=error msg="integration/mqtt: connecting to broker error, will retry in 2s: network Error : dial tcp [::1]:1883: connect: connection refused"

docker-compose.yml

version: "3"

services:
  chirpstack-gateway-bridge:
    image: chirpstack/chirpstack-gateway-bridge:3.11
    container_name: chirpstack-gateway-bridge
    restart: always
    environment:
      - INTEGRATION=MQTT
      - MQTT_SERVER=tcp://mosquitto:1883
    networks:
      - chirpstack
    depends_on:
      - mosquitto

  chirpstack-network-server:
    image: chirpstack/chirpstack-network-server:3.13
    container_name: chirpstack-network-server
    restart: always
    environment:
      - NET_ID=000000
      - GW_BRIDGE_SERVER=tcp://chirpstack-gateway-bridge:1700
      - POSTGRES_DSN=postgres://chirpstack:chirpstack@postgres/chirpstack_ns?sslmode=disable
      - REDIS_URL=redis://redis:6379
    networks:
      - chirpstack
    depends_on:
      - postgres
      - redis
      - chirpstack-gateway-bridge

  chirpstack-application-server:
    image: chirpstack/chirpstack-application-server:3.17.9
    volumes:
      - ./chirpstack-application-server.toml:/etc/chirpstack-application-server/chirpstack-application-server.toml:ro
    ports:
      - "7237:8080"
      - "7257:9090"
    networks:
      - chirpstack
    depends_on:
      - postgres
      - redis

  postgres:
    image: postgres:12
    container_name: chirpstack-postgres
    restart: always
    environment:
      POSTGRES_USER: chirpstack
      POSTGRES_PASSWORD: chirpstack
      POSTGRES_DB: chirpstack_as
    networks:
      - chirpstack

  redis:
    image: redis:6
    container_name: chirpstack-redis
    restart: always
    networks:
      - chirpstack

  mosquitto:
    image: eclipse-mosquitto:2.0
    container_name: chirpstack-mosquitto
    restart: always
    ports:
      - "1883:1883"
    networks:
      - chirpstack

networks:
  chirpstack:
    driver: bridge
1 Answers

I'm not sure why you would want to setup a new v3 environment, as it is no longer being updated. I would recommend using this example: https://github.com/chirpstack/chirpstack-docker/.

That being said, the issue is in your configuration. Your integration is configured to point to localhost:1883, which should most likely be mosquitto:1883:

time="2025-10-09T19:38:03.008922303Z" level=info msg="integration/mqtt: connecting to mqtt broker" server="tcp://localhost:1883"