Home Linux Mint How to open a firewall on Linux Mint

How to open a firewall on Linux Mint

by Abraham
firewall on linux mint

A firewall protects a network by permitting or stopping data packets depending on security criteria. An effective firewall examines incoming traffic according to predefined criteria and prevents attacks by filtering questionable or unprotected data. Firewalls safeguard computer traffic at ports, where peripheral devices exchange data with a computer.

By deploying firewalls, you may prevent unwanted traffic from accessing your internal network perimeter from malicious sources, such as viruses and hackers. Therefore, this post will define a UFW firewall and demonstrate how to open a firewall port on Linux Mint.

What is Linux Mint’s UFW (Uncomplicated Firewall)?

UFW (Uncomplicated Firewall) is a straightforward and trustworthy firewall interface that includes a command-line interface for dealing with the firewall. UFW has several graphical user interface (GUI) tools that simplify system administration if you opt not to use the command-line interface. Thus, to install UFW through a terminal, you must type the command below:

sudo apt install ufw
 Install UFW

Install UFW

After it is installed, you can verify to see if UFW is has been enabled or not by running the command below:

sudo systemctl status ufw

When you run the command above on the terminal, you will receive the active or inactive status.

ufw active inactive status

UFW active/inactive status

As you’ve seen, the UFW is operational and functioning; the next phase is to configure the firewall to accept any application or port.

How to configure Linux Mint’s firewall to allow ports

Numerous tools in Linux communicate over ports, and SSH is among them. To open the OpenSSH port for outgoing and incoming communication, type this command:

sudo ufw allow openSSH
allow port

allow port

The firewall may prohibit communication due to port permissions, and if you wish to open the port for this cause, type this command:

sudo ufw allow 22/tcp

Note: By typing 22 again, you can see if these rules have indeed been implemented or not.

sudo ufw status verbose
ufw status

UFW status

You can stop or disable any specific communication port by executing the command below:

sudo ufw deny 22/tcp
disable port

Disable port

And upon verification, you will receive the following status.

ufw status

UFW status

How to reset UFW

If you make an error, you can disable and revert the firewall to its default settings.

sudo ufw reset


A firewall protects a network by examining incoming and outgoing data packets and allowing or blocking them per security policies. Firewalls monitor inbound and outgoing network packets and decide whether or not to admit data packets based on a set of security criteria. This article explains how to use the UFW firewall in Linux Mint to open any specified port for communication.

You may also like

Leave a Comment



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us


©2016-2023 FOSS LINUX



“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.