Setting up a firewall is an important step in securing your Ubuntu 23.10 server. UFW (Uncomplicated Firewall) is a user-friendly interface for managing iptables, the default firewall management tool in Ubuntu. Here's a step-by-step guide on how to set up a firewall with UFW:
Step 1 : Install UFW (if not already installed)

Step 2 : Check UFW Status
Before configuring UFW, it's a good idea to check its status:

If it's not active, the output will say "Status: inactive."
Step 3 : Allow SSH Access
If you are accessing your server via SSH, you'll need to allow SSH traffic.

Step 4 : Allow Other Necessary Services
If your server runs other services (e.g., HTTP, HTTPS), you should allow traffic for those services:

Step 5 : Enable UFW
Now that you have configured your rules, enable UFW:

You'll be prompted to confirm that you want to proceed. Type 'y' and press Enter.
Step 6 : Check UFW Status Again
Verify that UFW is now active and that the rules are applied:

The output should show the rules you have configured.
Step 7 : Commonly Used Commands:
- Delete Rules : If you need to delete a rule, use the following syntax:

- Reset UFW : If you want to start over and delete all rules, you can reset UFW

- Disable UFW : If you need to temporarily disable UFW

Congratulations! You have successfully installed and enabled UFW on your Ubuntu 23.10 server.