Windows Server comes with a powerful built-in firewall: Windows Firewall with Advanced Security. It is enabled by default and essential for protecting your VPS against unauthorized access.
1. Accessing the Firewall GUI
You can access the firewall settings through the graphical interface in three different ways. Choose the one you find easiest.
Method 1: Run Command (Fastest)
Press Win + R on your keyboard, type wf.msc and press Enter.
Method 2: Server Manager
Open Server Manager, go to Tools in the top-right corner, and select Windows Firewall with Advanced Security.
Method 3: Start Menu Search
Open the Start menu and type "firewall with". Click on the result to open the console.
2. Managing Firewall via Command Line
You can quickly enable or disable the firewall profiles using PowerShell or the Command Prompt.
Option A: PowerShell (Recommended)
Run PowerShell as Administrator.
To Enable Firewall:
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True
To Disable Firewall:
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
Option B: Command Prompt (netsh)
Run CMD as Administrator.
To Enable Firewall:
netsh advfirewall set allprofiles state on
To Disable Firewall:
netsh advfirewall set allprofiles state off