This repository provides an Ansible playbook to setup the ChirpStack open-source LoRaWAN Network Server (v4) on a single VM (e.g. on DigitalOcean).
It will:
- Setup firewall rules (iptables)
- Setup Mosquitto (MQTT broker) + client and server-certificate configuration
- Setup Redis
- Setup PostgreSQL + creation of role and database
- Setup ChirpStack Gateway Bridge for UDP
- Setup ChirpStack Gateway Bridge for Basics Station
- Setup ChirpStack
- Request a HTTPS certificate from Let's Encrypt
This playbook has been tested on DigitalOcean.com but should also work on bare-metal, AWS and other cloud-providers.
Don't have a DigitalOcean account yet? Use this link and get $10 in credits for free :-)
443: ChirpStack UI and gRPC API (with TLS, e.g. https://subdomain.example.com/)1700: ChirpStack Gateway Bridge UDP listener (configured for EU868 region by default)3001: ChirpStack Gateway Bridge Basics Station listener (configured for EU868 region by default, with TLS, client-certificate files can be generated in the ChirpStack UI)8883: Mosquitto MQTT (with TLS, client-certificate files can be generated in the ChirpStack UI)
On the machine from where you will execute this Ansible playbook (e.g. your own
computer), make sure you have a recent Ansible version installed. You can install Ansible with
pip (pip install ansible), using Homebrew (OS X) (brew install ansible) or using
a package manager (e.g. apt install ansible). Refer to the Ansible installation guide
for more installation instructions.
The Ansible playbook has been tested on the following images:
- Debian 13
- Ubuntu 26.04 (LTS)
-
Create a new Debian or Ubuntu instance and make sure that from your own machine on which Ansible is installed, you can ssh to this machine using public-key authentication (e.g.
ssh user@ip). -
Configure a DNS record for your target instance and wait until this record resolves to your IP address.
-
Copy the
inventory.exampleinside this repository toinventoryand replaceexample.comwith the hostname created in step 2. -
Copy the
group_vars/chirpstack.example.ymlinside this repository togroup_vars/chirpstack.ymland change the settings where needed.
For more information, see also:
Run the following command from your machine to deploy ChirpStack to your target instance, to upgrade to the latest versions or to update the configuration:
ansible-playbook -i inventory deploy.ymlAfter the playbook has been completed, ChirpStack should be accessible from
the domain you configured as fqdn in the group_vars/chirpstack.yml.