### Network configuration TOML example Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Example TOML for the `[regions.network]` section, showing default values for installation margin, RX windows, data rates, and frequencies. Use as a template for configuring network parameters. ```toml [regions.network] installation_margin=10 rx_window=0 rx1_delay=1 rx1_dr_offset=0 rx2_dr=0 rx2_frequency=869525000 rx2_prefer_on_rx1_dr_lt=0 rx2_prefer_on_link_budget=false downlink_tx_power=-1 adr_disabled=false min_dr=0 max_dr=5 ``` -------------------------------- ### Start ChirpStack with docker compose up Source: https://github.com/chirpstack/chirpstack-docker/blob/master/README.md Starts the ChirpStack services defined in the docker-compose.yml file. After initialization, the web UI is available at http://localhost:8080/. ```bash $ docker compose up ``` -------------------------------- ### Import device profiles with make Source: https://github.com/chirpstack/chirpstack-docker/blob/master/README.md Run this command to import the chirpstack-device-profiles repository. Requires the make command to be installed. ```bash make import-device-profiles ``` -------------------------------- ### Rejoin-request configuration TOML example Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Example TOML for the `[regions.network.rejoin_request]` section, with defaults for enabling rejoin-requests and limits. Use for LoRaWAN 1.1 devices. ```toml [regions.network.rejoin_request] enabled=false max_count_n=0 max_time_n=0 ``` -------------------------------- ### Class-B configuration TOML example Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Example TOML for the `[regions.network.class_b]` section, showing ping-slot data rate and frequency settings. ```toml [regions.network.class_b] ping_slot_dr=3 ping_slot_frequency=0 ``` -------------------------------- ### Run ChirpStack with docker compose Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Starts the ChirpStack service with environment variables for PostgreSQL, Redis, and MQTT broker hosts. Useful for verifying the effective configuration. ```bash POSTGRESQL_HOST=postgres REDIS_HOST=redis MQTT_BROKER_HOST=mosquitto \ docker compose up chirpstack ``` -------------------------------- ### Extra channels configuration TOML example Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Example TOML for the `[[regions.network.extra_channels]]` section, showing a single extra channel entry. Present only in `region_eu868.toml` with 5 entries. ```toml [[regions.network.extra_channels]] frequency=867100000 min_dr=0 max_dr=5 ``` -------------------------------- ### Makefile target: import-device-profiles Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/support-services.md Runs a one-off container to clone the chirpstack-device-profiles repository and import device profiles into the database. Invoke with 'make import-device-profiles'. Installs git via apk and runs the chirpstack import command. ```makefile import-device-profiles: docker compose run --rm --entrypoint sh --user root chirpstack -c '\ apk add --no-cache git && \ git clone https://github.com/chirpstack/chirpstack-device-profiles.git /tmp/chirpstack-device-profiles && \ chirpstack -c /etc/chirpstack import-device-profiles -d /tmp/chirpstack-device-profiles' ``` -------------------------------- ### Network and region configuration in chirpstack.toml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Example TOML for the [network] section. Required keys: net_id (3-byte NetID as HEX) and enabled_regions (array of region IDs). Each region ID must match the id of a [[regions]] block in region_*.toml files. ```toml [network] net_id="000000" enabled_regions=[ "as923", "as923_2", "as923_3", "as923_4", "au915_0", "cn470_10", "cn779", "eu433", "eu868", "in865", "ism2400", "kr920", "ru864", "us915_0", "us915_1", ] ``` -------------------------------- ### Redis connection configuration in chirpstack.toml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Example TOML for the [redis] section. Required keys: servers (array of Redis URLs), tls_enabled (bool), and cluster (bool). Set cluster to true when connecting to a Redis Cluster instance. ```toml [redis] servers=[ "redis://$REDIS_HOST/", ] tls_enabled=false cluster=false ``` -------------------------------- ### API interface configuration in chirpstack.toml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Example TOML for the [api] section. Required keys: bind (interface:port) and secret (used for generating login and API tokens). Changing the secret invalidates all tokens; the source recommends generating it with openssl rand -base64 32. ```toml [api] bind="0.0.0.0:8080" secret="you-must-replace-this" ``` -------------------------------- ### PostgreSQL bootstrap script (001-chirpstack_extensions.sh) Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/support-services.md Initializes the ChirpStack database extensions on first PostgreSQL volume initialization. Runs with set -e and ON_ERROR_STOP=1 to abort on SQL errors. Creates pg_trgm and hstore extensions, required by ChirpStack. ```bash #!/bin/bash set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="$POSTGRES_DB" <<-EOSQL create extension pg_trgm; create extension hstore; EOSQL ``` -------------------------------- ### Basics Station EU868 configuration (chirpstack-gateway-bridge-basicstation-eu868.toml) Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/gateway-bridge.md Canonical configuration for the ChirpStack Gateway Bridge Basics Station backend, quoted from `chirpstack-gateway-bridge-basicstation-eu868.toml`. It sets MQTT topic templates with placeholders, enables the `basic_station` backend, and defines the EU868 concentrator channels including multi-SF, LoRa standard, and FSK tables. ```toml [integration.mqtt.auth.generic] servers=["tcp://mosquitto:1883"] username="" password="" [integration.mqtt] event_topic_template="eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }}" state_topic_template="eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }}" command_topic_template="eu868/gateway/{{ .GatewayID }}/command/#" [backend] type="basic_station" [backend.basic_station] bind=":3001" tls_cert="" tls_key="" ca_cert="" region="EU868" frequency_min=863000000 frequency_max=870000000 [[backend.basic_station.concentrators]] [backend.basic_station.concentrators.multi_sf] frequencies=[ 868100000, 868300000, 868500000, 867100000, 867300000, 867500000, 867700000, 867900000, ] [backend.basic_station.concentrators.lora_std] frequency=868300000 bandwidth=250000 spreading_factor=7 [backend.basic_station.concentrators.fsk] frequency=868800000 ``` -------------------------------- ### Enable a new region: region_kr920.toml and chirpstack.toml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Add a region table in a region file and list its id in enabled_regions. The region file defines the gateway backend with MQTT settings. The chirpstack.toml enables the region by adding its id to the enabled_regions list. ```toml # configuration/chirpstack/region_kr920.toml [[regions]] id="kr920" description="KR920" common_name="KR920" [regions.gateway.backend] enabled="mqtt" [regions.gateway.backend.mqtt] topic_prefix="kr920" server="tcp://$MQTT_BROKER_HOST:1883" ``` ```toml # configuration/chirpstack/chirpstack.toml [network] enabled_regions=[ "...", "kr920", ] ``` -------------------------------- ### GitHub sponsor funding configuration (FUNDING.yml) Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/support-services.md Links the GitHub sponsor button to the 'chirpstack' account. Simple one-line configuration for repository funding. ```text github: chirpstack ``` -------------------------------- ### chirpstack.toml [integration] section Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Configuration for enabling MQTT integration and setting the broker server URL with JSON mode enabled. The server URL uses the MQTT_BROKER_HOST environment variable. ```toml [integration] enabled=["mqtt"] [integration.mqtt] server="tcp://$MQTT_BROKER_HOST:1883/" json=true ``` -------------------------------- ### Gateway backend configuration [regions.gateway] Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Configures the gateway backend, including MQTT connection settings. The topic_prefix defaults to the region id and no trailing slash is needed. The server scheme can be tcp, ssl, or ws. QoS levels: 0 at most once, 1 at least once, 2 exactly once. Empty client_id generates a random id. ```toml [regions.gateway] force_gws_private=false [regions.gateway.backend] enabled="mqtt" [regions.gateway.backend.mqtt] topic_prefix="eu868" server="tcp://$MQTT_BROKER_HOST:1883" username="" password="" qos=0 clean_session=false client_id="" keep_alive_interval="30s" ca_cert="" tls_cert="" tls_key="" ``` -------------------------------- ### postgres service definition (docker-compose.yml) Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the PostgreSQL 14 service using the postgres:14-alpine image. Mounts an initdb directory to run 001-chirpstack_extensions.sh on first init and a named volume for persistent data. Environment variables must match the postgresql.dsn settings in chirpstack.toml. ```yaml postgres: image: postgres:14-alpine restart: unless-stopped volumes: - ./configuration/postgresql/initdb:/docker-entrypoint-initdb.d - postgresqldata:/var/lib/postgresql/data environment: - POSTGRES_USER=chirpstack - POSTGRES_PASSWORD=chirpstack - POSTGRES_DB=chirpstack ``` -------------------------------- ### Configure PostgreSQL connection pool Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Configures the PostgreSQL connection pool. The DSN uses the format postgres://:@/?sslmode=; sslmode options are disable, prefer, and require. max_open_connections defaults to 10, min_idle_connections defaults to 0 (equal to max_open_connections). ```toml [postgresql] dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=disable" max_open_connections=10 min_idle_connections=0 ``` -------------------------------- ### Run bridge with trace logging Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/gateway-bridge.md Runs the bridge inside the Docker container with trace logging to verify the parsed topic template. Uses the EU868 configuration file. ```bash docker compose exec chirpstack-gateway-bridge-basicstation \ chirpstack-gateway-bridge -c /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge-basicstation-eu868.toml --log-level trace ``` -------------------------------- ### mosquitto service definition (docker-compose.yml) Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the Eclipse Mosquitto 2 MQTT broker service. Publishes port 1883 for MQTT TCP and mounts the configuration directory to supply mosquitto.conf. ```yaml mosquitto: image: eclipse-mosquitto:2 restart: unless-stopped ports: - "1883:1883" volumes: - ./configuration/mosquitto/config/:/mosquitto/config/ ``` -------------------------------- ### PostgreSQL TLS configuration in chirpstack.toml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Sets the PostgreSQL DSN to require TLS via the sslmode=require parameter. This is a non-trivial option for securing the database connection. ```toml [postgresql] dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=require" ``` -------------------------------- ### Secure MQTT gateway backend with TLS and client certificates Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Configure the MQTT gateway backend to use SSL with CA and client certificates. This option is non-trivial and applies to every region file. ```toml [regions.gateway.backend.mqtt] server="ssl://$MQTT_BROKER_HOST:8883" ca_cert="/etc/chirpstack/ca.crt" tls_cert="/etc/chirpstack/client.crt" tls_key="/etc/chirpstack/client.key" ``` -------------------------------- ### chirpstack-gateway-bridge.toml base configuration Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/gateway-bridge.md Base configuration for the ChirpStack Gateway Bridge UDP service. Declares MQTT authentication only; topic templates and backend are injected at runtime via environment variables. ```toml # See https://www.chirpstack.io/gateway-bridge/install/config/ for a full # configuration example and documentation. [integration.mqtt.auth.generic] servers=["tcp://mosquitto:1883"] username="" password="" ``` -------------------------------- ### Configure logging level Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Sets the log level for the ChirpStack server. Allowed values are trace, debug, info, warn, and error. ```toml [logging] level="info" ``` -------------------------------- ### Add second Basics Station bridge service to docker-compose.yml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/gateway-bridge.md Adds a service for a second Basics Station bridge for US915 channel subset 0, using the shipped configuration file. The service exposes port 3002:3001 and depends on the mosquitto service. ```yaml chirpstack-gateway-bridge-basicstation-us915: image: chirpstack/chirpstack-gateway-bridge:4 command: -c /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge-basicstation-us915_0.toml ports: - "3002:3001" volumes: - ./configuration/chirpstack-gateway-bridge:/etc/chirpstack-gateway-bridge depends_on: - mosquitto ``` -------------------------------- ### .gitignore for repository root Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/support-services.md Ignores hidden files except .gitattributes, plus /data and /lorawan-devices directories. The /data ignore aligns with the README note that Docker volumes are used instead of local data. ```text # hidden files, exluding gitattributes .* !.gitattributes # data folder /data /lorawan-devices ``` -------------------------------- ### Mosquitto MQTT listener configuration (mosquitto.conf) Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/support-services.md Configures the MQTT TCP listener on port 1883 with anonymous access enabled. Used by the mosquitto service; matches the Compose port mapping 1883:1883. Authentication is disabled, so security relies on network isolation. ```text listener 1883 allow_anonymous true ``` -------------------------------- ### Basics Station bridge service Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the Basics Station bridge service. It uses the same image as the UDP bridge but selects the eu868 configuration file via the command option; swap for other region files like -as923.toml or -us915_0.toml. It publishes port 3001 for the Basics Station backend and depends on mosquitto. ```yaml chirpstack-gateway-bridge-basicstation: image: chirpstack/chirpstack-gateway-bridge:4 restart: unless-stopped command: -c /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge-basicstation-eu868.toml ports: - "3001:3001" volumes: - ./configuration/chirpstack-gateway-bridge:/etc/chirpstack-gateway-bridge depends_on: - mosquitto ``` -------------------------------- ### Configure TLS termination for Basics Station bridge Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/gateway-bridge.md Configures the bridge to terminate TLS for Basics Station connections, specifying bind address, TLS certificate, key, and CA certificate paths. ```toml [backend.basic_station] bind=":3001" tls_cert="/etc/chirpstack-gateway-bridge/server.crt" tls_key="/etc/chirpstack-gateway-bridge/server.key" ca_cert="/etc/chirpstack-gateway-bridge/ca.crt" ``` -------------------------------- ### redis service definition (docker-compose.yml) Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the Redis 7 service using the redis:7-alpine image. The command enables snapshots after 300 seconds with 1 write and after 60 seconds with 100 writes, with AOF disabled. A named volume persists snapshot data. ```yaml redis: image: redis:7-alpine restart: unless-stopped command: redis-server --save 300 1 --save 60 100 --appendonly no volumes: - redisdata:/data ``` -------------------------------- ### API secret generation in chirpstack.toml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/chirpstack-server.md Shows a source-recommended method for generating the API secret using openssl rand. The secret is set in the [api] section. ```toml [api] secret=$(openssl rand -base64 32) # source-recommended secret generation ``` -------------------------------- ### ChirpStack Network Server service Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the ChirpStack LoRaWAN Network Server service. It binds the configuration directory and sets environment variables for MQTT, Redis, and PostgreSQL hosts. The service depends on postgres, mosquitto, and redis, and publishes port 8080 for the API and Web UI. ```yaml chirpstack: image: chirpstack/chirpstack:4 command: -c /etc/chirpstack restart: unless-stopped volumes: - ./configuration/chirpstack:/etc/chirpstack depends_on: - postgres - mosquitto - redis environment: - MQTT_BROKER_HOST=mosquitto - REDIS_HOST=redis - POSTGRESQL_HOST=postgres ports: - "8080:8080" ``` -------------------------------- ### REST API front-end service Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the REST API front-end service. It connects to the ChirpStack network server via gRPC at chirpstack:8080, binds to port 8090, and uses --insecure to connect without TLS. It publishes port 8090 for the REST API and its UI, and depends on the chirpstack service. ```yaml chirpstack-rest-api: image: chirpstack/chirpstack-rest-api:4 restart: unless-stopped command: --server chirpstack:8080 --bind 0.0.0.0:8090 --insecure ports: - "8090:8090" depends_on: - chirpstack ``` -------------------------------- ### Semtech UDP gateway bridge service Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the Semtech UDP gateway bridge service. It exposes the UDP packet-forwarder port 1700 and mounts the gateway bridge configuration directory. The MQTT topic templates use an 'eu868' prefix that must be edited per region, and the service depends on the mosquitto broker. ```yaml chirpstack-gateway-bridge: image: chirpstack/chirpstack-gateway-bridge:4 restart: unless-stopped ports: - "1700:1700/udp" volumes: - ./configuration/chirpstack-gateway-bridge:/etc/chirpstack-gateway-bridge environment: - INTEGRATION__MQTT__EVENT_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }} - INTEGRATION__MQTT__STATE_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }} - INTEGRATION__MQTT__COMMAND_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/command/# depends_on: - mosquitto ``` -------------------------------- ### Named volumes definition in docker-compose.yml Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/docker-compose.md Defines the named volumes `postgresqldata` and `redisdata` used for persistent storage. The `postgresqldata` volume is mounted at `/var/lib/postgresql/data` for the ChirpStack database, and `redisdata` is mounted at `/data` for Redis snapshots. ```yaml volumes: postgresqldata: redisdata: ``` -------------------------------- ### Gateway channel definition [[regions.gateway.channels]] Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Defines a single channel for the gateway. Only used when the gateway runs the ChirpStack Concentratord daemon; ignored otherwise. For LORA modulation, spreading_factors are required; for FSK, datarate is required. ```toml [[regions.gateway.channels]] frequency=868100000 bandwidth=125000 modulation="LORA" spreading_factors=[7, 8, 9, 10, 11, 12] ``` -------------------------------- ### Region identity table [[regions]] Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/region-configuration.md Defines the region identifier, description, and LoRa Alliance common name. The id must match an entry in enabled_regions in chirpstack.toml and is used as the region file name suffix. ```toml [[regions]] # ID is an user-defined identifier for this region. id="eu868" # Description is a short description for this region. description="EU868" # Common-name refers to the common-name of this region as defined by # the LoRa Alliance. common_name="EU868" ``` -------------------------------- ### .gitattributes line-ending rule Source: https://github.com/chirpstack/chirpstack-docker/blob/master/_autodocs/api-reference/support-services.md Ensures shell scripts are checked out with LF line endings. Applies the 'text eol=lf' attribute to all *.sh files. ```text *.sh text eol=lf ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.