To disable the firewall on Ubuntu, run the following command on the terminal:
sudo ufw disable
To enable the firewall on Ubuntu, run the following command on the terminal:
sudo ufw enable