Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Selfhosted
  3. Do I really need a firewall for my server?

Do I really need a firewall for my server?

Scheduled Pinned Locked Moved Selfhosted
selfhosted
64 Posts 39 Posters 272 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I [email protected]

    You should, yes. I run a firewall (I usually use ufw) on all of my Internet-connected devices, since all of my devices run Linux. There's not really any good reason not to in 2025.

    S This user is from outside of this forum
    S This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #61

    But is there a good reason to run one on a server? Any port that's not in use won't allow traffic in. Any port that's in use would be added to the firewall exception anyway.

    The only reasons I can think of to use a firewall are:

    • some services aren't intending to be accessible - with containers, this is really easy to prevent
    • your firewall also does other stuff, like blocking connections based on source IP (e.g. block Russia and China to reduce automated cyber attacks if you don't have users in Russia or China)

    Be intentional about everything you run, because each additional service is a potential liability.

    I F 2 Replies Last reply
    0
    • S [email protected]

      But is there a good reason to run one on a server? Any port that's not in use won't allow traffic in. Any port that's in use would be added to the firewall exception anyway.

      The only reasons I can think of to use a firewall are:

      • some services aren't intending to be accessible - with containers, this is really easy to prevent
      • your firewall also does other stuff, like blocking connections based on source IP (e.g. block Russia and China to reduce automated cyber attacks if you don't have users in Russia or China)

      Be intentional about everything you run, because each additional service is a potential liability.

      I This user is from outside of this forum
      I This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #62

      Because it's easy to accidentally run services or set up services temporarily and forget that you left them running. With UPnP being able to automatically/dynamically open ports, a firewall is just another layer of protection. You can also configure firewalls to ignore packets silently or log dropped packets, and if applications ever get new versions and end up listening on new ports, you would have to manually allow the ports. Maybe you want to have one part of an application accessible through the firewall but not another part of the application.

      Plus, like you said, country blocking is nice, and there are also other features too like being able to throttle connections, especially with things like fail2ban.

      It's just another layer of protection, and it ensures that everything you run is deliberate.

      S 1 Reply Last reply
      0
      • S [email protected]

        But is there a good reason to run one on a server? Any port that's not in use won't allow traffic in. Any port that's in use would be added to the firewall exception anyway.

        The only reasons I can think of to use a firewall are:

        • some services aren't intending to be accessible - with containers, this is really easy to prevent
        • your firewall also does other stuff, like blocking connections based on source IP (e.g. block Russia and China to reduce automated cyber attacks if you don't have users in Russia or China)

        Be intentional about everything you run, because each additional service is a potential liability.

        F This user is from outside of this forum
        F This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #63

        This is the right way to think about it. NAT is by its nature a form of firewall. As long as you do t put a host in the DMZ, using NAT is good enough unless you plan to use web application firewalls.

        1 Reply Last reply
        0
        • I [email protected]

          Because it's easy to accidentally run services or set up services temporarily and forget that you left them running. With UPnP being able to automatically/dynamically open ports, a firewall is just another layer of protection. You can also configure firewalls to ignore packets silently or log dropped packets, and if applications ever get new versions and end up listening on new ports, you would have to manually allow the ports. Maybe you want to have one part of an application accessible through the firewall but not another part of the application.

          Plus, like you said, country blocking is nice, and there are also other features too like being able to throttle connections, especially with things like fail2ban.

          It's just another layer of protection, and it ensures that everything you run is deliberate.

          S This user is from outside of this forum
          S This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #64

          It honestly depends on how you run things.

          If everything is in containers, chances are you're already getting the benefits of a firewall. For example, with podman or docker, you already explicitly expose ports, which is already a form of firewall. If you're running things outside of containers, then yeah, I agree with you, there's too much risk of something opening up a port you didn't expect.

          Everything I run is with podman, which exposes stuff with iptables rules. That's the same thing a basic firewall does, so adding a firewall is superfluous unless you're using it to do something else, like geoip filtering.

          When in doubt, use a firewall. But depending on the setup, it could be unnecessary.

          1 Reply Last reply
          0
          • System shared this topic on
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups