# chaifeng/ufw-docker

To fix the Docker and UFW security flaw without disabling iptables

Repository: https://github.com/chaifeng/ufw-docker
Canonical: https://ross.abutalabs.com/products/ufw-docker
Language: Shell
License: GPL-3.0
License Family: copyleft
Topics: docker, ufw, ubuntu, debian, linux, firewall, security, docker-swarm
Last push: 2026-05-12T14:09:13+00:00

## Health v2 (maintenance only)
Score: 69/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 82, release rhythm 34, longevity 100
- inputs: {"age_days": 2947, "days_push": 113, "days_rel": 283, "gap_med": 135, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6749, forks 500 (observed 2026-08-28T04:09:48.282264+00:00)

## What it is
A shell-based tool that fixes the well-known security flaw where Docker bypasses UFW firewall rules and exposes published ports to the public internet. It works without disabling Docker's iptables management, preserving container networking while enforcing UFW rules.

## Use cases
- block docker published ports from external access with ufw
- fix docker bypassing ufw firewall rules
- manage ufw rules for docker containers
- secure docker ports on ubuntu server
- allow only specific ips to access docker container ports
- use ufw with docker without disabling iptables

## When to choose
- you run Docker on Ubuntu/Debian with UFW and need published ports protected
- you want to keep Docker's iptables and network management intact
- you need per-container firewall rules via a simple ufw-docker command

## When to avoid
- you use firewalld or nftables instead of UFW
- you run Docker on non-Linux platforms
- you prefer binding ports to localhost or a reverse proxy instead of firewall rules

## Facets
- artifact type: cli-tool
- maturity: active
- function: security, networking, configuration-management, cli
- domain: security, networking, self-hosted
- platform: cli
- tags: ufw, firewall, docker-networking, iptables, shell-script, docker-swarm, containers, devops, linux, docker

## Member repositories
- chaifeng/ufw-docker (main) score 69

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:48.282264+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:42:35.406818+00:00, confidence not recorded.
  - readme: https://github.com/chaifeng/ufw-docker (fetched 2026-08-28T04:09:48.282264+00:00, sha 5865a75de8ca)
- Data as of 2026-08-30T08:39:29.467469+00:00.
