Install with Python (pip)
Install ThingsBoard IoT Gateway as a Python package using pip on Ubuntu or Debian-based systems.
Prerequisites
Section titled “Prerequisites”- Python 3.10 or higher is installed.
sudoaccess on the target machine.
Installation
Section titled “Installation”Install system libraries.
Terminal window sudo apt install python3-dev python3-pip libglib2.0-devInstall the ThingsBoard Gateway package.
Terminal window sudo pip3 install thingsboard-gatewayDownload and unpack the example configuration.
Terminal window wget https://github.com/thingsboard/thingsboard-gateway/releases/latest/download/configs.tar.gzsudo mkdir /etc/thingsboard-gatewaysudo mkdir /var/log/thingsboard-gatewaysudo tar -xvzf configs.tar.gz -C /etc/thingsboard-gatewaySet folder permissions. Replace
YOUR_USERwith the user that will run the Gateway.Terminal window sudo chown YOUR_USER:YOUR_USER -R /var/log/thingsboard-gatewaysudo chown YOUR_USER:YOUR_USER -R /etc/thingsboard-gatewaysudo chown YOUR_USER:YOUR_USER /tmpCreate a Gateway device in ThingsBoard.
Go to Entities > Gateways and click the + icon in the upper-right corner. Enter a name (e.g.,
My Gateway), select the default device profile, and click Create.Configure the Gateway credentials.
Click the General configuration button on the Gateway device page and copy the Access token from the General tab. Then open the Gateway configuration file and paste the token, replacing the host and port with your ThingsBoard instance address:
Terminal window nano /etc/thingsboard-gateway/config/tb_gateway.jsonConfigure the log file path.
Click General configuration again, navigate to the Logs tab, and set the File path to
/var/log/thingsboard-gatewayfor each entry in the Local logging section. Click Save.Start the Gateway and verify.
Terminal window thingsboard-gatewayIf everything is configured correctly, the Gateway device status changes to Active in ThingsBoard.