Windows OS includes its own Windows Defender Firewall that controls incoming and outgoing traffic between your server and the internet. This guide shows you how to manage firewall rules and provides general tips for port forwarding.
Windows OS features the 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 reachable over the internet like 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 you often see UAC prompts the first time you start a game, to confirm a new firewall rule.
In Windows, you can manage rules in two simple ways: either create rules for programs or create rules that cover entire ports (thus allowing all programs or processes using 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).
Usually, when forwarding ports, you need to create both types of rules to allow communication with clients. However, this depends on your specific setup.
Creating a program rule is usually the recommended choice because it restricts communication to a specific program or process—in contrast to a port rule, which allows any application to communicate on that port.
You will now create two program rules: one outbound and one inbound, both allowing connections.
The example below sets up only the inbound rule. The steps are the same, so you should repeat them for the outbound rule.
Right-click on Inbound Rules in the sidebar and select New Rule....
Select the rule type Program in the first step.
Now select the program for which you want to create the forwarding rule using the Browse button. In the example, the Mozilla Firefox browser was chosen as the example app.
In the action section, select Allow the connection.
In the profile section, leave all options checked and proceed to the last step. Here you should give the rule a meaningful name so you can recognize it later. Optionally, you can add a description.
If everything is correct, click Finish to create the rule.
You have successfully created your own program rule for your Windows server. Now repeat the steps to create an outbound rule under Outbound Rules.
Creating a general port rule can also be useful for many use cases and follows similar steps as before.
You will now create two port rules: one outbound and one inbound, both allowing connections.
The example below sets up only the inbound rule. The steps are the same, so you should repeat them for the outbound rule.
Right-click on Inbound Rules in the sidebar and select New Rule....
Select the rule type Port in the first step.
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 the example, port 25565 (TCP) was 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 last step. Here you should give the rule a meaningful name so you can recognize it later. Optionally, you can add a description.
If everything is correct, click Finish to create the rule.
You have successfully created your own port rule for your Windows server. Now repeat the steps to create an outbound rule under Outbound Rules.