Firewall en - Patlol/Handy-Install-Web-Server-ruTorrent- GitHub Wiki

With HiwsT-util.sh it's possible to easily activate iptables with open ports to ssh, sftp, rutorrent and Webmin.

:warning: Activate the firewall before installing openVpn

UFW

Uncomplicated FireWall

Developed to ease iptables firewall configuration, ufw provides a user-friendly way to create an IPv4 or IPv6 host-based firewall. (ubuntu.com)

For more information see:
Debian wiki
and help ubuntu
Without forgetting man ufw
Theoretical introduction (in french)

Tips

To see active services on your server:
sudo service --status-all
To see all services available:
less /etc/services
These are the services with their theoretical ports. For example, 22 for ssh

screenshot
screenshot