sudo nano /etc/default/ufw
Change the line that says: IPV6=yes
to IPV6=no
then restart the ufw service. You can even run sudo ufw reload
if the ufw instance is already enabled.
References
https://serverfault.com/questions/809643/how-do-i-use-ufw-to-open-ports-on-ipv4-only