How to Turn Off the Firewall on Windows 11

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

Windows Security Firewall and network protection page listing the three network profiles
Select the network profile marked (active) to change its firewall setting.
  1. Click Start, type Windows Security, and open it.
  2. Select Firewall & network protection. Windows Security shows which type of network you’re connected to.
  3. Select the network profile that says (active): Domain network, Private network or Public network.
  4. Under Microsoft Defender Firewall, switch the setting to Off.
Recreated Windows Security Private network detail with the active network name masked and Microsoft Defender Firewall shown Off
The selected Private network profile is shown with Microsoft Defender Firewall Off. This is a recreated example; the active network name is masked.
  1. 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

Steps to allow an app through the Windows 11 firewall
Allowing a single app keeps the rest of your PC protected.
  1. In Windows Security, select Firewall & network protection.
  2. Select Allow an app through firewall.
  3. Select Change settings.
  4. 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.
Recreated Windows Firewall Allowed apps list with a fictional Sample App checked for Private and unchecked for Public
After selecting Change settings, check the app for the network type you need. This example allows a fictional Sample App on Private networks only; Allow another app is available below the list.
  1. 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.

  1. Select Start, type wf.msc, and press Enter to open Windows Defender Firewall with Advanced Security.
  2. Select Inbound Rules in the left pane, then New Rule in the right pane.
  3. Choose Port and select Next.
  4. Choose TCP or UDP, select Specific local ports, enter only the ports you need, and select Next.
New Inbound Rule Wizard with TCP and a specific local port entered
Choose the required protocol and Specific local ports, then enter the port needed by the app. This example shows TCP port 25565 before selecting Next.
  1. Choose Allow the connection and select Next.
  2. Check only the profiles you need. Use Private for a trusted home network. On a work network, ask IT.
  3. 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 False to turn the firewall off for all profiles, and the same command with True to 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.