---
# System prepended metadata

title: SBIR WRB (07-09-2021)
tags: [sbir-star]

---

---
title: SBIR WRB (07-09-2021)
tags: sbir-star
robots: noindex, nofollow
---

<!-- 研究主題類別: 市場調查、通訊模組、無線技術 -->
部署Docker容器 (07-09-2021)
===

* https://thingsboard.io/docs/user-guide/install/docker/
    * **Ubuntu 20.04.2**

[toc]

## 事前工作

### 安裝 Docker CE

> 1. Install prerequisites packages for docker
```
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
```
> 2. Setup docker official repository
```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable"
```
> 3. Install docker with apt command
```
sudo apt-get update
sudo apt install docker-ce -y

sudo usermod -aG docker star

logout
```
> 4. Check version and daemon running 
```
docker version
sudo systemctl status docker
```

### 安裝 Docker Compose

```
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version
```

## 執行

:::info
thingsboard/tb-postgres - single instance of ThingsBoard with PostgreSQL database.

Recommended option for small servers with at least 1GB of RAM and minimum load (few messages per second). 2-4GB is recommended.
:::

## 選擇queue服務

:::info
In Memory queue implementation is built-in and default. It is useful for development(PoC) environments 
:::

## 步驟

> 1. Edit docker-compose.yml
```
version: '3.2'
services:
  mytb:
    restart: always
    image: "thingsboard/tb-postgres"
    ports:
      - "8080:9090"
      - "1883:1883"
      - "5683:5683/udp"
    environment:
      TB_QUEUE_TYPE: in-memory
    volumes:
      - ~/.mytb-data:/data
      - ~/.mytb-logs:/var/log/thingsboard
```
> 2. Execute the following command to up this docker compose directly
```
docker-compose pull
docker-compose up
```
There is a TB VM (Ubuntu 20.04.2) running with network bridge mode (IP addr: 192.168.1.113).

執行此命令後，您可以在瀏覽器中打開 http://{your-host-ip}:8080。
您應該會看到 ThingsBoard 登錄頁面。使用以下默認憑據：

* 系統管理員：sysadmin@thingsboard.org / sysadmin
* 租戶管理員：tenant@thingsboard.org/tenant
* 客戶用戶：customer@thingsboard.org/customer
您可以隨時在帳戶資料頁面中更改每個帳戶的密碼。



---
＊**見證人**

---



