[Linux] How to Set Up a Firewall using UFW on Ubuntu


Staff member
Apr 22, 2020
In Your Mind
This tutorial is basic but can resolve some problems with blocked ports.

I'll explain using UFW.

Open Terminal and follow these commands (I will use a port example):

sudo ufw enable
If you get a message that UFW is not installed, type this command:

sudo apt-get install ufw
And now:

sudo ufw status
At this moment your UFW is ON

To open your port, it is very easy. Open your torrent software and copy your port.
Now, type this command:

sudo ufw allow 1234/tcp
sudo ufw allow 1234/udp
If you want to block any port, just change ''allow'' to ''deny''.

Don't forget to change ''1234'' to your port that you are using in your torrent software.

Now you are Connectable!
  • Love
Reactions: GODFATHER