๐ ~1 min read
Table of contents
Symptom & Impact
Published container ports are reachable locally but blocked from remote clients when UFW is active.

Environment & Reproduction
Occurs on Ubuntu hosts running containers with mapped ports and default-deny UFW policies.

Root Cause Analysis
Firewall forwarding and route policies do not permit inbound traffic to container bridge interfaces.

Quick Triage
Check sudo ufw status verbose and verify listening sockets with ss -lntp.

Step-by-Step Diagnosis
Inspect packet path using sudo ufw show raw and validate container bridge configuration with ip addr show.

Solution – Primary Fix
Add explicit UFW rules for required ports and route traffic, then reload using sudo ufw reload. Keep policy least-privilege.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Bind services to host network when appropriate or proxy through Nginx with controlled UFW rules.

Verification & Acceptance Criteria
Remote clients can reach intended service ports while closed ports remain filtered.

Rollback Plan
Delete added firewall rules with ufw delete and restore previous rule set from documented baseline.

Prevention & Hardening
Define firewall policy alongside container deployment manifests and test exposure in CI checks.

Related Errors & Cross-Refs
Related signs include timeout from external hosts and healthy local curl responses.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub โ
Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading
UFW manual, Ubuntu firewall documentation, and container networking best practices.

Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today โ we respond within one business day.