Docker Bypasses UFW — How to Fix Firewall Rules Properly

Publishing a Docker port can make it reachable even when UFW says incoming traffic is denied. Docker routes published bridge-network traffic through NAT and forwarding rules; UFW’s host INPUT policy does not provide the access control you might expect. This guide separates two jobs: limiting where a port is published, and filtering which clients can reach it. Binding to a LAN address reduces exposure, but does not make UFW’s host-input rules control forwarded container traffic. ...

May 10, 2026 · 4 min · 757 words · GnTech