Connect Edge behind a proxy — Docker
Running ThingsBoard Edge behind a proxy server means that its gRPC connection to the ThingsBoard server (port 7070 by default, set by CLOUD_RPC_PORT) is routed through the proxy instead of going directly to the internet. Edge opens this connection through the proxy with an HTTP CONNECT tunnel. Only this connection uses the proxy: devices, the Edge UI, and the local database are not affected, so there is no bypass list to configure.
This setup is common in restricted network environments where direct internet access is deliberately blocked. Proxies also add a security layer by filtering and monitoring outbound traffic, and can cache resources to reduce bandwidth usage.
Prerequisites
Section titled “Prerequisites”- An HTTP proxy server that allows
CONNECTto the ThingsBoard server’s gRPC port, with its host, port, and credentials if required. - ThingsBoard Edge must be installed and running via Docker Compose.
- Docker and Docker Compose must be installed.
Step 1. Stop the container
Section titled “Step 1. Stop the container”docker compose stopStep 2. Update docker-compose.yml
Section titled “Step 2. Update docker-compose.yml”Open the file:
sudo nano docker-compose.ymlAdd the following lines to the environment block of the mytbedge service:
CLOUD_RPC_PROXY_ENABLED: "true" CLOUD_RPC_PROXY_HOST: "proxy_host" CLOUD_RPC_PROXY_PORT: "proxy_port" CLOUD_RPC_PROXY_USERNAME: "proxy_user" CLOUD_RPC_PROXY_PASSWORD: "proxy_password"Replace proxy_host and proxy_port with your proxy’s hostname and port. If your proxy does not require authentication, omit the CLOUD_RPC_PROXY_USERNAME and CLOUD_RPC_PROXY_PASSWORD lines.
Step 3. Restart the containers
Section titled “Step 3. Restart the containers”docker compose up -d && docker compose logs -f mytbedgemytbedge is the default Edge service name in docker-compose.yml. If you renamed the service, replace it in the command.
Once started, open the Edge UI at http://localhost:8080 and log in with your tenant credentials. Go to Edge → Status and confirm the Status field shows Connected — this confirms Edge is reaching the server through the proxy.
Troubleshooting
Section titled “Troubleshooting”Check that the proxy variables reached the Edge container:
docker compose exec mytbedge printenv | grep CLOUD_RPC_PROXYTest connectivity to ThingsBoard Cloud through the proxy:
curl -x http://proxy_host:proxy_port https://your_tb_cloud_urlCheck container logs for proxy-related errors:
docker compose logs mytbedge | grep -iE "proxy|UNAVAILABLE"Was this helpful?