Skip to content

VPS: Open Ports in Windows Defender Firewall

Open ports on your Windows VPS: create rules in the Windows Defender Firewall, check the network firewall and DDoS protection, and find out why a port is blocked.

29 November 20268 min read65 Views0 helpful

Introduction

Windows OS includes its own Windows Defender Firewall, which manages incoming and outgoing traffic between your server and the internet. In this guide, we’ll show you how to manage firewall rules and open ports. If a port is still unreachable despite having a rule, the step-by-step checks below can help. They also cover the network firewall and DDoS protection in the ZapX dashboard.

Info: Windows Defender Firewall vs. ZapX Network Firewall

The Windows Defender Firewall runs directly on your server (at the operating system level) and is separate from the Network firewall in your ZapX dashboard (the Network firewall tab for your VPS), which works upstream at the network level. If a port is still unreachable from outside despite having the right Windows Firewall rule, also check the rules and default policies in the Network firewall tab.

Accessing the Windows Defender Firewall

Windows OS includes Windows Defender Firewall with Advanced Security as a core system application, allowing you to manage firewall rules easily in one place.

You can access it by searching for it in the Windows search bar or by pressing the Windows key/icon and using the search in the Start menu.

Managing rules

Most applications and processes, especially those that need to be accessible over the internet, such as game servers or web servers, require port forwarding so clients can communicate with your server (the host).

Info

By default, Windows only opens the firewall for applications that need it and keeps all other ports closed. This prevents unnecessary open ports and reduces risk. That’s why, for example, you’ll often see a UAC prompt the first time you launch a game, asking you to confirm a new firewall rule.

In Windows, you can manage rules in two simple ways: create rules for programs, or create rules that cover entire ports (and therefore all programs or processes that use those ports).

There are two types of rules:

  • Inbound rule: Controls incoming communication (from the internet to your server).
  • Outbound rule: Controls outgoing communication (from your server to the internet).

For a service that others need to access, an inbound rule is usually enough: Windows allows outgoing traffic by default, and the firewall automatically allows responses to permitted incoming connections. You only need an outbound rule if you have restricted outgoing traffic yourself.

Program rules

Creating a program rule is usually the recommended choice because it limits communication to a specific program or process, rather than opening an entire port that any application could then use to communicate.

In the example below, you’ll set up an inbound program rule. If needed, you can create an outbound rule using the same steps.

Start by right-clicking Inbound Rules in the sidebar and selecting New Rule....

In the first step, select Program as the rule type.

Now select the program you want to create the forwarding rule for by clicking the Browse button. In this example, the Mozilla Firefox browser is used as the sample application.

In the Action section, select Allow the connection.

In the Profile section, leave all options checked and continue to the final step. Choose a descriptive name so you can recognize the rule later. You can also add a description if you want.

When everything looks right, click Finish to create the rule.

You’ve successfully created a program rule for your Windows server. If you have restricted outgoing traffic, use the same steps to create an additional outbound rule under Outbound Rules.

Port rules

Creating a general port rule can also be useful for many use cases and follows similar steps to the ones above.

In the example below, you’ll set up an inbound port rule. If needed, you can create an outbound rule using the same steps.

Start by right-clicking Inbound Rules in the sidebar and selecting New Rule....

In the first step, select Port as the rule type.

Now specify the port type (TCP or UDP) and the port number(s) you want to forward. If you want to forward both TCP and UDP, you’ll need to create two separate rules, one for each port type.

In this example, port 25565 (TCP) is used as the sample port, which is used by default for Minecraft.

In the Action section, select Allow the connection.

In the Profile section, leave all options checked and continue to the final step. Choose a descriptive name so you can recognize the rule later. You can also add a description if you want.

When everything looks right, click Finish to create the rule.

You’ve successfully created a port rule for your Windows server. If you have restricted outgoing traffic, use the same steps to create an additional outbound rule under Outbound Rules.

Port unreachable: step-by-step checks

