Windows OS comes with its own Windows Defender Firewall, which controls 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 guide Open Ports, Configure Firewall and DDoS Protection can help. It also covers DDoS protection in the ZapX dashboard.
Windows OS includes Windows Defender Firewall with Advanced Security as a core system application, allowing you to easily manage firewall rules in one place.
You can access it by searching for it in the Windows search bar or by pressing the Windows key and searching 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 port exposure and reduces risks. That's why, for example, you often see UAC prompts to confirm a new firewall rule the first time you start a game.
In Windows, there are two easy ways to manage rules: you can create rules for programs, or you can create rules that cover entire ports (and therefore all programs or processes that use that port).
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 sufficient: 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—in contrast to a port rule, which allows any application using that port 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.
Right-click Inbound Rules in the sidebar and select New Rule....
In the first step, select the Program rule type.
Now select the program for which you want to create the forwarding rule by clicking the Browse button. In this example, the Mozilla Firefox browser is used as the example application.
In the Action section, select Allow the connection.
In the Profile section, leave all options checked and proceed to the final step. Give the rule a descriptive name so you can recognize it later. You can also add a description if you like.
When everything looks good, click Finish to create the rule.
You've successfully created a program rule for your Windows server. If you've restricted outgoing traffic, follow the same steps under Outbound Rules to create an outbound rule as well.
Creating a general port rule can also be useful for many use cases and follows similar steps to those 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.
Right-click Inbound Rules in the sidebar and select New Rule....
In the first step, select the Port 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 need to create two separate rules, one for each port type.
In this example, port 25565 (TCP) is used, the default port for Minecraft.
In the Action section, select Allow the connection.
In the Profile section, leave all options checked and proceed to the final step. Give the rule a descriptive name so you can recognize it later. You can also add a description if you like.
When everything looks good, click Finish to create the rule.
You've successfully created a port rule for your Windows server. If you've restricted outgoing traffic, follow the same steps under Outbound Rules to create an outbound rule as well.
