© 2021 www.richardwalz.com
Richard Walz
All rights reserved.

Rest UFW to defaults on Ubuntu or Linux

This may not be the best way. However, this method has worked for me.

  1. Here we are reinstalling ufw. This is to ensure all the files exist on the machine so we can fully reset ufw in the next step.
sudo apt-get install ufw
  1. Here we are fully removing and purging any files created by UFW
sudo apt-get remove --purge ufw
  1. Here we are installing ufw, this will recreate new files.
sudo apt-get install ufw

Your ufw firewall should now be reset to defaults.