Install ChirpStack
-
Install required packages for ChirpStack (MQTT broker and Redis):
sudo apt install \mosquitto \mosquitto-clients \redis-server \redis-tools -
Install the GPG tool for verifying package signatures:
sudo apt install gpg -
Create the directory for APT keyrings if it doesn't exist:
sudo mkdir -p /etc/apt/keyrings/ -
Download and add the ChirpStack repository GPG key:
sudo sh -c 'wget -q -O - https://artifacts.chirpstack.io/packages/chirpstack.key | gpg --dearmor > /etc/apt/keyrings/chirpstack.gpg' -
Add the ChirpStack repository to the APT sources list:
echo "deb [signed-by=/etc/apt/keyrings/chirpstack.gpg] https://artifacts.chirpstack.io/packages/4.x/deb stable main" | sudo tee /etc/apt/sources.list.d/chirpstack.list -
Update the package list and install the ChirpStack package (SQLite variant):
sudo apt updatesudo apt install chirpstack-sqlite -
Create the
/var/lib/chirpstackdirectory and the SQLite database file with proper ownership:sudo mkdir -p /var/lib/chirpstacksudo chown chirpstack:chirpstack /var/lib/chirpstacksudo chmod 0750 /var/lib/chirpstacksudo install -o chirpstack -g chirpstack -m 0640 /dev/null /var/lib/chirpstack/chirpstack.sqlite -
Write the ChirpStack configuration file:
cat << 'EOF' | sudo tee /etc/chirpstack/chirpstack.toml > /dev/null[logging]level = "info"[sqlite]path="sqlite:///var/lib/chirpstack/chirpstack.sqlite"pragmas=["busy_timeout = 1000","foreign_keys = ON",][redis]servers = ["redis://localhost/"]cluster = false[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",][api]bind = "0.0.0.0:8080"secret = "you-must-replace-this"[integration]enabled = ["mqtt"][integration.mqtt]server = "tcp://localhost:1883/"json = trueEOF -
Generate and set a random secret key in the ChirpStack configuration:
sudo chown chirpstack:chirpstack /etc/chirpstack/chirpstack.tomlsudo chmod 0640 /etc/chirpstack/chirpstack.tomlsudo sed -i "s|secret = \"you-must-replace-this\"|secret = \"$(openssl rand -base64 32)\"|" /etc/chirpstack/chirpstack.toml -
Enable and start the ChirpStack service:
sudo systemctl enable --now chirpstack-sqlite -
Check the service logs to verify successful startup:
sudo journalctl -fu chirpstack-sqlite -
Now, you can access ChirpStack at this address:
http://[TARGET IP ADDRESS]:8080/dangerThe default login is
admin/admin. Change this password before exposing the device on any shared network.