Installing the CLI

This section contains instructions for installing the command-line interface.


$ brew install TheThingsNetwork/lorawan-stack/ttn-lw-stack


$ sudo snap install ttn-lw-stack
$ sudo snap alias ttn-lw-stack.ttn-lw-cli ttn-lw-cli


You can download pre-built binaries for your operating system and processor architecture.


The command-line needs to be configured to connect to your deployment on You have multiple options to make the configuration file available to the CLI:

  1. Environment: export TTN_LW_CONFIG=/path/to/ttn-lw-cli.yml
  2. Command-line flag: -c /path/to/ttn-lw-cli.yml
  3. Save as .ttn-lw-cli.yml in $XDG_CONFIG_HOME, your home directory, or the working directory.

NOTE: When using the snap packages, ~/.ttn-lw-cli.yml will fail with permission errors. Choose a different path.

Generate configuration file

For a standard deployment on, all you need is:

$ ttn-lw-cli use [--fetch-ca] [--user] [--overwrite]

This will generate and save the required CLI config file. By default, the file is saved on the current directory, use the --user to save it under the user config directory.

If the deployment is using a CA that is not already trusted by your system, use the --fetch-ca flag to also connect to the server and retrieve the CA required for establishing secure communication.

NOTE: If the file exists already, it is not overwritten and an error is printed instead. You can use --overwrite to overwrite the existing configuration file.

NOTE: You can also use the --grpc-port and --oauth-server-address flags to override the default values for the gRPC port and the OAuth server address. These are not needed for standard deployments.

Manually creating configuration file

Alternatively, you can create a file named .ttn-lw-cli.yml and paste the following contents:

oauth-server-address: ''

identity-server-grpc-address: ''
gateway-server-grpc-address: ''
network-server-grpc-address: ''
application-server-grpc-address: ''
join-server-grpc-address: ''
device-claiming-server-grpc-address: ''
device-template-converter-grpc-address: ''
qr-code-generator-grpc-address: ''

For advanced options, see the Configuration Reference.