How to Allow a Port Through Windows Firewall

Some apps, game servers and remote tools need an inbound port open in Windows Defender Firewall. You add a rule for the exact port and protocol, and only on the network profiles that need it. Windows 10 reached end of support on October 14, 2025. Consumer Extended Security Updates (ESU) now run until October 12, 2027. The same steps work on Windows 11.

Quick Answer

Open Windows Defender Firewall with Advanced Security, select Inbound Rules, New Rule, choose Port, enter the TCP or UDP port number, choose Allow the connection, pick the profiles and name the rule.

How to Allow a Port Through Windows Firewall

  1. Press Windows plus R, type wf.msc and press Enter to open Windows Defender Firewall with Advanced Security.
  2. Select Inbound Rules, then New Rule in the right pane.
  3. Choose Port and click Next.
  4. Pick TCP or UDP, choose Specific local ports and type the port, such as 8080.
  5. Choose Allow the connection, then select Domain, Private and/or Public. Leave Public unchecked unless you need it.
  6. Name the rule clearly, such as Game server 8080, and click Finish.
New Inbound Rule Wizard Protocol and Ports step with Specific local ports highlighted
Choose Specific local ports and enter the port number.

Rule Choices

Setting Recommendation
Protocol Match what the app documents (TCP, UDP or both as two rules)
Ports Only the ones you need
Profiles Private for home networks; avoid Public
Direction Inbound for incoming connections
Name Something you will recognize later

Troubleshooting

Frequently Asked Questions

Is opening a port safe?

It adds risk. Open only what you need, on private networks, and remove rules you no longer use.

Can I do this with PowerShell?

Yes. New-NetFirewallRule with the port, protocol and action parameters creates the same rule.

How do I remove the rule?

Right-click it in Inbound Rules and choose Delete, or Disable Rule to keep it for later.

Do I need an outbound rule?

Usually not. Windows allows outbound traffic by default.

Summary

  1. Open wf.msc.
  2. Inbound Rules, New Rule, Port.
  3. Choose protocol and port.
  4. Allow the connection on the right profiles.
  5. Name it and finish.