How to open ports on Windows Firewall | Server 2012/2016/2019/2022

Firewalls exist to protect you, your service and your data from hackers and viruses. However, you may need to whitelist some ports to allow access to your project or service from some remote location, or to allow others on the internet to access your content publicly. In this guide, I will teach you how to portforward any TCP or UDP port on Windows Firewall.

If the port is still showing as closed despite your program running on it, please double-check everything by making sure you have entered the correct port(s) and protocols (TCP/UDP) into the firewall rule...

This guide is intended for the use of EpicHosts clients, but should apply to most other default setups of the Windows Server operating system. If you are running your project or service from a home computer, you may also need to portforward through your router. Due to there being thousands of makes and models for routers out there, I will not be covering how to open ports through a router in this guide. However, I can direct you to a site which will assist you with opening ports on your router by selecting its make and model:

  1. From the desktop, press the Start button and type 'Advanced Firewall' into the search bar. You should see 'Windows Firewall with Advanced Security' as a result.
  2. Once you have opened 'Windows Firewall with Advanced Security', you will be greeted by profiles along with inbound and outbound rules. Make sure to select 'Inbound Rules'. You must select Inbound and NOT Outbound because outbound connections are all allowed by default unless a rule states otherwise (as mentioned on the profiles) however all inbound connections are blocked unless a rule states otherwise. So we need to open your port(s) through an 'Inbound Rule'.
  3. After selecting 'Inbound Rules', you should see all the rules currently listed with green and grey checkmarks. On the right-hand side, you will see a 'New Rule...' button. Press that to proceed with opening a new port.
  4. You will now be greeted by a 'New Inbound Rule Wizard' window. It is recommended to know which port(s) you need to open and whether they should be on TCP or UDP. However, if you are unsure of the port, you can opt to portforward the whole program instead. But for this guide, I will assume you know the port(s) you wish to open. Select the 'Port' radio then press 'Next'.
  5. Now you can enter the port(s) you want to open in the format shown in the example (Example: 80, 443, 5000-5010). The example is explaining that you can open seperate ports by using commas, and a whole range of ports by using a hyphen. If you are unsure whether the port you are opening is TCP or UDP, you can try with TCP first, but if the port does not work, you can edit the rule later by double-clicking on it on the 'Inbound Rules' list shown on 3.
  6. Keep 'Allow the connection' selected on the radio, then press Next and keep all the profiles checkboxes marked (Domain/Private/Profile), unless you are certain you know which profile your network adapter is using.
  7. Finally, give the rule a memorable name. In this instance, I have named the rule 'Apache' as I am opening TCP port 80 for the Apache Web Service.

Congratulations! You have now opened port(s) through a rule on the Windows Firewall. If you are not behind a router or any other firewalls, the port(s) should work as intended now. Should you want to test the port(s), you can use an open port checker such as this: You MUST have a program running on the port(s) in order for the site to show the port as open! If you try to use an open port checker whilst nothing is running on the port, the site will show the port as closed.

If the port is still showing as closed despite your program running on it, please double-check everything by making sure you have entered the correct port(s) and protocols (TCP/UDP) into the firewall rule, and also make sure your program is properly configured to bind to your internet's IP and the port(s) that have been opened. If you are still having issues, don't hesitate to contact our support using the 'Support' button shown at the top of every page on our site. If you are not a customer to EpicHosts, we will happily look into any issues at no charge but we may quote a charge to resolve the issue as part of a 'remote support' labour/management fee.

Thank you for reading this guide and we hope it has helped you understand how to open ports through the Windows Firewall on Windows Server operating systems!

If you are looking for Website Hosting, VPS Hosting, Game Server Hosting or Radio Server Hosting - give us a try! Contact us today to receive an unbeatable quote and start a whole new project with us today, or transfer your current one to us!