There are several points between the internet and your service where connections can be blocked. A port is only reachable if traffic is allowed through each one. Follow the steps in order and replace 25565 with your port.

  1. Check the service: Open PowerShell and run Get-NetTCPConnection -LocalPort 25565 -State Listen, or for UDP services, Get-NetUDPEndpoint -LocalPort 25565. If there’s no output, the service isn’t running or is using a different port. If the local address is 127.0.0.1, the service is only accessible from the server itself. Change it to 0.0.0.0 in the service’s configuration.
  2. Check the Windows Defender Firewall: Under Inbound Rules, check whether there’s an active rule with the Allow the connection action for the program or port. Make sure you’re using the right protocol: many games use UDP, while web and database services use TCP. You need a separate rule for each of TCP and UDP.
  3. Check the network firewall in the ZapX dashboard: Open your VPS and go to the Network firewall tab. If Default Inbound is set to DROP or REJECT, or one of your rules blocks the port, add a rule there with the ACCEPT action for the port and protocol.
  4. Test from outside: Check the port with our Port Checker. For TCP, the result is conclusive. An open UDP port often doesn’t respond to the test request, so only a “closed” result is conclusive. It’s best to test UDP services directly with the game or program.
  5. Check DDoS protection: If the port is still unreachable, check the learned rules in the DDoS protection tab, as described in the next section.
Tip

See our Well-known Ports & Firewall Commands overview to find out which standard port each service uses.

DDoS protection and custom ports

At our locations in Germany and the USA, PletX DDoS protection filters incoming traffic before it reaches your VPS. The filter automatically detects the protocol for each port as soon as actual traffic arrives and creates a rule for it, for example, RDP on TCP 3389. Traffic that doesn’t match this rule is filtered. If a service is running on a custom port the filter doesn’t recognize, or the filter has identified the wrong service, follow these steps:

  1. Open the DDoS protection tab for your VPS and check Learned rules to see which service is listed for your port.
  2. If the rule is missing or the service is incorrect, click Request rule. Enter the Port, Protocol, and the Service on this port, and briefly describe what isn’t working with the filter enabled. Your request creates a ticket, and we’ll let you know when the rule is active.
  3. If your VPS has a dedicated IP address, you can temporarily disable protection for testing by clicking Disable protection. If the port works then, the filter is causing the issue. Turn protection back on afterward.
Warning

While protection is disabled, your VPS isn’t protected against DDoS attacks, and your bandwidth is limited to the port speed included in your plan. After an attack is detected, protection must remain enabled until the date shown in the tab.

For more information, see the guide to PletX DDoS protection. The OVH DDoS protection applies at the London, Montreal, Singapore, and Sydney locations instead.

Email servers: ports 25 and 465

On newly ordered VPSs, outgoing connections on ports 25 and 465 are blocked until you verify a phone number in your account. While the block is active, your VPS displays the message Email sending blocked. Click Verify phone number there and confirm your number. The block will then be automatically lifted for all VPSs in your account. Set the reverse DNS record for your mail server in the Settings tab under Reverse DNS.

Port 587 isn’t blocked, so an external SMTP relay service will work without approval. The troubleshooting section of the Linux guide explains what to do if your IP address is on a blacklist. The same advice applies to Windows.

Troubleshooting

I can no longer connect to the server via RDP

Open the Console tab for your VPS in the ZapX dashboard and sign in there. In the Windows Defender Firewall, check that the inbound rules for Remote Desktop are enabled. If you changed the RDP port, the rule must allow the new port; see Change the RDP port. If you added a rule in the Network firewall tab that blocks RDP, remove it there.

I created the rule, but the port is still closed

Check whether the rule applies to all profiles (Domain, Private, Public) and whether there’s a rule with the Block the connection action for the same port. In Windows, block rules take precedence over allow rules. Then continue with the checks above, starting at step 3.

I can’t disable DDoS protection

You can only disable it if you have a dedicated IP address. Also, after an attack is detected, protection must remain enabled for a while; the date is shown in the DDoS protection tab.

Conclusion

You now know how to open ports for programs and services in the Windows Defender Firewall, and how to work out step by step why a port is unreachable. If you have any questions or run into problems, our support team is here to help every day! 🙂

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

Open Windows Defender Firewall with Advanced Security, right-click Inbound Rules, and select New Rule. Choose Port as the rule type, enter the protocol and port number, then allow the connection. Create a separate rule for TCP and UDP.
Usually not. Windows allows outgoing traffic by default and automatically allows responses to permitted incoming connections. You only need an outbound rule if you have restricted outgoing traffic yourself.
The Windows Defender Firewall runs on your server. The Network firewall in the ZapX dashboard’s Network firewall tab works upstream at the network level. A port is only reachable if both allow it.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.