Need help with ttn?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

445 Stars 283 Forks MIT License 3.3K Commits 30 Opened issues


The Things Network Stack V2

Services available


Need anything else?

Contributors list

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 (version 1.11 or later).
  2. Set up your Go environment
  3. Install the protobuf compiler (
  4. Install
    . On Linux install
    . On macOS,
    comes with XCode or the developer tools. On Windows you can get
  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
    of type
    . Using the management plugin, declare the exchange in the web interface
    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
    from source.
  7. Run
    make dev
    to install the go binaries into
    • Optionally on Linux or Mac you can use
      make link
      to link them to
      (In order to run the commands, you should have
      export PATH="$GOPATH/bin:$PATH"
      in your profile).
  8. Configure your
    with the settings in
    by copying that file to
  9. Trust the CA certificate of your local discovery server by copying

You can check your

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



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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.