๐ก๏ธHow to configure Windows Firewall
Windows Firewall is your server's first line of defense. It controls which traffic can reach your VPS. By default, most ports are blocked. You need to open the ones your services use.
The firewall is already running on your Windows VPS. You just need to configure it.
Opening Windows Firewall
Click the Start button
Type Windows Defender Firewall
Click the result to open it
You see a simple status screen showing whether the firewall is on. For the full configuration, click Advanced settings on the left.
Understanding the interface
In the Advanced Security window, you see three sections on the left:
Inbound Rules - controls traffic coming into your server
Outbound Rules - controls traffic leaving your server
Connection Security Rules - advanced authentication rules (rarely needed)
Inbound rules are the ones you will use most often.
Opening a port (inbound rule)
Click Inbound Rules
Click New Rule... on the right
Select Port and click Next
Choose TCP (or UDP, depending on the service)
Enter the port number (e.g.,
25565for Minecraft)Select Allow the connection
Check the profiles (Domain, Private, Public - usually keep all three)
Give the rule a name like
Minecraft Port 25565Click Finish
The rule appears in the list. Traffic on that port is now allowed.
Opening a port range
Some applications use multiple ports. Follow the same steps but enter a range in the port field:
This opens ports 30000 through 30010.
Allowing a program instead of a port
Sometimes it is easier to allow a program rather than specific ports:
Click New Rule...
Select Program and click Next
Browse to the program's executable file (e.g.,
C:\MyServer\server.exe)Select Allow the connection
Complete the wizard
The firewall will let that program communicate on any port it needs.
Blocking an IP address
If you see repeated failed login attempts from a specific IP, block it:
Click Inbound Rules
Click New Rule...
Select Custom and click Next
Keep All programs selected, click Next
Keep Any protocol, click Next
Under Remote IP address, select These IP addresses and click Add
Enter the IP you want to block
Select Block the connection
Name the rule
Block malicious IP
Enabling or disabling a rule
Find the rule in the list. Right-click it and select:
Enable Rule - turns the rule on
Disable Rule - turns the rule off without deleting it
Viewing the firewall log
If you are troubleshooting, check what the firewall has blocked:
In Windows Firewall, click Properties (top of the window)
Go to the Domain Profile, Private Profile, or Public Profile tab
Next to Logging, click Customize
Set Log dropped packets to Yes
Click OK
Now check C:\Windows\System32\LogFiles\Firewall\pfirewall.log for blocked connection attempts.
Quick commands in PowerShell
Open a port:
Remove a rule:
List all rules:
Export your firewall policy:
Import a firewall policy:
Common mistakes
Opening too many ports Only open what you need. Each open port is a potential entry point. Close ports when you stop using the service.
Forgetting UDP Some applications (game servers, voice chat) use UDP. Make sure you open both TCP and UDP when needed.
Not testing from outside After opening a port, test it from a different network. Use a website like portchecker.co or a tool like Test-NetConnection in PowerShell:
Windows Firewall vs third-party firewalls
Windows Firewall is good enough for most VPS setups. It is free, built-in, and integrates with Windows. If you need advanced features like intrusion detection or application-level filtering, consider a third-party solution, but for basic port management, the built-in firewall works well.
Quick reference: common ports
80
TCP
HTTP (web)
443
TCP
HTTPS (secure web)
3389
TCP
Remote Desktop (RDP)
3306
TCP
MySQL
25565
TCP
Minecraft
30120
TCP+UDP
FiveM
27015
TCP+UDP
CS2 / Source games
Conclusion
Windows Firewall is simple once you know where to look. Add rules for the ports you need, block everything else, and your server stays secure.
Last updated