Skip to content
Stand with Ukraine flag

How to Change Configuration

ThingsBoard configuration parameters can be customized using environment variables. We recommend using environment variables instead of modifying the default application configuration files. This approach simplifies upgrades because you do not need to merge your changes when installing a new ThingsBoard version.

Each parameter in the Configuration Reference includes its corresponding environment variable name and default value.

Select the instructions that match your ThingsBoard deployment type.

For a monolithic Linux installation, define ThingsBoard environment variables in the following file:

Terminal window
sudo nano /usr/share/thingsboard/conf/thingsboard.conf

Add each variable using the export VARIABLE_NAME=value format. For example, to change the ThingsBoard HTTP port to 8081, add:

Terminal window
export HTTP_BIND_PORT=8081

Save the file and restart the ThingsBoard service:

Terminal window
sudo systemctl restart thingsboard

For a monolithic Windows installation, the ThingsBoard configuration file is located at:

YOUR_INSTALL_DIR/conf/thingsboard.yml

Configuration values in this file use the following format:

server:
address: "${HTTP_BIND_ADDRESS:0.0.0.0}"

In this example:

  • HTTP_BIND_ADDRESS is the corresponding environment variable.
  • 0.0.0.0 is the default value used when the environment variable is not defined.

To customize the setting, define the corresponding Windows environment variable or change its default value in thingsboard.yml.

Restart the ThingsBoard service after applying the changes.

If ThingsBoard is deployed using Docker Compose, define the required environment variables in the environment section of the corresponding ThingsBoard service in the docker-compose.yml file.

You can also reference values from an .env file using variable interpolation, or load an environment file using the env_file attribute. See the Docker Compose documentation for details.

See the ThingsBoard installation guide using Docker for a complete ThingsBoard configuration.

Apply the updated configuration:

Terminal window
docker compose up -d

If ThingsBoard is installed in a Kubernetes environment, set the required environment variables in the env section of the corresponding Deployment or StatefulSet, or in the ConfigMap/Secret it references. See the Kubernetes documentation for more details.