Install from Source
Build and run ThingsBoard IoT Gateway directly from source on Ubuntu or Debian-based systems. This method is recommended for development and local customization.
Prerequisites
Section titled “Prerequisites”- Python 3.10 or higher is installed.
gitis available on the system.
Installation from source
Section titled “Installation from source”Install system dependencies.
Terminal window sudo apt install python3-dev python3-pip python3-venv libglib2.0-dev gitClone the repository.
Terminal window git clone --recurse-submodules https://github.com/thingsboard/thingsboard-gateway.git --depth 1Enter the project directory.
Terminal window cd thingsboard-gatewayCreate and activate a virtual environment.
Terminal window python3 -m venv venv && source venv/bin/activateInstall Python dependencies.
Terminal window pip install -r requirements.txtInstall the Gateway package.
Terminal window python setup.py installCreate the logs directory.
Terminal window mkdir logsConfigure the Gateway. Open the configuration file and set your ThingsBoard host and access token:
Terminal window thingsboard-gateway/thingsboard_gateway/config/tb_gateway.jsonFor a full description of all configuration options, see the configuration guide.
Start the Gateway to verify the installation.
Terminal window python3 ./thingsboard_gateway/tb_gateway.py
Build a local Docker image
Section titled “Build a local Docker image”Copy the Dockerfile to the project root.
Terminal window cp docker/Dockerfile .Build the image.
Terminal window docker build -t local-gateway .
Hot Reloader
Section titled “Hot Reloader”When developing custom extensions, enable Hot Reloader to restart the Gateway automatically whenever a project file changes:
python3 ./thingsboard_gateway/tb_gateway.py true