Skip to content
Fixes & Errors

Windows Firewall Blocking an App: How to Unblock It Safely

Windows 11 firewall blocking programs stops apps from reaching the internet with no clear error. Here are all the fixes — allow rules, network profiles, third-party firewalls, and resets.

Windows Firewall Blocking an App: How to Unblock It Safely

Windows 11 Firewall blocking a program — an application can’t connect to the internet, a local network service isn’t reachable, or an error message mentions “Windows Firewall” or “blocked by security software” — is one of the more straightforward troubleshooting problems because the fix location is well-defined. The question is just whether to allow the app through, and how to do it safely. You’ll find the complete rundown in our Complete Guide to Fixing Windows, Browser, and Software Errors.

Important first step: confirm Windows Firewall is actually the cause. Temporarily disable the firewall (Windows Security → Firewall → turn off the firewall for Private networks only) and test the application. If it works with the firewall off: the firewall is blocking it. If it still fails: the firewall isn’t the issue — look at antivirus, the application itself, or network configuration instead. Re-enable the firewall after this test.

Fix 1: Allow the app through the firewall

This is the correct way to unblock an application — creating an explicit allow rule rather than disabling the firewall entirely.

  1. Windows Security → Firewall and network protection → “Allow an app through firewall”
  2. Click “Change settings” (requires administrator permission)
  3. Scroll through the list to find the application → check both “Private” and “Public” checkboxes as appropriate
  4. If the app isn’t in the list: “Allow another app” → Browse → navigate to the application’s executable → Add
  5. Click OK

For most home use: allowing an application on “Private” networks (your home Wi-Fi) is sufficient. Adding “Public” network access is only needed for applications you use on public Wi-Fi and need network access on those networks.

Fix 2: Create an inbound rule for server applications

Applications that need to accept incoming connections (local servers, game hosts, remote access tools) require inbound firewall rules. The “Allow an app” approach above only covers outbound connections for most applications. For inbound:

Windows Security → Firewall → Advanced settings → Inbound Rules → New Rule → Program → Next → “This program path” → browse to the executable → Next → “Allow the connection” → Next → select networks (Private, Public, Domain) → Next → name the rule → Finish.

After creating the rule: test whether the application now accepts incoming connections. If a specific port is needed rather than the application executable: choose “Port” instead of “Program” in the rule type step.

Identifying what’s being blocked

The Windows Firewall event log shows every blocked connection attempt. Windows Security → Firewall → Advanced settings → Monitoring → Firewall → this shows active rules, but for blocked events: Event Viewer → Windows Logs → Security → filter for Event ID 5157 (network connection blocked). Each event shows the application path, source/destination IPs, and port numbers — the information needed to create a precise allow rule.

Network profile matters

Windows classifies each network as Private, Public, or Domain. Firewall rules apply to specific profiles. If an application works at home (Private network) but not on corporate Wi-Fi (Domain network) or coffee shop Wi-Fi (Public network): the firewall rule allows Private but not the other profiles. Check the rule’s profile assignment in Advanced settings → Inbound/Outbound Rules → right-click the rule → Properties → Advanced tab → Profiles.

Resetting Windows Firewall to defaults

If firewall rules have accumulated over time and an application worked previously but stopped: resetting to defaults removes all custom rules and starts fresh. Windows Security → Firewall → “Restore firewalls to default” → Restore defaults. Warning: this removes all custom allow rules, not just problematic ones. You’ll need to re-allow all applications that were previously permitted.

Only use this as a last resort for persistent firewall issues. Exporting the current rules first (Advanced settings → Action → Export Policy) provides a backup to restore from if needed.

Third-party firewall complication

If you have antivirus or security software (Norton, McAfee, Kaspersky, Bitdefender, Malwarebytes Premium) that includes a firewall: there may be two firewalls active simultaneously. Windows Defender Firewall usually deactivates when a third-party firewall is installed, but sometimes both remain active. Rules added to Windows Firewall don’t affect the third-party firewall’s rules. Check the third-party software’s own firewall settings for the blocked application.

Our guide on VPN and network security covers the network profile settings that affect firewall rule application. For application-specific connectivity issues where firewall rules are correctly set, our network connectivity guide covers DNS and routing issues that can mimic firewall blocking. Microsoft’s Windows Firewall documentation covers the full Advanced Security console with rule creation, monitoring, logging configuration, and the PowerShell commands for firewall management — useful for scripting firewall changes across multiple machines.

