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.
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.
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.
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).
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.
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.
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.
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.
- 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 is127.0.0.1, the service is only accessible from the server itself. Change it to0.0.0.0in the service’s configuration. - 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.
- 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.
- 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.
- Check DDoS protection: If the port is still unreachable, check the learned rules in the DDoS protection tab, as described in the next section.
See our Well-known Ports & Firewall Commands overview to find out which standard port each service uses.
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:
- Open the DDoS protection tab for your VPS and check Learned rules to see which service is listed for your port.
- 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.
- 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.
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.
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.
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.
