How To Open and Change Firewall Ports In Windows Server 2019

Posted on by Matthew Hurst | Updated:
Reading Time: 6 minutes

Managing your network traffic is essential in securing any device that handles your workloads. One of the primary tools in doing so is a firewall. The Windows operating system (OS) comes prepackaged with the Windows Defender Firewall to assist with this task.

A firewall is an application that will monitor network traffic on an interface, compare it with a set of rules, and decide if that traffic is allowed or not. When you initially set up your server or add any new applications requiring Internet access, configuring your firewall is necessary to allow incoming traffic.

Whether you are configuring your cloud firewall, a hardware firewall, or the one included in the OS, securing network traffic is essential. This article will cover how to open a port in your Windows firewall, close a port, and allow traffic for specific programs.

Requirements

These are the requirements for opening a port or allowing access to applications you configure:

  • The port number or application you want to open on your Windows firewall.
  • The protocol the application will use - connectionless (UDP) or connection-oriented (TCP).
  • The physical path to the application’s executable (if you will be creating a program-based rule).

Typically, your software vendor will provide this information to you if you do not have it. To assist, here is a brief list of common protocols and their associated port numbers.

  • File Transfer Protocol (FTP) Data Transfer - 20
  • File Transfer Protocol (FTP) Command Control - 21
  • Telnet - 23
  • Simple Mail Transfer Protocol (SMTP) - 25
  • Domain Name System (DNS) - 53
  • Hypertext Transfer Protocol (HTTP) - 80
  • Post Office Protocol (POP) - 110
  • Internet Message Access Protocol (IMAP) - 143
  • Remote Desktop Protocol (RDP) - 3389
  • Hypertext Transfer Protocol  Secure (HTTPS) - 443
  • Microsoft SQL (MSSQL) - 1433

Additionally, follow best practices for firewall rules to maintain optimal data security.

Open and Change Firewall Ports In Windows Server 2019

How to Access and Check the Windows Server Firewall Settings

Step 1: Access the Windows Firewall Management Console

You can view various settings from the management console, such as the Overview of the Domain Profile and multiple wizards to execute tasks within the Windows Firewall.

1. Log into your server via Remote Desktop.

2. Click the Search icon on the bottom-left of the taskbar and type firewall.

3. Click on Windows Defender Firewall with Advanced Security. This action opens the Windows Firewall Management Console.

Step 2: View and Configure Inbound Rules in the Console

1. From the left-hand navigation, click Inbound Rules to expose the Inbound Rules pane on the right.

2. Click the Enabled column at the top to sort your rules by status until the value of Yes is at the top. Make a note of the preconfigured rules.

Note:
The rules created by Liquid Web allow access to your server. Disabling or editing these rules could cause network disruptions or prevent support from assisting you.

Open a Port in Windows Server Firewall

1. Open the firewall manager again.

2. Click Inbound Rules from the left pane to reveal the Inbound Rules pane on the right.

3. Click New Rule in the right-hand pane to open the New Inbound Rule Wizard.

4. In the New Inbound Rule Wizard, under the Rule Type section, select the Port radio button and click Next.

5. In the Protocol and Ports section, select TCP or UDP. Next, select the radio button for All local ports or Specific local ports. For this tutorial, choose Specific local ports and enter the corresponding port number. If listing multiple ports, split them with a comma. Once completed, click Next.

6. In the Action section, select Allow the connection (or choose the setting for your requirements) and click Next.

7. In the Profile section, select all appropriate profiles for when this rule applies and click Next.

8. Finally, give your new rule a descriptive name so that it is easy to find later, and click Finish.

You should now be able to see your new rule created in the Inbound Rules pane and establish connections to your server with the configured port if a program or service is listening on that port.

Close a Port in Windows Server Firewall

If you need to close a previously opened port, find and disable the rule that opens the port using these steps.

1. Open the firewall manager.

2. Click Inbound Rules from the left pane to reveal the Inbound Rules pane on the right.

3. Click the Enabled column at the top to sort your rules by status until the value of Yes is at the top. 

4. Locate the rule for the local port you would like to close.

5. Right-click on the rule and select Disable.

The Inbound Rule is disabled, and access to the port is restricted.

Open a Port for a Specific Program in Windows Server Firewall

Some applications use more than one port or more than one protocol when communicating over the Internet. You can create a Program Rule Type in Windows Defender Firewall to simplify allowing traffic for these programs. These rules also add additional security, as the ports a program typically listens on are not open unless the defined program is running.

Here are the steps to open a port for a specific program.

1. Open the firewall manager.

2. Click Inbound Rules from the left pane to reveal the Inbound Rules pane on the right.

3. On the Inbound Rules pane, click New Rule to open the New Inbound Rule Wizard.

4. In the New Inbound Rule Wizard under Rule Type, select Program and click Next.

5. Under the Program section, select the radio button for This program path and click Browse.

6. Locate the executable for the program you wish to open the port for, select it, and click Open.

7. Verify the path location is correct and click Next.

8. In the Action section, select the radio button for Allow the connection and click Next.

9. In the Profile section, select all appropriate profiles for your requirements and click Next.

10. Give your new rule a descriptive name to find it easily later, and click Finish.

You should now be able to see your new Windows Firewall Program Rule. Ensure the program you selected is running, and you can access it remotely.

Wrapping Up

A firewall is an essential tool in network security management. This article helps you open and change a port in Windows Firewall.

Windows Server options are available for Liquid Web’s VPS Hosting, Cloud Dedicated Servers, and Dedicated Servers. Contact our sales team to set up your server today.

Avatar for Matthew Hurst

About the Author: Matthew Hurst

Latest Articles

How to Install MySQL on Windows Server 2019

Read Article

How to Set Up a Cron Job in cPanel

Read Article

What Is Puppet Software and How Do You Use It?

Read Article

Accessing Man Pages on Ubuntu 16.04 LTS

Read Article

What is VMware Fusion?

Read Article