v3.23.1

Getting Started Devices Gateways Integrations Reference
Get The Things Stack

Reference

    Overview
  • Adaptive Data Rate
  • API
  • Application Packages
  • Billing with Stripe
  • Command-Line Interface
  • Components
  • Configuration
    • General Options
    • Tenant Billing Server Options
    • Application Server Options
    • Command-Line Interface Options
    • Console Options
    • Device Claiming Server Options
    • Gateway Configuration Server Options
    • Gateway Server Options
    • Identity Server Options
    • Join Server Options
    • Network Operations Center Options
    • Network Server Options
    • Packet Broker Agent Options
  • Data Formats
  • Data Retention and Privacy
  • Email Templates
  • Federated Authentication
  • Frequency Plans
  • FUOTA
  • Gateway RTT
  • Glossary
  • ID and EUI Constraints
  • Last Activity
  • LoRa Basics Station Implementation Guide
  • LoRaWAN Backend Interfaces Interoperability
  • LoRaWAN Specification and Regional Parameters
  • Networking
  • Packet Broker Routing
  • Packet Forwarders
  • Purging Entities
  • Rate Limiting
  • Resource Limiting
  • Root Certificates
  • Telemetry
  • Tenant Management
  • Web UI Branding

Configuration

The Things Stack binary can be configured with many different options. Those options can be provided as command-line flags, environment variables or using a configuration file.

Note:
These configuration methods only apply to The Things Stack Open Source and Enterprise deployments that follow the Installation guide. AWS Launcher deployments can be configured using the CloudFormation template settings. Managed deployments such as Cloud and Community Edition are configured for you by The Things Industries.

Configuration Sources

In this reference we will refer to configuration options by name. On this page we will show how the console.ui.canonical-url option can be configured.

Command-line flags

Command-line flags have the highest priority and, as such, override other means of configuration (environment variable or file). This looks as follows:

$ ttn-lw-stack start console --console.ui.canonical-url "https://thethings.example.com/console"

Environment variables

Environment variables for configuration options are very similar to the command-line flags, except that they are in uppercase, and all separators (. or -) are replaced by underscores (_). Environment variables are also prefixed with TTN_LW_.

Note:
In many cases you’ll want to use a .env file that is loaded using the dotenv command of direnv or the env_file option of Docker Compose. You can also export each environment variable, or run export $(grep -v '^#' .env | xargs) to export all variables in the .env file.

The option from the command-line example from above would look as follows with environment variables:

TTN_LW_CONSOLE_UI_CANONICAL_URL="https://thethings.example.com/console"

Configuration files

You can also configure The Things Stack with a YAML configuration file. This is again similar to the command-line flags, except that each . represents a YAML node. This allows you to group related options together:

console:
  ui:
    canonical-url: 'https://thethings.example.com/console'
    # other console UI options
  # other console options

You can specify the location of the YAML configuration file with the command-line flag -c or --config. If this flag is not present, The Things Stack will look for config files in the following locations:

  • The current directory
  • The user’s home directory (as determined by Go)
  • The user’s config directory (as determined by Go)

You can run The Things Stack with the --help flag, and check the description of the --config flag for the exact locations that are being checked.

Defaults

The Things Stack can be used for local testing purposes without any custom configuration.

Printing the Current Configuration

You can see the current configuration with the config command of ttn-lw-stack or ttn-lw-cli. By default this will print the configuration as CLI flags. Use the --env or --yml flags to print the configuration as environment variables or as YAML.

← Tenant Billing Server General Options →

On this page

  • Configuration Sources
  • Printing the Current Configuration

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 Ben Olayinka on 19 Aug 2021.
doc: Add configuration options note (#524)

Edit on Github