How to Open a Port on Windows VPS?

Open ports on Windows 10 and Windows Server using Windows Firewall or PowerShell. Allow TCP and UDP connections and verify firewall rules.
8 min read
Intermediate
Open Port on Windows VPS

Opening a port on a Windows VPS can be done in several ways, depending on your preference. You can use the Windows GUI through Windows Defender Firewall or run PowerShell commands to manage firewall rules and allow traffic through your desired port.

To open a port, you need to create a new inbound or outbound rule in Windows Defender Firewall, specify the port number and protocol (TCP or UDP), and set the action to Allow the connection. This allows the firewall to permit traffic through the specified port for your application or service.

In this guide, you’ll learn how to allow incoming connections to your Windows VPS by opening a port using both Windows Defender Firewall and PowerShell. We’ll also cover how to check open ports and troubleshoot common issues you may encounter during the process.

Note:

All steps and solutions in this guide have been tested and verified by the VPSMakers technical team on Windows 10 Desktop and Windows Server 2019 running on VPS Server. However, the port-opening process is largely the same across Windows client and server editions, with only minor differences between versions.

Before Opening a Port on Windows VPS

Before opening a port on your Windows VPS, make sure you are logging in with administrator access to Windows and know which port number and protocol (TCP or UDP) your application or service requires.

You also need to identify whether you need to allow incoming or outgoing connections. Inbound rules control connections coming into the VPS, while outbound rules manage connections initiated from your server.

Keep in mind that if you open a port on your Windows VPS but the port is still unavailable, Windows Defender Firewall only allows traffic through Windows Firewall. If your VPS provider or network has additional firewall restrictions, you may also need to request to allow the port there.

Open a Port Using Windows Defender Firewall

Windows Defender Firewall with Advanced Security allows you to control incoming and outgoing network traffic by creating firewall rules. To open your desired port on Windows, you should create new rules, specify protocol and port numbers, and adjust connection permissions.

Open Windows Defender With Advanced Security

First, after logging in to your Windows VPS, search for Windows Defender with Advanced Security in the Start menu or press Win + R to open the Run dialog, type wf.msc and press Enter to open it.

open windows defender advanced security with run

Create New Inbound Rule on Windows Firewall

After opening the advanced firewall settings, you need to create a new rule to allow incoming or outgoing connections through your desired port.

On the left sidebar, click on Inbound Rules, and then on the right sidebar, click on New to open the Inbound Rule Creation Wizard.

add new inbound rule in windows defender

Note:

To open an outbound port, select Outbound Rules instead of Inbound Rules in the first step, then create a new rule. The rest of the process is the same.

Select Rule Type

On the wizard’s first page, select the type of rule you want to create. Windows Firewall provides four different options, each of which lets you control different traffic based on different criteria. Here, we want to open a port, so select Port and click Next.

select port as rule type in windows defender firewall

The other options, including Program, Predefined, and Custom, are useful for more specific firewall rules. Choose Program to allow access for a particular application, Predefined to apply a rule for a predefined protocol or service, or Custom to have more control over settings such as source and destination IP addresses, ports, and protocols.

Specify Port Number and Protocol

In this step, you can select TCP or UDP depending on the type of traffic you want to open, or if you want to open a port for both protocols, you will need to create separate rules for each protocol.

Select Protocol and Port in Windows firewall

Specify the Firewall Rule Action in Windows

On the action page, you should specify what this rule does with incoming connections for this port; to allow connections, select “Allow the connection“.

Specify the Firewall Rule Action in Windows VPS to allow

If you are in a domain environment and using IPsec policies to authenticate your connections, you can select “Allow connections if Secure“. For a normal Windows VPS or home Windows, you generally don’t need this option.

Specify Network Profile to apply rule to

In this page you need to select the network profiles to apply the rule too, its better to keep all checked if you don’t want to change anything however you can uncheck the ones you don’t need.

  • Domain: applies the firewall rule when your VPS is domain-joined and managed by an organization
  • Private: applies the rule when connected to a trusted private network.
  • Public: Applies the rule when connected to an untrusted public network such as Wi-Fi in an airport.

On a VPS, it’s better to keep all checked and click Next to Continue.

Specify Network Profile to apply rule to

Specify a name and description for the firewall rule

In this step, you will need to specify a name and a description for your firewall rule; make sure you write a name and description that, when you later want to disable or remove this rule, you recognize the rule. After setting the name and description, click Finish to create the rule.

Specify Name and Description for Rule

Open a Port Using PowerShell

You can also use PowerShell to open a port on Windows. This can be used when you prefer to manage your Windows server via the command line or in automation tasks. To open a port using PowerShell, you need to create a new rule using New-NetFirewallRule

First, open PowerShell as an administrator. Search for PowerShell in the Start menu, right-click, and select Run as administrator. Then, depending on your connection, use the command below by replacing your values with examples.

Use the following table as a reference when replacing the values in the commands below.

