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.
Prerequisites
Section titled “Prerequisites”- 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.
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:
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_IPReplace 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, likehttp://user:[email protected]:8080.NO_PROXY: A comma-separated list of addresses that bypass the proxy, likelocalhost,127.0.0.1,postgres,thingsboard.example.com.
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 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.
Troubleshooting
Section titled “Troubleshooting”Verify proxy environment variables are set:
echo $HTTP_PROXYecho $HTTPS_PROXYecho $NO_PROXYIf not set, check inside the running container:
docker exec -it container_name printenv | grep -i proxyTest internet access through the proxy from inside the container:
docker exec -it container_name curl -I https://google.comTest 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 logs container_name