{
    "mode": "pydoc",
    "parameter": "ufw",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/ufw/json",
    "generated": "2026-06-02T15:53:04Z",
    "sections": {
        "NAME": {
            "content": "ufw\n",
            "subsections": []
        },
        "PACKAGE CONTENTS": {
            "content": "applications\nbackend\nbackendiptables\ncommon\nfrontend\nparser\nutil\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/ufw/init.py\n\n",
            "subsections": []
        }
    },
    "summary": "ufw",
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Uncomplicated Firewall.",
        "examples": [
            {
                "description": "Enable `ufw`",
                "command": "sudo ufw enable"
            },
            {
                "description": "Disable `ufw`",
                "command": "sudo ufw disable"
            },
            {
                "description": "Show `ufw` rules, along with their numbers",
                "command": "sudo ufw status numbered"
            },
            {
                "description": "Allow incoming traffic on port 5432 on this host with a comment identifying the service",
                "command": "sudo ufw allow 5432 comment \"{{Service}}\""
            },
            {
                "description": "Allow only TCP traffic from 192.168.0.4 to any address on this host, on port 22",
                "command": "sudo ufw allow proto tcp from 192.168.0.4 to any port 22"
            },
            {
                "description": "Deny traffic on port 80 on this host",
                "command": "sudo ufw deny 80"
            },
            {
                "description": "Deny all UDP traffic to ports in range 8412:8500",
                "command": "sudo ufw deny proto udp from any to any port 8412:8500"
            },
            {
                "description": "Delete a particular rule. The rule number can be retrieved from the `ufw status numbered` command",
                "command": "sudo ufw delete {{rule_number}}"
            }
        ]
    }
}