Affected versions: 26.04

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

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 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.