You can disable the Microsoft Defender Firewall on a Windows Server, and in this guide, you will learn how. The Microsoft Defender Firewall is the firewall solution that comes built by default on every installation of Windows and Windows Server to monitor incoming and outgoing network traffic to allow or block connections based on rules to protect the device from unauthorized access.
It’s always recommended to keep the firewall running to prevent making the server vulnerable. However, in some situations, you may need to disable the security feature. For instance, when you have to troubleshoot network-related issues, plan to implement a third-party firewall, or you have to test a network application.
If you must disable the firewall on Windows Server 2022, 2019, and older releases, you can complete this task from Windows Security, Control Panel, Command Prompt, PowerShell, Group Policy, and Registry.
In this guide, you will learn how to disable (re-enable) the built-in firewall on Windows Server.
- Disable firewall on Windows Server from Windows Security
- Disable firewall on Windows Server from Control Panel
- Disable firewall on Windows Server from Command Prompt
- Disable firewall on Windows Server from PowerShell
- Disable firewall on Windows Server from Group Policy
- Disable firewall on Windows Server from Registry
Disable firewall on Windows Server from Windows Security
To disable the firewall on Windows Server, use these steps:
- Open Windows Security on Windows Server.
- Click on Firewall & network protection.
- Click the active network option.
- Turn off the “Microsoft Defender Firewall” toggle switch to disable the firewall.
Quick tip: If you only want to prevent incoming connections, check the “Blocks all incoming connections, including those in the list of allowed apps” option instead of disabling the feature.
Once you complete the steps, the Microsoft Defender Firewall will disable the active network profile.
If you have to disable the firewall for every network profile, open each network profile (“Domain network,” “Private network,” and “Public network”) and turn off the “Microsoft Defender Firewall” toggle switch.
Enable firewall
To enable the firewall on Windows Server, use these steps:
- Open Windows Security on Windows Server.
- Click on Firewall & network protection.
- Click the “Turn on” button from the network profile. Or click the Restore settings button (if applicable).
After you complete the steps, the Microsoft Defender Firewall will enable again on the computer.
Disable firewall on Windows Server from Control Panel
To turn off the Windows Server firewall from Control Panel, use these steps:
- Open Control Panel.
- Click on System and Security.
- Click on Windows Defender Firewall.
- Click the “Turn Windows Defender Firewall on or off” option from the left navigation pane.
- Select the “Turn off Windows Defender Firewall” option under the “Private network settings” section.
- Select the “Turn off Windows Defender Firewall” option under the “Public network settings” section.
- Click the OK button.
Once you complete the steps, the security feature will stop protecting your server.
Enable firewall
To enable the firewall with Control Panel, use these steps:
- Open Control Panel.
- Click on System and Security.
- Click on Windows Defender Firewall.
- Click the “Turn Windows Defender Firewall on or off” option from the left pane.
- Select the “Turn on Windows Defender Firewall” option under the “Private network settings” section.
- Select the “Turn on Windows Defender Firewall” option under the “Public network settings” section.
- Click the OK button.
After you complete the steps, the Windows Server firewall will start monitoring and protecting the server from malicious connections.
Disable firewall on Windows Server from Command Prompt
To turn off the firewall from Command Prompt on Windows Server 2022, 2019, and old versions, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to disable the firewall for the active network profile and press Enter:
netsh advfirewall set currentprofile state off
- (Optional) Type the following command to turn off the firewall for every network profile, including domain, private, and public, and press Enter:
netsh advfirewall set allprofiles state off
- (Optional) Type the following command to turn off the Microsoft Defender Firewall for the domain network profile on Windows Server and press Enter:
netsh advfirewall set domainprofile state off
- (Optional) Type the following command to turn off the firewall for the private network profile and press Enter:
netsh advfirewall set privateprofile state off
- (Optional) Type the following command to turn off the firewall for the public network profile and press Enter:
netsh advfirewall set publicprofile state off
After you complete the steps, the Microsoft Defender Firewall will disable on Windows Server, according to your configuration.
Enable firewall
To turn on the Windows Server firewall from Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to turn on the Microsoft Defender Firewall for the current network profile and press Enter:
netsh advfirewall set currentprofile state on
- (Optional) Type the following command to enable the Defender Firewall for all network profiles on Windows Server and press Enter:
netsh advfirewall set allprofiles state on
- (Optional) Type the following command to enable the Windows Server firewall for the domain network profile and press Enter:
netsh advfirewall set domainprofile state on
- (Optional) Type the following command to enable the firewall for the private network and press Enter:
netsh advfirewall set privateprofile state on
- (Optional) Type the following command to turn on the firewall for the public network profile and press Enter:
netsh advfirewall set publicprofile state on
Once you complete the steps, the Windows Server firewall will enable, according to your configuration.
Disable firewall on Windows Server from PowerShell
To disable the firewall on Windows Server from PowerShell, use these steps:
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to disable the Microsoft Defender Firewall fall all networks and press Enter:
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
Quick tip: If you want to leave one or more networks protected with the firewall, then make sure to remove the profile name from the command.
After you complete the steps, the Windows Server firewall will disable on the server.
Enable firewall
To enable the firewall with PowerShell commands, use these steps:
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to enable the Microsoft Defender Firewall for all networks and press Enter:
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True
Once you complete the steps, the PowerShell command will enable the firewall to allow and deny network access.
Disable firewall on Windows Server from Group Policy
To disable the Windows Server firewall through Group Policy, use these steps:
- Open Start.
- Search for gpedit.msc and click the top result to open the Local Group Policy Editor.
- Open the following path:
Computer Configuration > Administrative Templates > Network > Network Connections > Windows Defender Firewall > Standard Profile
- Double-click to open the “Windows Defender Firewall: Protect all network connections” policy.
- Check the Disabled option.
- Click the Apply button.
- Click the OK button.
- Restart the server.
After you complete the steps, the server will restart to apply the new settings to disable the firewall.
Enable firewall
To enable the Windows Server firewall through Group Policy, use these steps:
- Open Start.
- Search for gpedit.msc and click the top result to open the Local Group Policy Editor.
- Open the following path:
Computer Configuration > Administrative Templates > Network > Network Connections > Windows Defender Firewall > Standard Profile
- Double-click to open the “Windows Defender Firewall: Protect all network connections” policy.
- Check the “Not configured” option.
- Click the Apply button.
- Click the OK button.
- Restart the server.
After you complete the steps, the server will restart to enable the Microsoft Defender Firewall.
Disable firewall on Windows Server from Registry
To turn off the firewall using the Windows Server Registry, use these steps:
- Open Start.
- Search for regedit and click the top result to open the Registry.
- Open the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall
- Right-click the “WindowsFirewall” key, select the New menu, and choose the “Key” option.
- Name the key StandardProfile and press Enter.
- Right-click the “StandardProfile” key, select the New menu, and choose the “DWORD (32-bit) Value” option.
- Name the EnableFirewall name and press Enter.
- Double-click the newly created key and set the value to “0”.
- Click the OK button.
- Restart the server.
Once you complete the steps, the Windows Server will restart to apply the settings.
Enable firewall
To enable the Windows Server firewall from the Registry, use these steps:
- Open Start.
- Search for regedit and click the top result to open the Registry.
- Open the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\StandardProfile
- Right-click the EnableFirewall key and choose the Delete option.
- Click the OK button.
- Restart the server.
After you complete the steps, the Windows Server will enable the firewall.