Running The Things Enterprise Stack

Now that all configuration is done, we’re ready to initialize The Things Enterprise Stack and start it. Open a terminal prompt in the same directory as your docker-compose.yml file.


The first time The Things Enterprise Stack is started, it requires some initialization. We’ll start by pulling the Docker images:

$ docker-compose pull

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

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

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

$ docker-compose run --rm stack is-db create-tenant

This will take the Tenant ID from the configuration.

We’ll now create an initial admin user. Make sure to give it a good password.

$ docker-compose run --rm stack is-db create-admin-user \
  --id admin \
  --email [email protected]

Then we’ll register the command-line interface 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"

We do the same for the console.

For --secret, make sure to enter the same value as you set for console.oauth.client-secret in the Configuration step.

$ docker-compose run --rm stack is-db create-oauth-client \
  --id console \
  --name "Console" \
  --owner admin \
  --secret the secret you generated before \
  --redirect-uri "" \
  --redirect-uri "/console/oauth/callback" \
  --logout-redirect-uri "" \
  --logout-redirect-uri "/console" \

Running The Things Enterprise Stack

Now it’s time to start The Things Enterprise Stack :

$ docker-compose up

This will start the stack and print logs 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 Enterprise Stack up and running, it’s time to connect gateways, create devices and work with streaming data. See Console or Command-line Interface to proceed.