Turning off the Windows firewall is occasionally the right diagnostic step and almost never the right permanent state. This guide shows how to do it, how to undo it, and — more usefully — how to solve the underlying problem without leaving the firewall off.

What the firewall actually protects you from. It blocks unsolicited inbound connections. On a home network behind a router that is a second layer — but on public wi-fi it is the only layer between your machine and everyone else on that network. Turning it off there exposes file sharing, remote desktop and any service listening on your machine directly.
Checked August 2026. Applies to Windows 11 and Windows 10 22H2.
Do this instead, in most cases
Almost every reason people give for disabling the firewall has a targeted answer that keeps it on.
An application cannot connect
Allow that one application rather than everything:
- Open Windows Security → Firewall & network protection.
- Select Allow an app through firewall → Change settings.
- Find the app and tick Private, and Public only if you genuinely need it there.
- If it is not listed, Allow another app → Browse to its
.exe.
A game or server needs an inbound port
- Press Win + R, run
wf.msc. - Select Inbound Rules → New Rule.
- Choose Port, enter the port, and restrict the rule to the Private profile.
A rule for one port on the private network is a very different thing from switching the firewall off.
Printer or file sharing is not working
Set the network to Private rather than disabling anything: Settings → Network & internet → your connection → Private network. Windows blocks discovery on Public networks by design, which is usually the actual cause.
Turning it off temporarily
For a genuine diagnostic test — is the firewall the reason this does not work?
- Open Windows Security.
- Select Firewall & network protection.
- Choose the profile marked (active) — Domain, Private or Public.
- Turn Microsoft Defender Firewall off.
- Test, then turn it straight back on.
Turn off only the active profile. Disabling all three is broader than any test requires.
From the command line
From an elevated prompt, to disable the private profile only:
netsh advfirewall set privateprofile state off
To turn it back on:
netsh advfirewall set privateprofile state on
To check every profile at once:
netsh advfirewall show allprofiles state
In PowerShell:
Get-NetFirewallProfile | Select-Object Name, Enabled
Set-NetFirewallProfile -Profile Private -Enabled False
Understanding the three profiles
| Profile | Used for | Default behaviour |
|---|---|---|
| Domain | A network with a domain controller | Managed by your organisation |
| Private | Home and trusted networks | Discovery and sharing allowed |
| Public | Cafés, airports, hotels | Most inbound traffic blocked |
Windows applies rules per profile, which is why a printer that works at home fails on a hotel network. The fix is the profile, not the firewall.
Resetting the firewall
If rules have accumulated to the point where you cannot tell what is blocking what, reset to defaults rather than switching it off:
netsh advfirewall reset
This removes every custom rule, including ones added by applications, so they will prompt again on next use.
Turning it back on
The important half of this page.
- Windows Security → Firewall & network protection.
- Turn it on for every profile — Domain, Private and Public.
Or in one command from an elevated prompt:
netsh advfirewall set allprofiles state on
Windows Security will show a warning for as long as any profile is off, which is a useful reminder rather than a nuisance.
If you cannot turn it on
- Third-party antivirus with its own firewall — many disable the Windows one deliberately. Having two active is genuinely problematic; pick one.
- Group Policy on a work machine — controlled by IT and not changeable locally.
- The service is stopped: run
services.mscand confirm Windows Defender Firewall is Automatic and running. - System file damage: run
DISM /Online /Cleanup-Image /RestoreHealththensfc /scannow.
Frequently asked questions
Is it safe to disable the firewall on a home network?
Less dangerous than on public wi-fi, because your router blocks unsolicited inbound traffic from the internet. It still leaves you exposed to everything else on your own network — including a compromised device you do not know about. Allow the specific app instead.
Do I need it if I have antivirus?
They do different jobs. Antivirus inspects files and behaviour; the firewall controls network connections. Most security suites include their own firewall, and in that case one is enough — but “none” is not the same as “one”.
Will disabling it make my internet faster?
No. The firewall’s effect on throughput is not measurable on a normal connection.
What is the difference between the firewall and Defender antivirus?
Microsoft Defender Antivirus scans files and processes. Microsoft Defender Firewall filters network traffic. Both appear in Windows Security and can be controlled separately.
Why does an app keep asking for firewall access?
Because it changed — an update alters the executable, and the existing rule no longer matches. Allow it once for the right profile and the prompt stops until the next update.
1 comment