Somehow, I can't use sudo ufw. The terminal keeps saying:

command not found
  • 1
    Maybe you have not installed it yet?
    – Levente
    May 25, 2021 at 4:51

2 Answers 2


Is it even installed on your system?

You can install UFW with

sudo apt install ufw

You can get help with UFw with

ufw --help

You can download UFW directly from the ubuntu software center:

enter image description here

But, above all else, you can set paramenters for UFW using the GUI by installing Firewall Configuration tool from the ubuntu software center.

enter image description here



Assuming the package is installed, it may not be included in the PATH.

You can find the binary location by looking at the list of files installed by running: dpkg -L ufw

If your platform doesn't have that then you can brute-force search for the binary with this command: sudo find / -name ufw

You should find it in one of the bin or sbin folders, then run echo "$PATH" and check if the ufw binary folder is included.

If the folder is not included you'll need to add it to your PATH either temporarily by using this command export PATH="/usr/sbin:$PATH" (replacing /usr/sbin with your ufw folder), or permanently by adding this to .profile or .bashrc (wherever your config is) PATH="/usr/sbin:$PATH"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .