A user-friendly guide to allowing connections and applications through your firewall

Do you need to allow an application or service through your PC or Mac's firewall? If you're running a server, live streaming, or using an app that requires a port to be open, we can help. Many ports are closed by default to prevent intrusion, but it's easy to open them. While opening a port may be required by some software, you should only open ports for software you trust. This wikiHow article will teach you how to open a port on Windows 10, Windows 11, and macOS. If you're using Linux, check out our Linux firewall port guide.

Things You Should Know

  • In Windows Firewall, you can open TCP and UDP ports by number or range.
  • On a Mac, you can allow applications and services through your firewall individually.
  • If opening a port on your computer doesn't fix your problems, you may need to enable port forwarding on your router.
  • See all open ports using a web-based port scanner, or by typing a command into Command Prompt or Terminal.
Section 1 of 4:

Open a Port on Windows

  1. 1
    Open Windows Firewall with Advanced Security. To access your firewall settings on Windows 10 or 11, follow these quick steps:
    • Press the Windows key on your keyboard or click the magnifying glass in your taskbar.
    • Type windows firewall.
    • Click Windows Firewall with Advanced Security.
    • If prompted, enter your password to confirm.
  2. 2
    Click Inbound Rules. It's in the upper-left side of the window.
    Advertisement
  3. 3
    Click New Rule…. You'll see this option on the right side of the window.
  4. 4
    Check the "Port" option and click Next. This will allow you to manually choose the ports you want to open.
  5. 5
    Select TCP or UDP. Check the TCP box or the UDP box.
    • Check your program's support documentation to ensure that you are using the correct protocol.
  6. 6
    Enter in the port range. Make sure the "Specific local ports" option is selected, and then type the ports you need to open into the field. You can open multiple individual ports by separating them with a comma, and you can denote a range of ports by using a dash between the two ends of the range.
    • For example, you would type 8830 to open port 8830, 8830, 8824 to open both port 8830 and port 8824, or 8830-8835 to open ports 8830 through 8835.
  7. 7
    Click Next. It's at the bottom of the window.
  8. 8
    Make sure "Allow the connection" is checked, then click Next. If this option isn't checked, click the checkbox before continuing.
  9. 9
    Make sure all three boxes on the "Profile" page are checked. These include the "Domain", "Private", and "Public" boxes.
  10. 10
    Click Next. It's at the bottom of the window.
  11. 11
    Enter a name for your rule, then click Finish. This will save your settings and open your port(s).
    • If opening the ports required by your software or server doesn't resolve your problem, you may need to also set up port forwarding on your router.
  12. Advertisement
Section 2 of 4:

Open a Port on a Mac

  1. 1
    Open your Mac's firewall settings. If you want to allow a specific app through your firewall, you can do so in your firewall settings. Unlike in Windows, you won't need to open specific ports numbers on your Mac—the firewall manages ports on a per-application basis.[1] Follow these steps to open your firewall settings:
    • macOS Ventura or later: Click the Apple menu, select System Settings, click Network, and then click Firewall.[2]
    • macOS Monterey and earlier: Click the Apple menu, select System Preferences…, Click Security & Privacy, and then click the Firewall tab.
  2. 2
    Make sure the firewall is turned on. Because your Mac's firewall is turned off by default, you'll want to double-check to make sure it's turned on. If the firewall is off, there's no need to open a specific port
  3. 3
    Click Firewall Options. It's on the right side of the Firewall page.
  4. 4
    Click +. You'll see this option below the window that's in the middle of the page.
  5. 5
    Select an application to allow through the firewall. Simply click an application to select it.
  6. 6
    Click Add. It's near the bottom of the window. Doing so will add the program to the list of exceptions in the firewall.
  7. 7
    Make sure "Allow incoming connections" is displayed next to the app's name. If you don't see this to the right of the application's name, select the application, then click its up and down arrows to toggle on Allow incoming connections.
  8. 8
    Click OK to save your changes. The application is now allowed through the firewall.
    • If opening the ports required by your software or server doesn't resolve your problem, you may need to also set up port forwarding on your router.
  9. Advertisement
Section 3 of 4:

Open a Router Port

  1. 1
    Find your router's IP address. You'll need your router's IP address to access your router's configuration page.
    • Windows: Press the Windows key on your keyboard, type cmd, and click Command Prompt. At the prompt, type ipconfig and press Enter. The IP address of your router appears next to "Default gateway."
    • Mac: Open the Launchpad, type terminal, and click Terminal.[3] Then, type or paste netstat -nr and press Return to find the IP next to "Default."
  2. 2
    Go to your router's settings page. Open your preferred web browser, then type or paste your router's IP address into the address bar. Press Enter or Return to bring up the login page.
  3. 3
    Sign in with your router's admin username and password. If you've already configured the router, enter the username and password you chose then. If not, consult your router's manual or online page for the stock username and/or password.
  4. 4
    Find the Port Forwarding section. Since each router's page will differ slightly from others, look for the following options (or variations of them):
    • Port Forwarding
    • Applications
    • Gaming
    • Virtual Servers
    • Firewall
    • Protected Setup
    • You may also want to look for an Advanced Settings section.
  5. 5
    Open your preferred port. Each router will have a slightly different way of doing this, although the required information is the same for any router:
    • Name or Description - Enter the application's name.
    • Type or Service Type - This can be TCP, UDP, or both. If you aren't sure of which one to select, click Both or TCP/UDP.
    • Inbound or Start - Type in the port number here. If you are opening a range of ports, type in the lowest number in the range instead.
    • Private or End - Re-type in the port number here. If you are opening a range of ports, type in the highest number in the range instead.
    EXPERT TIP
    Luigi Oppido

    Luigi Oppido

    Computer & Tech Specialist
    Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.
    Luigi Oppido
    Luigi Oppido
    Computer & Tech Specialist

    Expert Warning: When you're opening ports, make sure you're not opening a standard remote monitoring port that someone else can use to attack your computer. The ports numbered 80 and 85 are almost always blocked in routers, for instance, because they're usually remote management ports, and that can be an easy way for a hacker to get into your network.

  6. 6
    Enter your computer's private IP address. This goes in the "Private IP" or "Device IP" field. You can find your private IP address on PC or on Mac.
  7. 7
    Save your settings. Click the Save or Apply button. If prompted, you'll also need to restart your router for the changes to take effect.
    • You may also have to check an "Enabled" or "On" box next to the forwarded port row.
  8. Advertisement
Section 4 of 4:

How to Check if Ports are Open

  1. 1
    To see if your ports are open to people outside of your network, try a web-based port checker. These port-checking websites are great for making sure certain ports, such as your Minecraft server or Soulseek port, are open. Just visit any of these sites and enter your IP address and the port you want to check.
  2. 2
    See all open ports on Windows. If you want to see a quick list of all open ports on your Windows PC, you can run a simple command at the command prompt. Here's how:
    • Press the Windows key on your keyboard and type cmd.
    • Right-click Command prompt and choose Run as administrator.
    • Click Yes to proceed.
    • Type netstat -ab and press Enter.
    • All open TCP and UDP ports will appear, along with the name of the app using that port.[4]
  3. 3
    See all open ports on a Mac. You can see a list of all open ports in your Mac's Terminal app. Here's how:
    • Open Terminal by clicking the Terminal icon on the Launchpad.
    • Type lsof -i -P and press Return to see all open (listening) ports.
  4. Advertisement

Community Q&A

  • Question
    Will this put my device or router in danger of hacking or viruses?
    Community Answer
    Community Answer
    Yes, opening the wrong port may compromise your computer's security and render it vulnerable to viruses and other malicious activity, like hacking.
  • Question
    How can a hacker open a port?
    Community Answer
    Community Answer
    By using ipconfig command at the command prompt or using Windows log key and type run and then cmd.
  • Question
    How do I tell if a port is open on my router?
    Community Answer
    Community Answer
    Go to command prompt and enable telnet services, syntax, telnet (ipadress) (port number).
Advertisement

Warnings

  • Be careful when opening ports. Opening the wrong port may compromise your computer's security and make it vulnerable to viruses and other malicious activity, like hacking.
    ⧼thumbs_response⧽
Advertisement

About This Article

Luigi Oppido
Written by:
Computer & Tech Specialist
This article was written by Luigi Oppido and by wikiHow staff writer, Nicole Levine, MFA. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years. This article has been viewed 1,209,663 times.
How helpful is this?
Co-authors: 16
Updated: March 24, 2023
Views: 1,209,663
Categories: Computer Networking
Article SummaryX

1. Sign in to your router’s admin site.
2. Go to the Firewall page.
3. Locate the Port Forwarding section.
4. Enter or select the port.
5. Enter your computer’s private IP address.
6. Click Save or Apply.
7. Restart the router.

Did this summary help you?
Advertisement