This guide will help you to install and start ThingsBoard Gateway using Docker on Windows.
Click the Docker QuickStart icon to launch a pre-configured Docker Toolbox terminal.
Make sure your have logged in to docker hub using command line.
Execute the following command to run this docker directly:
docker run -it -v $HOME/tb-gateway/config:/etc/thingsboard-gateway/config -v $HOME/tb-gateway/extensions:/var/lib/thingsboard_gateway/extensions -v $HOME/tb-gateway/logs:/var/log/thingsboard-gateway --name tb-gateway --restart always thingsboard/tb-gateway
Where:
docker run
- run this container-it
- attach a terminal session with current Gateway process output-v $HOME/tb-gateway/config:/etc/thingsboard-gateway/config
- mounts the host’s dir %HomePath%\tb-gateway\config
to Gateway config directory-v $HOME/tb-gateway/extensions:/var/lib/thingsboard_gateway/extensions
- mounts the host’s dir %HomePath%\tb-gateway\extensions
to Gateway extensions directory-v $HOME/tb-gateway/logs:/var/log/thingsboard-gateway
- mounts the host’s dir %HomePath%\tb-gateway\logs
to Gateway logs directory--name tb-gateway
- friendly local name of this machine--restart always
- automatically start ThingsBoard in case of system reboot and restart in case of failure.thingsboard/tb-gateway
- docker image$HOME
- current user’s home dir(%HomePath%
)You can detach from session terminal with Ctrl-p
Ctrl-q
- the container will keep running in the background.
To reattach to the terminal (to look at Gateway logs) run:
docker attach tb-gateway
To stop the container:
docker stop tb-gateway
To start the container:
docker start tb-gateway
Stop the container:
docker stop tb-gateway
Open the directory with configuration files:
%HomePath%\tb-gateway\config
Configure gateway to work with your instance of ThingsBoard, using this guide:
Start the container after made changes:
docker start tb-gateway
In order to update to the latest image, execute the following commands:
$ docker pull thingsboard/tb-gateway
$ docker stop tb-gateway
$ docker rm tb-gateway
$ docker run -it -v $HOME/tb-gateway/config:/etc/thingsboard-gateway/config -v $HOME/tb-gateway/extensions:/var/lib/thingsboard_gateway/extensions -v $HOME/tb-gateway/logs:/var/log/thingsboard-gateway --name tb-gateway --restart always thingsboard/tb-gateway