How to setup the ufw firewall (uncomplicated firewall). 0) Install ufw $ sudo apt install ufw (though it should already be installed by default on most Ubuntu-based distros) Option A) Use the GUI gufw 1) Install gufw $ sudo apt install gufw 2) Enable the firewall and put rules to allow the connections you want - launch gufw, click on enable - Go to rules > + > Preconfigured > Application , and add rules for the wanted service, e.g.: - SSH (if you changed the ssh port, you can just later edit the rule to modify it in consequence) - SAMBA - HTTPS (e.g. for nextcloud) Option B) Use command line $ sudo ufw enable $ sudo ufw allow ssh $ sudo ufw allow samba $ sudo ufw allow https Note : for samba the following rule might be slightly better $ sudo ufw allow from 192.168.0.0/16 to any app Samba Reference: 2nd answer on https://askubuntu.com/questions/36608/ufw-firewall-still-blocking-smb-despite-adding-rules#184806