thethingsstack.io has moved to thethingsindustries.com/docs
Got it

v3.12

Getting Started Devices Gateways Integrations Reference
Get The Things Stack

Getting Started

    Overview
  • What Is The Things Stack?
  • Installing The Things Stack
    • Configuration
    • Certificates
    • Running The Things Stack
    • Troubleshooting Installation
  • Migrating to The Things Stack
  • Upgrading The Things Stack
  • The Things Stack Cloud
  • AWS
  • Command-line Interface
  • Console
  • Troubleshooting Getting Started
  • Users and Organizations
  • Using the API
  • Working with Events

Running The Things Stack

Now that all configuration is done, you are ready to initialize The Things Stack and start it!

Begin by opening a terminal prompt in the same directory as your docker-compose.yml file.

Initialization

The first time The Things Stack is started, it requires some initialization. Start by pulling the Docker images:

$ docker-compose pull

Next, you need to initialize the database of the Identity Server:

$ docker-compose run --rm stack is-db init
Note:
If you receive an error running The Things Stack, make sure a The Things Stack container isn’t already running. Use docker ps to see running containers.

For the Storage Integration available in The Things Stack Enterprise, the database of the Application Server needs to be initialized as well:

$ docker-compose run --rm stack storage-db init

The Things Stack Enterprise requires a tenant to be present, even if multi-tenancy is not included in the license. You create a tenant with:

$ docker-compose run --rm stack is-db create-tenant
Note:
This will take the tenancy.default-id Tenant ID from the configuration in ttn-lw-stack-docker.yml. To specify another Tenant ID, use the --id parameter.

Next, an initial admin user has to be created. Make sure to give it a good password.

$ docker-compose run --rm stack is-db create-admin-user \
  --id admin \
  --email your@email.com

Then the command-line interface needs to be registered as an OAuth client:

$ docker-compose run --rm stack is-db create-oauth-client \
  --id cli \
  --name "Command Line Interface" \
  --owner admin \
  --no-secret \
  --redirect-uri "local-callback" \
  --redirect-uri "code"

Afterwards, the same needs to be done for the Console.

$ CONSOLE_SECRET="your-console-secret"
$ SERVER_ADDRESS="your-server-address"
$ docker-compose run --rm stack is-db create-oauth-client \
  --id console \
  --name "Console" \
  --owner admin \
  --secret "${CONSOLE_SECRET}" \
  --redirect-uri "${SERVER_ADDRESS}/console/oauth/callback" \
  --redirect-uri "/console/oauth/callback" \
  --logout-redirect-uri "${SERVER_ADDRESS}/console" \
  --logout-redirect-uri "/console"
Note:
If running a multi-tenant environment, use option --tenant-id NULL to register the OAuth client for all tenants.
Note:
For --secret, make sure to enter the same value as you set for console.oauth.client-secret in the ttn-lw-stack-docker.yml file in the Configuration step.

Running The Things Stack

Start The Things Stack with:

$ docker-compose up

This starts the stack, so you will see the stack logs being printed to your terminal. You can also start the stack in detached mode by adding -d to the command above. In that case you can get logs with docker-compose logs.

With The Things Stack up and running, follow Console or Command-line Interface to proceed with the login, then continue with connecting gateways, creating devices and working with streaming data.

← Certificates Troubleshooting Installation →

On this page

  • Initialization
  • Running The Things Stack

The Things Stack

Getting Started

Devices

Gateways

Integrations

Reference

Contributing

GitHub

Forum

About Us

The Things Network

The Things Industries

About this page

Last changed by Nejra on 19 Nov 2020.
doc: Improve the installation guide

Edit on Github