PowerShell firewall commands

For quick firewall rule management from the command line:

# Allow an application through the firewall (all profiles)
New-NetFirewallRule -DisplayName "MyApp" -Direction Inbound -Program "C:Pathtoapp.exe" -Action Allow

# Check existing rules for a specific program
Get-NetFirewallRule | Where-Object {$_.DisplayName -like "*MyApp*"}

# Disable a specific rule temporarily
Disable-NetFirewallRule -DisplayName "MyApp"

# View all currently blocked connections in real-time
netsh advfirewall monitor show firewall rule name=all

PowerShell commands are particularly useful for unblocking server applications across multiple machines or when creating rules during software deployment. The New-NetFirewallRule command is more precise than the GUI because it allows specifying protocol, port, direction, and profile in a single command.

Firewall and specific ports

Some applications need specific ports open rather than full application access. Common ports worth knowing:

Port Protocol Common use
80 TCP HTTP web traffic
443 TCP HTTPS web traffic
3389 TCP/UDP Remote Desktop (RDP)
5353 UDP mDNS (Chromecast, AirPlay discovery)
3074 TCP/UDP Xbox/Microsoft gaming
22 TCP SSH

Creating port-specific rules (Advanced settings → New Rule → Port → specify port number and TCP/UDP → Allow) is more secure than application-level rules when the exact ports are known — it limits what traffic is permitted rather than allowing all traffic from a specific executable.

Game servers and peer-to-peer applications

Multiplayer games and peer-to-peer applications often need both inbound and outbound rules. The “Allow an app through firewall” method creates an outbound rule primarily. If a game requires port forwarding for hosting: creating a specific inbound rule for the game’s server port allows other players to connect to your hosted session. Game developers usually document the required ports in their support pages.

Logging blocked connections

Enabling firewall logging helps identify exactly what’s being blocked. Windows Firewall → Properties → Private Profile (or whichever profile applies) → Logging → “Log dropped packets” → Yes → note the log file path (usually C:WindowsSystem32LogFilesFirewallpfirewall.log). This log records every blocked connection with timestamps, source/destination, and ports — the most precise diagnostic for persistent firewall blocking where the blocked application isn’t obvious.

Windows Firewall in corporate environments

On domain-joined machines: firewall rules are often managed through Group Policy or Microsoft Intune. Local rules created through Windows Security or PowerShell may be overridden at the next Group Policy refresh (every 90 minutes by default). Signs: rules you create revert or disappear. IT manages these policies; contact them to add required application rules at the domain level, which persist through policy refreshes.

Domain admins can create firewall policies that apply per-user, per-device, or per-network connection — providing fine-grained control that local firewall management can’t match.

Firewall blocking vs application misconfiguration

Not every “connection refused” error is a firewall issue. Signs the problem isn’t the firewall:

  • The application fails with the firewall disabled — the firewall was never the cause
  • The application connects to some servers but not others — selective blocking suggests DNS or routing, not firewall
  • Event Viewer shows no 5157 events for the application — Windows isn’t blocking it; the application or server is the issue
  • Other computers on the same network have the same problem — server-side issue, not local firewall

Confirming the firewall is the cause (by temporarily disabling and testing) before adding allow rules avoids the mistake of adding unnecessary firewall exceptions for problems that have nothing to do with the firewall.

Safe firewall practices

When unblocking applications through the firewall:

  • Only allow applications you recognise and trust — malware sometimes requests firewall exceptions
  • Use “Private” network profile access for home applications; avoid “Public” unless genuinely needed on public networks
  • Remove unused firewall rules periodically — accumulated allow rules are a security risk. Advanced settings → review rules and delete entries for applications no longer installed
  • Document custom rules so they can be recreated after a firewall reset

Windows Firewall is one of the most effective built-in security tools and shouldn’t be permanently disabled even temporarily to solve application problems. Adding specific allow rules is the correct approach — it maintains firewall protection while resolving the specific blocking issue.

