How to open port on Windows VPS?

Opening a port in Windows VPS can have various reasons, including hosting online games, sharing a specific program, accessing some networks or services that must be used from a specific port, and sharing Specific protocols.
For all these services, opening the Windows VPS port is considered vital and necessary.
First, we will teach you how to open the port step by step with several methods along with the image

How do I add a port number to my Firewall?

If you are using Windows Firewall to open the Windows VPS port, you need to open the Port Number you selected in that firewall. Then the firewall accepts the connection to the port you want.

Note: The firewall can control ingress and egress and only allow inbound ports that you approve.

Different operating systems use different firewalls to manage ports. This is done by the built-in Windows firewall in the case of Windows VPS.

We have 3 ways to do this in the Windows VPS firewall:

    1. Windows Firewall GUI (Graphical User Interface)
    2. CMD (Command Line)
    3. Windows PowerShell

How to open port with firewall GUI?

Step 1 – First, execute the run with “Windows key + R” keys, type wf.msc and press OK.


Step 2 – Now choose “Inbound Rules” and then click on the “New Rule…

Add New Rule

Step 3 – Select “port” and then click on “Next“.

Rule Type

Step 4 – Write the “Port Number” that you want to be opened and click “Next“.

Protocol and Ports

Step 5 – Choose to “Allow the connection” and then click “Next“.

Set Action

Step 6 – Choose an available situation and then click “Next“.

Set Profile

Step 7 – Write a custom “name” for the number you want to open and then click “Next“.

Set the name of the port

Step 8 – Reboot the server to apply the changes.

How to open port with firewall CMD?

Step 1- This time, use the Windows key R and type CMD and press OK.

Open CMD

Step 2- Type this code.

netsh advfirewall firewall add rule name="Port 20875" dir=in action=allow protocol=TCP localport=20875

Typing Command

Note: The name section is your custom name, and the local port section, is the number of the port you want to open.

Step 3- Reboot the server to apply the settings changes.

How to open port with firewall Powershell?

Step 1: execute the run using the (Windows key + R), type PowerShell, and then press OK.

Run Powershell of Windows

Step 2- you should type this command on Powershell :

New-NetFirewallRule -DisplayName "Port 6985" -Direction inbound -LocalPort 6985 -Protocol TCP -Action Allow

Write the command

Step 3- Reboot your server to apply changes.

Note: In the “DisplayName” field, you must write the name of the port you want, and in the “LocalPort” field, you must write the number of the port you want to open.


Finally, according to the above methods, you can open the new port. Configure the firewall to control ingress. Be sure to make the settings and changes in such a way that it has the necessary security when using the VPS remotely. Port security includes (opening necessary ports, updating software, monitoring and management, using encrypted protocols, recording events, and finally using a firewall).
After opening a new port, you need an IP address to host. If you want to find the IP address of your server, use this article: How to find VPS IP Address in Windows Server?
We hope this article is useful for you.

author image

The Author Robert Smite

Hello! I'm Robert, specializing in virtual servers and cloud technology. With expertise in managing and optimizing virtual servers, my focus is on delivering understandable and practical content in this field. My goal is to enhance knowledge and assist individuals in selecting the best virtual services for their needs.

More from Robert Smite

Post Your Comment

Your email address will not be published. Required fields are marked *