To turn off the firewall in Windows 11, open Windows Security, select Firewall & network protection, pick the network marked (active), and switch Microsoft Defender Firewall to Off. Turn it back on the same way as soon as you’re done.
Microsoft warns in its Windows Security firewall guide that turning off the firewall could make your device more vulnerable to unauthorized access, and that if an app you need is being blocked, you can allow it through instead. Its firewall command-line documentation goes further and advises against disabling Windows Firewall at all, because you lose protections such as IPsec connection security rules and boot-time filters. Use the steps below for short troubleshooting only.
How to turn off the firewall in Windows 11

- Click Start, type Windows Security, and open it.
- Select Firewall & network protection. Windows Security shows which type of network you’re connected to.
- Select the network profile that says (active): Domain network, Private network or Public network.
- Under Microsoft Defender Firewall, switch the setting to Off.

- Select Yes if Windows asks for permission.
The firewall is off for that network type only; the other profiles stay on. To turn it back on, follow the same steps and switch it to On.
A safer option: allow one app through the firewall

- In Windows Security, select Firewall & network protection.
- Select Allow an app through firewall.
- Select Change settings.
- Find the app and check the box for Private, Public or both. If it isn’t listed, select Allow another app and browse to it.

- Select OK.
That app can communicate while the firewall keeps blocking everything else. Allowing apps through the firewall has risks too, so only allow apps you trust.
Allow a Specific Inbound Port Without Turning Off the Firewall
Use a port rule when an app needs one inbound port open. Sign in as an administrator and find out which TCP or UDP port the app uses. Microsoft’s page on port rules and the Custom rule wizard has the full options.
- Select Start, type
wf.msc, and press Enter to open Windows Defender Firewall with Advanced Security. - Select Inbound Rules in the left pane, then New Rule in the right pane.
- Choose Port and select Next.
- Choose TCP or UDP, select Specific local ports, enter only the ports you need, and select Next.

- Choose Allow the connection and select Next.
- Check only the profiles you need. Use Private for a trusted home network. On a work network, ask IT.
- Enter a name you’ll recognize and select Finish. The firewall stays on.
To limit who can connect, open the rule’s Properties > Scope and add the remote IP addresses. Test from the other computer while the app is running. The rule doesn’t forward a router port or override a policy set by your organization. To turn the exception off, select the rule and choose Disable Rule.
For example, after installing IIS on Windows 11, other devices on your network need TCP port 80 open to reach its test website.
To check whether the port answers from another Windows PC, enable the Telnet client on Windows 11 and run telnet followed by this PC’s address and the port number.
Private vs. public networks
The key difference is whether other devices on the same network can see and connect to your PC. Your home network is typically private, because you trust the devices on it. Coffee shop Wi-Fi is public, where most devices belong to strangers, so Windows applies stricter rules. If you must turn the firewall off, never do it for a public network.
If you also use a Mac, here’s how to turn on the firewall on a Mac.
Other ways to turn the firewall off or on
- Control Panel: open Control Panel, go to System and Security > Windows Defender Firewall, and select Turn Windows Defender Firewall on or off.
- PowerShell (as administrator): run
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled Falseto turn the firewall off for all profiles, and the same command withTrueto turn it back on.
Microsoft also warns not to “turn off” the firewall by stopping the Windows Defender Firewall service (MpsSvc). That isn’t supported and can break the Start menu, app installs and updates, and other features. Turn off the profiles instead, as shown above.
Useful firewall settings to try first
- Restore firewalls to default: on the Firewall & network protection page, this resets changes that may be causing problems. Any organization policies are reapplied.
- Network and Internet troubleshooter: on the same page, it tries to diagnose general connection issues automatically.
- Block all incoming connections: inside a network profile, this checkbox ignores the allowed apps list for maximum protection, though some apps may stop working.
Why can’t I change the firewall setting?
If your PC is managed by a work or school, policy settings might prevent you from changing the firewall. Ask your IT team for help.
When one site won’t load, the firewall is rarely the cause. Try to unblock websites on Windows 11 instead.
Frequently asked questions
What should I try before turning off the firewall?
If you’re fixing a connection problem, try resetting your network settings. For sharing between PCs, you can turn on network discovery or enable Remote Desktop.
Is the firewall the same as antivirus?
No. Antivirus is a separate setting in Windows Security. Here’s how to turn off Windows Defender in Windows 11.
Does the firewall turn back on by itself?
Don’t count on it. Switch it back on yourself in Windows Security as soon as you finish troubleshooting, and check every network profile you changed.

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are checked step by step against the device or app maker’s own documentation and tested on his own devices whenever he has the hardware or software, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.