---
title: Install / Upgrade ThingsBoard Edge using Docker
tags: thingsboard-edge
image:
---
# Install / Upgrade ThingsBoard Edge using Docker
:::danger
Please update ThingsBoard server to the latest version before updating Edge services.
:::
## Upgrade
> 3.4.1 to 3.4.3
```bash!
star@mar:~$ sudo su - swae
swae@mar:~$ cd workspace/
swae@mar:~/workspace$ docker-compose stop
[+] Running 2/2
⠿ Container workspace-mytbedge-1 Stopped 10.7s
⠿ Container workspace-postgres-1 Stopped 0.5s
swae@mar:~/workspace$ docker-compose rm mytbedge
? Going to remove workspace-mytbedge-1 Yes
[+] Running 1/1
⠿ Container workspace-mytbedge-1 Removed 0.8s
swae@mar:~/workspace$ sudo cp -r ~/.mytb-edge-data/db ~/.mytb-edge-db-BACKUP
[sudo] password for swae:
swae@mar:~/workspace$ docker pull thingsboard/tb-edge:3.4.3EDGE
3.4.3EDGE: Pulling from thingsboard/tb-edge
a603fa5e3b41: Already exists
3b0957e64330: Pull complete
315d4f58b451: Pull complete
d5f4c5b189c6: Pull complete
be81bb2f1fc4: Pull complete
Digest: sha256:8dc09090356b59e171ea4ed6592c4810ea97f022b15f429d4f5b4fe400f0daec
Status: Downloaded newer image for thingsboard/tb-edge:3.4.3EDGE
docker.io/thingsboard/tb-edge:3.4.3EDGE
swae@mar:~/workspace$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
swae@mar:~/workspace$ vi docker-compose-upgrade.yml
version: '3.0'
services:
mytbedge:
restart: on-failure
image: "thingsboard/tb-edge:3.4.3EDGE"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/tb-edge
volumes:
- ~/.mytb-edge-data:/data
- ~/.mytb-edge-logs:/var/log/tb-edge
entrypoint: upgrade-tb-edge.sh
postgres:
restart: always
image: "postgres:12"
ports:
- "5432"
environment:
POSTGRES_DB: tb-edge
POSTGRES_PASSWORD: postgres
volumes:
- ~/.mytb-edge-data/db:/var/lib/postgresql/data
docker compose -f docker-compose-upgrade.yml up
[+] Running 2/2
⠿ Container workspace-postgres-1 Created 0.0s
⠿ Container workspace-mytbedge-1 Created 6.9s
Attaching to workspace-mytbedge-1, workspace-postgres-1
workspace-mytbedge-1 | Starting ThingsBoard Edge upgrade ...
workspace-postgres-1 |
workspace-postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
workspace-postgres-1 |
workspace-postgres-1 | 2022-12-27 02:59:24.465 UTC [1] LOG: starting PostgreSQL 12.13 (Debian 12.13-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
workspace-postgres-1 | 2022-12-27 02:59:24.465 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
workspace-postgres-1 | 2022-12-27 02:59:24.465 UTC [1] LOG: listening on IPv6 address "::", port 5432
workspace-postgres-1 | 2022-12-27 02:59:24.748 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
workspace-mytbedge-1 | ______ __ _ ____ __
workspace-mytbedge-1 | /_ __/ / /_ (_) ____ ____ _ _____ / __ ) ____ ____ _ _____ ____/ /
workspace-mytbedge-1 | / / / __ \ / / / __ \ / __ `/ / ___/ / __ | / __ \ / __ `/ / ___/ / __ /
workspace-mytbedge-1 | / / / / / / / / / / / / / /_/ / (__ ) / /_/ / / /_/ // /_/ / / / / /_/ /
workspace-mytbedge-1 | /_/ /_/ /_/ /_/ /_/ /_/ \__, / /____/ /_____/ \____/ \__,_/ /_/ \__,_/
workspace-mytbedge-1 | /____/
workspace-mytbedge-1 |
workspace-mytbedge-1 | ===================================================
workspace-mytbedge-1 | :: ThingsBoard Edge CE :: (v3.4.3EDGE)
workspace-mytbedge-1 | ===================================================
workspace-mytbedge-1 |
workspace-postgres-1 | 2022-12-27 02:59:25.078 UTC [25] LOG: database system was shut down at 2022-12-27 02:45:22 UTC
workspace-postgres-1 | 2022-12-27 02:59:25.199 UTC [1] LOG: database system is ready to accept connections
workspace-mytbedge-1 | Starting ThingsBoard Edge Upgrade from version 3.4.0 ...
workspace-mytbedge-1 | Upgrading ThingsBoard from version 3.4.0 to 3.4.1 ...
workspace-mytbedge-1 | Updating schema ...
workspace-mytbedge-1 | relation "rule_node_debug_event" already exists, skipping
workspace-mytbedge-1 | relation "rule_chain_debug_event" already exists, skipping
workspace-mytbedge-1 | relation "stats_event" already exists, skipping
workspace-mytbedge-1 | relation "lc_event" already exists, skipping
workspace-mytbedge-1 | relation "error_event" already exists, skipping
workspace-mytbedge-1 | relation "idx_rule_node_debug_event_main" already exists, skipping
workspace-mytbedge-1 | relation "idx_rule_chain_debug_event_main" already exists, skipping
workspace-mytbedge-1 | relation "idx_stats_event_main" already exists, skipping
workspace-mytbedge-1 | relation "idx_lc_event_main" already exists, skipping
workspace-mytbedge-1 | relation "idx_error_event_main" already exists, skipping
workspace-mytbedge-1 | Updating schema settings...
workspace-mytbedge-1 | Schema updated.
workspace-mytbedge-1 | Upgrading ThingsBoard from version 3.4.1 to 3.4.2 ...
workspace-mytbedge-1 | Updating schema ...
workspace-mytbedge-1 | relation "idx_edge_event_tenant_id_and_created_time" does not exist, skipping
workspace-mytbedge-1 | Creating default asset profiles...
workspace-mytbedge-1 | Updating asset profiles...
workspace-mytbedge-1 | constraint "fk_asset_profile" of relation "asset" does not exist, skipping
workspace-mytbedge-1 | Schema updated.
workspace-mytbedge-1 | Updating data from version 3.4.1 to 3.4.2 ...
workspace-mytbedge-1 | Starting audit logs migration. Can be skipped with TB_SKIP_AUDIT_LOGS_MIGRATION env variable set to true
workspace-mytbedge-1 | Starting edge events migration. Can be skipped with TB_SKIP_EDGE_EVENTS_MIGRATION env variable set to true
workspace-mytbedge-1 | Tenants edge full sync required updater: 1 total entities updated.
workspace-mytbedge-1 | Upgrade finished successfully!
workspace-mytbedge-1 exited with code 0
Ctrl + C
docker-compose -f docker-compose-upgrade.yml stop
[+] Running 2/0
⠿ Container workspace-postgres-1 Stopped 0.0s
⠿ Container workspace-mytbedge-1 Stopped 0.0s
vi docker-compose.yml
+ image: "thingsboard/tb-edge:3.4.3EDGE"
docker-compose up -d
[+] Running 2/2
⠿ Container workspace-postgres-1 Started 14.1s
⠿ Container workspace-mytbedge-1 Started 14.0s
docker-compose logs -f mytbedge
```
## References
* [Upgrade instructions](https://thingsboard.io/docs/user-guide/install/edge/upgrade-instructions/)