# Configure a firewall for Discourse

**URL:** https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584
**Category:** Self-Hosting
**Tags:** configuring, how-to
**Created:** [September 29, 2014, 9:44am UTC](https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584 "2014-09-29T09:44:21Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 14, 2023, 6:28am UTC](https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584/5 "2023-03-14T06:28:47Z")

</div>

Topic isn’t totally accurate. If UFW is used outside docker, as ”normally” on VPS, it doesn’t apply per se with Discourse. I can disable port 80 and it is still wide open to Discourse/docker.

Sure, it protects everything else but if there isn’t any other services listening it is unnecessary.

I don’t know how UFW or iptables works if used after `enter app` or can firewall use that way at all.

I’m referencing to this topic:

> [@Will UFW limit Discourse too?](https://meta.discourse.org/t/will-ufw-limit-discourse-too/231873):
>
> How can Discourse bypass UFW? I had enabled only port 22 so all other ports should be closed then. But a forum worked anyway. How’s that possible? DigitalOcean droplet, but that should not mean anything. And no one-click install, but official way. This is not a pure support question, but we don’t have here a catogory named Stupid basic questions by beginners wink

---

_[View the full topic](https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584)._
