How to Open Ports on Windows 11

Last updated on November 17th, 2026 at 03:15 pm

Opening a port on Windows 11 Home or Pro means adding an inbound rule to Windows Defender Firewall. Press Windows logo key + R, type wf.msc, and press Enter. Select Inbound Rules > New Rule, choose Port, pick TCP or UDP, type the port number, and select Allow the connection. Then choose the networks and name the rule. Windows 10 uses the same steps. For access from the internet, also forward the port on your router.

Illustration of how to open a port in Windows 11: open Windows Defender Firewall rules, choose the port and protocol, and allow the connection
A drawn overview of the three stages of opening a port in Windows Defender Firewall.

Before you open a port

  • Find out which port and protocol you need. The app or game’s documentation will say, for example TCP 25565 for a Minecraft server or TCP 32400 for Plex. Some apps need both TCP and UDP.
  • Check whether you need to open it at all. Many apps ask Windows for permission the first time they run. If you selected Allow on that prompt, the firewall is already open for that app.
  • Use an administrator account. Standard accounts can’t change firewall rules.
  • Open only what you need. Every open port is a way into your PC. Allow it on Private networks only unless you have a reason not to.

Open a port with Windows Defender Firewall

  1. Press Windows logo key + R, type wf.msc, and press Enter. You can also search Start for Windows Defender Firewall with Advanced Security.
  2. Select Inbound Rules in the left pane.
  3. Select New Rule in the right pane.
  4. Choose Port and select Next.
  5. Choose TCP or UDP. Under Specific local ports, type the port number, such as 25565. You can enter several ports separated by commas, or a range such as 27015-27030. Select Next.
  6. Choose Allow the connection and select Next.
  7. Choose the network types: Domain, Private and Public. For most home uses, select Private only. Select Next.
  8. Give the rule a clear name, such as Minecraft server TCP 25565, and select Finish.

If the app needs both TCP and UDP, repeat these steps and create a second rule for the other protocol.

Is it safe to open ports on Windows 11?

It’s safe when you open only the ports an app needs, limit them to private networks, and close them when you’re done. The risk comes from leaving ports open to the internet for software that isn’t kept up to date.

Open a port with PowerShell

If you’d rather use a command, open Terminal (Admin) by right-clicking Start, then run:

New-NetFirewallRule -DisplayName "Minecraft TCP 25565" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow -Profile Private

Change the name, protocol and port to match your app. To remove the rule later, run Remove-NetFirewallRule -DisplayName "Minecraft TCP 25565".

Open an outbound port

Windows allows all outbound connections by default, so you rarely need an outbound rule. If your workplace or a security app has blocked outbound traffic, follow the same steps but select Outbound Rules in step 2.

How do I open a port in Windows 10?

The steps are the same. Windows 10 users can follow opening a port in the Windows 10 firewall.

Related: How to stop Norton from blocking a program.

Forward the port on your router

The Windows firewall controls traffic that reaches your PC. If people outside your home need to connect, for example friends joining your game server, your router must also send that traffic to your PC. This is called port forwarding. Opening one port is safer than turning the firewall off entirely.

  1. Find your PC’s local IP address: open Settings > Network & internet, select your connection, and look for IPv4 address.
  2. Sign in to your router’s settings page or app. The address and password are usually printed on a label on the router.
  3. Find the section called Port Forwarding, Virtual Server or NAT.
  4. Add a rule with the port number, protocol and your PC’s IP address, then save.

Set a reserved (static) IP address for your PC in the router as well. Otherwise the router may give your PC a new address later and the forwarding rule will stop working.

Check that the port is open

  • See whether an app is listening: in Command Prompt, run netstat -ano | findstr :25565. A line with LISTENING means an app is waiting for connections on that port.
  • Test from another PC on your network: in PowerShell on the other PC, run Test-NetConnection -ComputerName 192.168.1.20 -Port 25565, using your PC’s IP address. TcpTestSucceeded : True means the port is reachable.

A port only shows as open when the app that uses it is running. Opening a port in the firewall doesn’t start anything by itself.

How do I see which ports are open?

Run netstat -ano in Command Prompt to list every listening port and the process ID using it. More ways to look them up are in finding port numbers in Windows.

Close a port again

  1. Open wf.msc and select Inbound Rules.
  2. Find your rule by name. Select Name at the top to sort the list.
  3. Right-click it and select Disable Rule to turn it off temporarily, or Delete to remove it.

Ports that still look closed

The port still looks closed

Check that the app is running and listening on that port, that you chose the right protocol, and that your network is set to the profile your rule uses. If your network is set to Public but the rule is for Private, the rule doesn’t apply. Change the network type in Settings > Network & internet.

It works on my network but not from the internet

The router isn’t forwarding the port, or your internet provider blocks it. Some providers use carrier-grade NAT, which prevents incoming connections entirely. Check your router’s WAN address against what an IP lookup site shows. If they differ, contact your provider.

Another security app blocks the connection

Third-party antivirus suites such as Norton or McAfee can replace Windows Defender Firewall. Add the port rule in that app’s firewall settings instead.

New Rule is grayed out

You’re not signed in as an administrator, or your organization manages the firewall. Sign in with an admin account or contact your IT team.

Related guides