- Step 1. Pull TBMQ Image
- Step 2. Clone TBMQ repository
- Step 3. Installation
- Step 4. Running
- Step 5. Logs, stop and start commands
- Generate certificate for HTTPS
- Next steps
This guide will help you to set up TBMQ in cluster mode using Docker Compose.
Step 1. Pull TBMQ Image
Make sure your have logged in to docker hub using command line.
1 docker pull thingsboard/tbmq-node:1.2.0
Step 2. Clone TBMQ repository
1 2 git clone -b release-1.2.0 https://github.com/thingsboard/tbmq.git cd tbmq/docker
Step 3. Installation
Execute the following command to create log folders for the services and change owner of these folders to the docker container users. To be able to change user, chown command is used, which requires sudo permissions (script will request password for a sudo access):
Execute the following command to run installation:
Step 4. Running
Execute the following command to start services:
After a while when all services will be successfully started you can make requests to
in you browser (e.g. http://localhost:8083) and connect clients using MQTT protocol on 1883 port.
You should see TBMQ login page. Use the following default credentials for System Administrator:
On the first user log-in you will be asked to change the default password to the preferred one and then re-login using the new credentials.
Step 5. Logs, stop and start commands
In case of any issues you can examine service logs for errors. For example to see TBMQ logs execute the following command:
1 docker compose logs -f tb-mqtt-broker-1
Or use the following command to see the state of all the containers.
1 docker compose ps
Use next command to inspect the logs of all running services.
1 docker compose logs -f
See docker compose logs command reference for more details.
Execute the following command to stop services:
Execute the following command to stop and completely remove deployed docker containers:
In case you would like to upgrade, please pull the recent changes from the latest release branch:
1 git pull origin release-1.2.0
Note: Make sure custom changes of yours if available are not lost during the merge process.
Note: Make sure
TBMQ_VERSION in .env file is set to the target version (e.g., set it to 1.2.0 if you are upgrading to the latest).
After that execute the following commands:
1 2 3 ./scripts/docker-stop-services.sh ./scripts/docker-upgrade-tbmq.sh --fromVersion=FROM_VERSION ./scripts/docker-start-services.sh
FROM_VERSION - from which version upgrade should be started.
See Upgrade Instructions for valid
Generate certificate for HTTPS
We are using HAproxy for proxying traffic to containers and for web UI by default we are using 8083 and 443 ports. For using HTTPS with a valid certificate, execute these commands:
1 2 docker exec haproxy-certbot certbot-certonly --domain your_domain --email your_email docker exec haproxy-certbot haproxy-refresh
Note: Valid certificate is used only when you visit web UI by domain in URL.
Getting started guide - This guide provide quick overview of TBMQ.
Security guide - Learn how to enable authentication and authorization of MQTT clients.
Configuration guide - Learn about TBMQ configuration files and parameters.
MQTT client type guide - Learn about TBMQ client types.
Integration with ThingsBoard - Learn about how to integrate TBMQ with ThingsBoard.