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.
How to change configuration parameters?
Section titled “How to change configuration parameters?”Select the instructions that match your ThingsBoard deployment type.
Monolithic deployment on Linux
Section titled “Monolithic deployment on Linux”For a monolithic Linux installation, define ThingsBoard environment variables in the following file:
sudo nano /usr/share/thingsboard/conf/thingsboard.confAdd each variable using the export VARIABLE_NAME=value format. For example, to change the ThingsBoard HTTP port to 8081, add:
export HTTP_BIND_PORT=8081Save the file and restart the ThingsBoard service:
sudo systemctl restart thingsboardMonolithic deployment on Windows
Section titled “Monolithic deployment on Windows”For a monolithic Windows installation, the ThingsBoard configuration file is located at:
YOUR_INSTALL_DIR/conf/thingsboard.ymlConfiguration values in this file use the following format:
server: address: "${HTTP_BIND_ADDRESS:0.0.0.0}"In this example:
HTTP_BIND_ADDRESSis the corresponding environment variable.0.0.0.0is 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.
Docker-based deployment
Section titled “Docker-based deployment”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:
docker compose up -dKubernetes-based deployment
Section titled “Kubernetes-based deployment”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.
Was this helpful?