Skip to content
Stand with Ukraine flag

Connect Edge behind a proxy — Docker

Running ThingsBoard Edge behind a proxy server means all outbound communication — specifically the gRPC connection to the ThingsBoard server on port 17100 — is routed through the proxy instead of going directly to the internet.

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.

  • A proxy server (HTTP or HTTPS) with its host, port, and credentials if required.
  • A list of addresses that should bypass the proxy, including internal resources, the database host (postgres), and the ThingsBoard server IP or hostname.
  • ThingsBoard Edge must be installed and running via Docker Compose.
  • Docker and Docker Compose must be installed.
Terminal window
docker compose stop

Open the file:

Terminal window
sudo nano docker-compose.yml

Add the following lines to the environment block:

HTTP_PROXY: http://proxy_user:proxy_password@proxy_host:proxy_port
HTTPS_PROXY: http://proxy_user:proxy_password@proxy_host:proxy_port
NO_PROXY: localhost,127.0.0.1,postgres,YOUR_TB_SERVER_IP

Replace YOUR_TB_SERVER_IP with the IP address or hostname of your ThingsBoard server. If your proxy does not require authentication, omit the proxy_user:proxy_password@ part from the URL.

  • HTTP_PROXY / HTTPS_PROXY: The proxy URL for HTTP and HTTPS traffic, like http://user:[email protected]:8080.
  • NO_PROXY: A comma-separated list of addresses that bypass the proxy, like localhost,127.0.0.1,postgres,thingsboard.example.com.
Terminal window
docker compose up -d && docker compose logs -f mytbedge

mytbedge is the default Edge container name. If you renamed your container, 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.

Verify proxy environment variables are set:

Terminal window
echo $HTTP_PROXY
echo $HTTPS_PROXY
echo $NO_PROXY

If not set, check inside the running container:

Terminal window
docker exec -it container_name printenv | grep -i proxy

Test internet access through the proxy from inside the container:

Terminal window
docker exec -it container_name curl -I https://google.com

Test connectivity to ThingsBoard Cloud through the proxy:

Terminal window
curl -x http://proxy_host:proxy_port https://your_tb_cloud_url

Check container logs for proxy-related errors:

Terminal window
docker logs container_name