Disabling the firewall
Ubuntu ships with a firewall configuration tool called UFW (Uncomplicated Firewall). UFW is a user-friendly front end for managing iptables rules, and its main goal is to make firewall management simpler. Keeping your firewall enabled is very important, but in some situations, such as testing, you may need to stop or disable it. This guide shows you how to disable UFW on Ubuntu 18.04. (Buy an Iran server)
Make sure you’re signed in as a user with sudo privileges.
Check the firewall status
To see the current status of UFW, use the ufw status command:
sudo ufw status
UFW is disabled by default. If you’ve never enabled it, the output looks like this:
Status: inactive
If the firewall is active, you’ll see:
Status: active
Disable the firewall
To disable UFW on Ubuntu, use the ufw disable command:
sudo ufw disable
The output will be:
Firewall stopped and disabled on system startup
This stops and disables the firewall but doesn’t delete its rules. The same rules will apply the next time you enable it.
To disable the firewall and delete all of its rules, use ufw reset:
sudo ufw reset
You’ll be asked to confirm:
Resetting all rules to installed defaults. This may disrupt existing ssh
connections. Proceed with operation (y|n)?
Type y, and you’ll see output like this:

Resetting UFW is handy when you want to undo all your changes and start from scratch.
Enable the firewall
Before enabling the firewall, make sure the SSH port is open so you don’t lock yourself out.
To enable the firewall:
sudo ufw enable
When prompted, type y to continue:
Command may disrupt existing ssh connections. Proceed with operation (y|n)?
Output:
Firewall is active and enabled on system startup
Summary
You’ve learned how to stop and disable the firewall on Ubuntu 18.04.
Most UFW commands are intuitive and easy to remember: ufw status shows the firewall status, and ufw disable turns it off.
We hope you found this guide useful. Thanks for reading, and follow Mizbandade for more.

