# Ubuntu UFW Firewall Setup and Basic Rules

https://fiberserver.net.tr/knowledgebase/article/ubuntu-ufw-firewall-setup-basic-rules

UFW is Ubuntu's user-friendly interface for host firewall rules. Allow SSH before enabling it on a remote server.

## Basic setup

```
sudo ufw allow OpenSSH\nsudo ufw allow 80/tcp\nsudo ufw allow 443/tcp\nsudo ufw enable\nsudo ufw status numbered
```

## Restrict management access

When you have a stable management IP, limit SSH to that address. Keep the current session open while testing.

## Maintain rules

Review numbered rules, remove obsolete entries and enable logging when needed. A firewall complements updates, strong authentication and monitoring.
