Search The Hostwinds Guides Knowledge Base

How To Open Or Block Ports Using Windows Firewall

Share This Article

By default, Hostwinds does not block any ports on your VPS.  However, this article will discuss the Windows built in Firewall, along with how to open and close ports. This article is intended for Hostwinds clients who need to open or block a port to their Windows VPS and we will go over how to to this using this simple to follow guide with step by step instructions.

What Is Windows Firewall?

Windows Firewall is a built in system that is designed to filter incoming and outbound traffic.  Traffic coming in and out of your Windows server has ports, designed to provide direction past the location of where the IP points to (ie www.example.com:8080 in the URL will direct the site to port 8080).  As an example, you may notice Administrator pop-ups when a program needs access, requiring you to confirm or deny the request.  In this event, the Windows Firewall is not recognizing the IP trying to connect, or the IP you are trying to connect to.  By design, Windows Firewall is doing its job by ensuring you are aware of the connection prior to the connection being made and avoiding potentiality harmful software packages.

Typically Windows Firewall only applies to outside connections and unknown connections.  Therefore, unless manually blocked, connection locally are not filtered.  This means connections to devices like your printer, are not blocked.

How To Open Firewall Ports In Windows

Steps are outlined using Windows 10 (Windows 2016 Server), however, steps for other Windows version should be similar in nature.

Step 1:  Open your Control Panel by searching for it in your Windows Search bar.

Windows Control Panel Location Image

Step 2:  Select System Security from the available options

Step 3:  Select Windows Defender Firewall

Windows Firewall Location Image

Step 4:  Find and select Advanced Settings on the left-hand-side

Windows Firewall Advanced Settings Location Image

Step 5:  The advanced settings should open now.  You will have two different rules you can edit:

  • Inbound Rules:  These rules regulate what comes into your computer
  • Outbound Rules:  These rules regulate what goes out of your computer

Right-hand click on either Inbound Rules or Outbound Rules to create a New Rule

Firewall Add New Rule Image

Typically, it is suggested to create the same rule for the opposite Inbound or Outbound option for simplicity and security

Step 6:  For this guide illustrating how to open and block ports, select the Port option to add a rule for an incoming or outgoing port.

Firewall Port Selection Image

Step 7:  Choose the type of connection to apply, either TCP or UDP.  It’s  worth noting that the majority of ports will use TCP unless otherwise specified.  Add the port manually in the text box and click “Next” when you have specified this to fit your needs.

Manual Firewall TCP connection example Image

Step 8:  Now select whether or not the connection is to allow the connection or to block the connection.

Firewall Allow Connection or Block Image

Step 9:  Select the rules this applies to and that you find necessary.  You can select all the boxes, but generally you will want to ensure “public” is checked.

Firewall Private or Public Connection

Step 10:  Some Windows Firewalls will allow you to name the rule and provide a description, which will be the last step.

Firewall Name description Image

Your port should now be open immediately after configuration and selecting Finish.

How To Block A Currently Allowed Port

Step 1:  Find the port or rule you want to block and right-click.  Select Properties from the available options.

change port right click properties

Step 2:  Select the General tab and choose “Block the Connection”.  Click Apply when done

Block Connection Location Image

Your Port or Rule should now be blocked, and a red circle (or the equivalent) appear within your Firewall Rules

test port blocked

How To Disable Or Delete Firewall Rule

You can disable or delete firewall rules within your Windows Firewall as well by following these steps.

Step 1:  Open your Control Panel by searching for it in your Windows Search bar.

Windows Control Panel Location Image

Step 2:  Select System Security from the available options

Step 3:  Select Windows Defender Firewall

Windows Firewall Location Image

Step 4:  Find and select Advanced Settings on the left-hand-side

Windows Firewall Advanced Settings Location Image

Step 5:  Select Inbound Rules or Outbound Rules in regards to which firewall you wish to disable or delete.  For this guide and to demonstrate this in an example, we selected Inbound Rules. You can choose the rules based on your specific needs and depending on what you would like to accomplish.

outbound rules windows firewall

Step 6:  Find the rule you wish disable or delete by right-clicking, and select which you want to do.

disable firewall rule delete

Disabling will remove the green check mark next to the rule you disabled.  Right-clicking and selecting Enable Rule will enable it back.

We do not recommend deleting a firewall rule, unless you are confident in what you are doing.  Deleting a firewall rule will permanently delete the rule.

Helpful Related Articles