This describes how to set up and use ufw on Debian 10 Buster

Installation
Ensure your server is up to date with apt-get update && apt-get upgrade.
Install ufw with apt-get install ufw
Add port 22 to the firewall so you don't block ssh access to the server ufw allow ssh
Ensuring you have completed step 3, enable the firewall with ufw enable

Configuration
Allowing a single port
Allowing port 80 on TCP ufw allow 80/tcp
Allowing port 80 on UDP ufw allow 80/udp
Allowing port 80 on both ufw allow 80
Allowing multiple ports
Allowing ports 80 and 443 ufw allow 80,443
Allowing a range of ports
Allowing ports 27010-27050 ufw allow 27010:27050
Allowing access from a specific IP
Allowing from 89.47.26.38 ufw allow from 89.47.26.38
Was this article helpful?
Cancel
Thank you!