Uncomplicated Firewall is an easy-to-use firewall, in general all ports we will open using docker-compose (later when we self-host services) will be public and anyone can access them so using firewall will limit access to opened ports that used locally and only open needed ones like 22 for SSH or 80 and 443 for HTTP and HTTPS respectively.
In the following commands, I will assume you are using Debian.
Simply run:
sudo apt install ufw
First time when we install UFW it will be disabled by default, usage is very simple.
So first we run sudo ufw allow in SSH to make sure we allowed port 22 for SSH and then start UFW with sudo ufw enable.