Skip to content
The Things Network Stack V2
Branch: develop
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.env Add DNS names for docker-compose to certs Sep 27, 2018
.github Update README, CONTRIBUTING and ISSUE_TEMPLATE May 4, 2017
amqp Add details to mqtt/amqp errors May 4, 2017
api Get dependencies of api module May 16, 2019
cmd Add NS flag to force ADR optimizations Mar 6, 2019
core Make NetworkServer keep track of Initial ADR ACK Jul 5, 2019
mqtt Get dependencies of mqtt module May 16, 2019
ttnctl Update Go to 1.11 and Alpine to 3.8; fix fmt/vet issues Sep 26, 2018
utils Make utils/toa a Go 1.11 module May 20, 2019
.editorconfig Add editorconfig Jul 29, 2016
.gitignore Migrate Vendors Sep 28, 2016
.gitlab-ci.yml Cache Go modules in CI May 17, 2019
.travis.yml Cache Go modules in CI May 17, 2019
AUTHORS several fixes after mobing out api stuff Aug 24, 2017
Brewfile Replaced Mosquitto by RabbitMQ Oct 21, 2016 Add issues to CONTRIBUTING May 4, 2017
Dockerfile Update Go to 1.11 and Alpine to 3.8; fix fmt/vet issues Sep 26, 2018
LICENSE Add license file Dec 1, 2015
Makefile Clean up Makefile May 16, 2019
Procfile Default HTTP ports (8080+cid) Nov 17, 2016 Update Go to 1.11 and Alpine to 3.8; fix fmt/vet issues Sep 26, 2018 Re-implement Discovery Client Sep 13, 2016
doc.go Update file headers for 2017 Jan 6, 2017
docker-compose.yml Fix Docker compose image, closes #708 Apr 23, 2018
go.mod Update api vendor May 22, 2019
go.sum Update api vendor May 22, 2019
main.go Update file headers for 2017 Jan 6, 2017

The Things Network Stack

Build Status Coverage Status GoDoc

The Things Network

The Things Network is a global open crowdsourced Internet of Things data network.

Getting Started With The Things Network

When you get started with The Things Network, you'll probably have some questions. Here are some things you can do to find the answer to them:

Installing and Running The Things Network Stack

Although we're all about building an open, public network, we understand that some people rather have everything privately on their own servers. On our website, you'll find some articles describing how you can set up a private routing environment and how you can deploy this environment using Docker.


First, you'll have to prepare your development environment. Follow the steps below to set up your development machine.

  1. Make sure you have Go installed (recommended version 1.11, version 1.8 or later is known to work).
  2. Set up your Go environment
  3. Install the protobuf compiler (protoc)
  4. Install make. On Linux install build-essential. On macOS, make comes with XCode or the developer tools. On Windows you can get make from
  5. Make sure you have Redis and RabbitMQ installed and running.
    On a fresh installation you might need to install the MQTT plugin for RabbitMQ.
    If you're on Linux, you probably know how to do that. On a Mac, just run brew bundle. The Windows installer will setup and start RabbitMQ as a service. Use the RabbitMQ Command Prompt (sbin dir) to run commands, i.e. to enable plugins.
  6. Declare a RabbitMQ exchange ttn.handler of type topic. Using the management plugin, declare the exchange in the web interface http://server-name:15672 or using the management cli, run rabbitmqadmin declare exchange name=ttn.handler type=topic auto_delete=false durable=true. If your handler's user has sufficient permissions on RabbitMQ, it will attempt to create the exchange if not present.

Next, you can clone this repository and set up the TTN part:

  1. Fork this repository
  2. Clone your fork: git clone --branch develop $GOPATH/src/
  3. cd $GOPATH/src/
  4. Install the dependencies for development: make dev-deps
  5. Run the tests: make test
  6. Run make build to build both ttn and ttnctl from source.
  7. Run make dev to install the go binaries into $GOPATH/bin/
    • Optionally on Linux or Mac you can use make link to link them to $GOPATH/bin/ (In order to run the commands, you should have export PATH="$GOPATH/bin:$PATH" in your profile).
  8. Configure your ttnctl with the settings in .env/ by copying that file to ~/.ttnctl.yml.
  9. Trust the CA certificate of your local discovery server by copying .env/discovery/server.cert to ~/.ttnctl/ca.cert.

You can check your ttnctl configuration by running ttnctl config. It should look like this:

  INFO Using config:

         config file: /home/your-user/.ttnctl.yml
            data dir: /home/your-user/.ttnctl

   discovery-address: localhost:1900
           router-id: dev
          handler-id: dev
        mqtt-address: localhost:1883

NOTE: From now on you should run all commands from the $GOPATH/src/ directory.


Source code for The Things Network is released under the MIT License, which can be found in the LICENSE file. A list of authors can be found in the AUTHORS file.

You can’t perform that action at this time.