ParameterExample valueDescription
-DisplayName“Allow TCP Port 8080”Sets a recognizable name for the firewall rule.
-DirectionInbound / OutboundSpecifies whether the rule controls incoming or outgoing traffic.
-ProtocolTCP / UDPDefines the network protocol used by the application.
-LocalPort8080Specifies the local port on your Windows VPS that accepts incoming connections.
-RemotePort8080Specifies the destination port for outgoing connections.
-RemoteAddress192.168.1.100Restricts the rule to connections from a specific remote IP address.
-LocalAddress192.168.1.10Specifies the local IP address to which the rule applies.
-ActionAllow / BlockDetermines whether matching traffic is allowed or blocked.
-ProfileAny / Domain / Private / PublicSpecifies the network profiles where the rule applies.

Allow an Incoming Connection to a Port

These commands allow an inbound (incoming) connection to your Windows machine; choose either TCP or UDP and run the command, or, if you want to open both, run both.

Allow an Incoming TCP Connection to a Port

This command allows connections through the port 8080 with tcp protocol.

New-NetFirewallRule -DisplayName "Allow TCP Port 8080" -Direction Inbound -Protocol TCP -LocalPort 8080 -Action Allow

Allow an Incoming UPD Connection to a Port

This command allows connections through the port 8080 with udp protocol.

New-NetFirewallRule -DisplayName "Allow UDP Port 8080" -Direction Inbound -Protocol UDP -LocalPort 8080 -Action Allow

Allow an Outgoing Connection to a Port

If you also need to allow outgoing connections through a specific port, run the commands below depending on your required protocol.

Allow outgoing TCP Connection to a port

New-NetFirewallRule -DisplayName "Allow Outbound TCP Port 8080" -Direction Outbound -Protocol TCP -RemotePort 8080 -Action Allow

Allow outgoing UDP Connection to Port

New-NetFirewallRule -DisplayName "Allow UDP Port 8080" -Direction Inbound -Protocol UDP -LocalPort 8080 -Action Allow -Profile Any

Allow Connections From a Specific IP Address

You can also restrict access to a particular remote IP address by specifying the IP address in the command using the -RemoteAddress option in the command; in the example below, replace 192.168.1.100 with your desired IP.

New-NetFirewallRule -DisplayName "Allow TCP Port 8080 from Specific IP" -Direction Inbound -Protocol TCP -LocalPort 8080 -RemoteAddress 192.168.1.100 -Action Allow

Verify the Firewall Rule

After creating the rules to allow connections, you can check whether it was added successfully using the Get-NetFirewallRule command:

Get-NetFirewallRule

The command above shows all firewall rules. To search for your desired firewall rule, use the command below by replacing your port instead of 8080:

Search for rules using a specific local port:

Get-NetFirewallPortFilter -LocalPort 8080 | Get-NetFirewallRule

Search for rules using a specific remote port:

Get-NetFirewallPortFilter -RemotePort 8080 | Get-NetFirewallRule

How to Close an Open Port on Windows VPS

After opening a port on a Windows VPS server, to block it or close the port, you should remove or disable the rules you’ve created for the port, or if you want to fully block this port, you can follow our dedicated guide for this action:

How to block ports in Windows server firewall?
READ How to block ports in Windows server firewall?

Instead of blocking a port, you can forward incoming connections to another port. This is useful when you want to prevent direct access to a service on its original port while keeping the service accessible through a different port. To learn how, follow this guide:

Port forwarding on Windows involves two steps: creating a new firewall rule for the port and configuring port forwarding using CMD.

Read the full article

Summary

Opening a port on Windows allows incoming or outgoing network traffic through Windows Defender Firewall, making your applications and services accessible over the required ports. You can create firewall rules using either the Windows graphical interface or PowerShell, depending on your preference.

In this guide, we covered how to create inbound and outbound rules, specify TCP or UDP protocols, restrict connections to specific IP addresses, and verify existing firewall rules. Choosing the method depends on you and your requirements, but the GUI version for beginners can be a lot easier.

If a port is still inaccessible after creating the rule, check whether another firewall or your VPS provider’s network restrictions are blocking the connection.

Share:

Was this article helpful?

Your feedback helps us improve our technical guides.

Related Posts

You May Also Like

Explore more tutorials, guides, or documentation, from VPSMakers.

Open ports on Windows 10 and Windows Server using Windows Firewall or PowerShell. Allow TCP and UDP connections and verify firewall rules.
Robert Smith
November 19, 2026
Block ports in Windows using Firewall or PowerShell by creating inbound or outbound rules for specific ports and protocols.
Robert Smith
November 17, 2026
Blocking a port on MikroTik involves creating a new filter rule, specifying the protocol and port, and setting the action to drop.
Jacob Rafet
November 16, 2026
Change the default SSH port on Linux by editing the SSH configuration and updating firewall and SELinux rules on Debian and RHEL systems.
Richard Mourar
November 15, 2026