For users who frequently install new software and run into firewall blocks: Windows Defender is typically good about prompting “Do you want to allow [application] to communicate on private networks” the first time an application tries to make a network connection. If you accidentally clicked “Cancel” or “No” when this prompt appeared: the application got blocked and didn’t get another chance to prompt. Going to Windows Security → Firewall → Allow an app through firewall and manually adding the application is the resolution for these accidentally-denied applications — the prompt doesn’t appear again for the same application once it’s been denied.

NetSh commands for firewall management

The older netsh advfirewall commands work for firewall management on all Windows versions and are useful for legacy compatibility:

# Add a new allow rule for a specific program
netsh advfirewall firewall add rule name="MyApp" dir=in action=allow program="C:pathtoapp.exe" enable=yes

# Add an allow rule for a specific port
netsh advfirewall firewall add rule name="Port8080" dir=in action=allow protocol=TCP localport=8080

# Delete a rule
netsh advfirewall firewall delete rule name="MyApp"

These commands are useful in scripts, batch files, and situations where PowerShell is not available. The netsh commands produce less verbose output than PowerShell equivalents but are more consistent across Windows versions.

Firewall and Windows Subsystem for Linux (WSL)

WSL applications running on Windows 11 have a complex relationship with Windows Firewall. WSL2 uses a virtual machine with its own network adapter, meaning WSL applications accessing the network appear to Windows Firewall as coming from a different IP (the WSL VM’s IP) rather than localhost. If a WSL application can’t reach external services or Windows services can’t reach WSL-hosted servers: both the Windows Firewall rules (allowing the WSL IP range) and the WSL networking configuration need to be correctly set. This is a common frustration for developers setting up development servers in WSL and needing Windows Firewall to allow connections.

One pattern that’s easy to miss: applications installed in non-standard locations (not Program Files, not AppData) sometimes don’t get the automatic firewall prompt because Windows considers non-standard location executables less trusted. If an application installed to a custom location never prompted for firewall access and can’t connect: manually adding it through Advanced settings → New Rule → Program → browse to the executable is the resolution. Always verify the executable path matches what’s actually installed — using the wrong path (a launcher instead of the main executable) creates a rule that doesn’t apply to the actual connection being made.

Firewall troubleshooting has a clear starting point (disable firewall → test → re-enable) and a clear endpoint (application-specific allow rule or port rule in Advanced settings). Everything between those points is about identifying precisely what needs to be allowed — whether that’s a specific executable, a specific port, or a specific protocol direction. The Event Viewer’s Security log (Event ID 5157) and the firewall’s own logging provide the specific information that makes rule creation precise rather than guesswork. Adding overly broad rules (“allow all traffic from all applications”) defeats the purpose of having a firewall — the goal is the minimum necessary exception to allow the specific application to function.

For users who regularly deploy new applications in a Windows environment: developing a firewall rule template for common application types (local servers, peer-to-peer, remote access) saves time compared to creating rules from scratch each time. The Windows Firewall policy export/import function (Advanced settings → Action → Export Policy → saves all rules as a .wfw file that can be imported on other machines) allows standardised firewall configurations to be applied consistently without manual rule creation on each machine. This is the professional approach to firewall management that IT administrators use to maintain consistent security posture across many machines.

To recap the priority order: disable firewall temporarily to confirm it’s the cause → add a specific allow rule through Windows Security (the simplest approach) → if inbound connections are needed, use Advanced settings to create an inbound rule → confirm through Event Viewer if the rule isn’t working. Third-party firewalls require their own interface for rule management separate from Windows Firewall. This logical flow handles firewall blocking for virtually all home and professional applications without compromising system security. Related: Windows 11 Display Scaling Blurry.

Nikolas Lamprou

Nikolas Lamprou (MSc; GCFR, SC-200, Security+) has been working with computers professionally since 2009 — starting with web development and e-commerce, and moving into cybersecurity over the years. Based in Greece, he brings over 15 years of real-world IT experience to SolveTechToday, where he writes about Windows fixes, software reviews, security tools, and AI applications. His goal is straightforward: cut through the noise and give readers clear, honest guidance on the tech decisions that matter.

Stay Ahead

Fix your next problem before it starts

Get the week's best Windows fixes, software picks, and security guides delivered straight to your inbox. No noise, just solutions.

Press ESC to close · Try "Windows 11" or "Chrome"