Skip to content
Security2 min read

What is a firewall?

Short answer

A firewall is a system that sits between a server and the internet and decides which connections pass and which are blocked, using rules based on source IP, port and protocol. For example, it allows port 443 for websites and closes internal ports such as the database port.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. How it works
  2. Example: typical rules for a web server
  3. Types of firewall
  4. Common problems
  5. On ArabyHost

Every service on a server listens on a port: the web on 80 and 443, SSH on 22, MySQL on 3306. Without a firewall, anyone on the internet can try to connect to all of them. A firewall closes what the public doesn’t need and blocks abusive sources.

How it works

Each connection is checked against a list of rules in order, and the first matching rule decides its fate: allow or deny. Modern firewalls are stateful: they know that the reply to a request the server sent out is allowed, without a separate rule.

Example: typical rules for a web server

Port Service Rule
80, 443 HTTP and HTTPS Open to everyone
22 SSH Open, with automatic blocking after failed logins
3306 MySQL Closed from outside; used inside the server only
Anything else - Closed by default

On your own Ubuntu server with root access, these rules can be written with ufw:

sudo ufw default deny incoming
sudo ufw allow 22/tcp
sudo ufw allow 80,443/tcp
sudo ufw enable

Careful: allow SSH before enabling the firewall, or you’ll lock yourself out.

Types of firewall

  • Network firewall: a device or service in front of several servers.
  • Host firewall: software on the server itself, such as iptables, nftables or firewalld.
  • Web application firewall (WAF): inspects the content of web requests, a different layer.

Common problems

  • Blocking yourself: a phone retrying email with an old password can get the whole office IP blocked, showing errors such as connection timed out.
  • Forgetting to open a new app’s port on your own server, so the app works internally but nobody can reach it.

On ArabyHost

On shared hosting you don’t manage the firewall yourself, since there’s no root access. Imunify360 security handles the server firewall and automatically blocks addresses known for attacks and those that repeat failed logins. If your address gets blocked, search “what is my IP” to find it and send it to our Arabic support team to have it removed.

FAQ

What's the difference between a firewall and a WAF?

A firewall works at network level and looks at addresses and ports. A WAF reads the content of HTTP requests and looks for attacks such as SQL injection. They complement each other.

How can I tell the firewall has blocked my IP?

Every service fails at once from your device (website, email, FTP) with timeouts, while everything works over mobile data. That usually means your IP was blocked after failed logins.

Do I need a firewall on my computer if the server is protected?

Yes, because they protect different things. The server's firewall protects the site; your computer's firewall protects your device from unwanted connections on the local network.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.