- Windows Firewall |
- Windows Command Prompt |
- macOS |
- Router Ports |
- Linux |
- Check If Ports Are Open |
- FAQ |
- Video |
- Q&A |
- Tips |
- Warnings
Do you need to allow an application or service through your PC or Mac's firewall? If you're running a server, streaming, gaming, 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. This wikiHow article will teach you how to open a port on Windows 10, Windows 11, Mac,, Linux, and even on your router . We'll also show you how to find out if ports are open and share helpful security tips from computer and tech specialist Luigi Oppido.
Quick Steps: Open a Port on Windows
- Open Windows Defender Firewall with Advanced Security.
- Go to Inbound Rules > New Rule .
- Select Port .
- Select TCP or UDP and enter the port or range.
- Select "Allow the connection."
- Name the firewall rule and click Finish .
Steps
Open Ports on Windows (Windows Firewall)
-
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 Defender Firewall with Advanced Security .
- If prompted, enter your password to confirm.
-
Advertisement
-
Check the "Port" option and click Next . This will allow you to manually choose the ports you want to open.
- If you are being told to open a port to use a specific application or play a certain game, Oppido recommends looking it up first. "If I'm being asked to open up a port, I do a quick Google search to see if that port is being used by any other services or protocols," he says. If the port number is commonly used for a certain program, make sure that program isn't something hackers are scanning for, as this could leave your system vulnerable.
-
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.
- In most cases, if you're opening a port to run specific software, you're opening a TCP port.
-
Enter 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.
- If you are supposed to choose a random port, Oppido recommends selecting a port in the thousands because a lot of three-digit port numbers are used by other apps and services.
-
Click Next . It's at the bottom of the window.
-
Make sure "Allow the connection" is checked, then click Next . If this option isn't checked, click the checkbox before continuing. [3] X Research source
- You can also use this tool to block connections .
-
Make sure all three boxes on the "Profile" page are checked. These include the "Domain", "Private", and "Public" boxes.
-
Click Next . It's at the bottom of the window.
-
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 also need to set up port forwarding on your router.
Open Ports on Windows (Command Prompt)
-
1Open Command Prompt as an administrator. If you want to use the command prompt to open ports on Windows, you'll want an administrator CMD window. [4] X Research source To open one:
- Press the Windows key and type cmd .
- Right-click Command Prompt and select Run as Administrator .
- Click Yes to continue.
-
2Open a port. To open ports in command prompt, you'll use the netsh advfirewall command. You will need to know the port number you are supposed to open and the protocol (TCP or UDP). In this example, we will open port 25565, a port commonly associated with Minecraft: [5] X Research source
- netsh advfirewall firewall add rule name= "Open port 25565" dir=in action=allow protocol=TCP localport=8025565
- "Open port 25565" is the name we gave to the firewall rule–you can call this anything you want.
- You can learn about more port-opening options by running the command netsh advfirewall firewall add rule ?
- Want to see which ports are open? Jump down to How to Check if Ports are Open .
Open Ports on a Mac
-
1Open 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 port numbers on your Mac—the firewall manages ports on a per-application basis. Follow these steps to open your firewall settings: [6] X Research source
- macOS Ventura or later: Click the Apple menu, select System Settings , click Network , and then click Firewall . [7] X Research source
- macOS Monterey and earlier: Click the Apple menu, select System Preferences… , Click Security & Privacy , and then click the Firewall tab.
-
2Click Options… . This will be called "Firewall Options" on older versions of macOS. A list of firewall rules will appear.
- If the options button is turned off, the firewall is disabled. Enable it now to continue. [8] X Research source
-
3
-
Select an application to allow through the firewall. Simply click an application to select it.
- If the app you are looking for doesn't appear on the list, it may already have access through the firewall. This is true for many system services, as well as some digitally signed apps. [10] X Research source
-
5Click Open . It's near the bottom of the window. Doing so will add the program to the list.
-
6Make 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, click the dropdown menu to the right of the application’s name and select Allow incoming connections .
-
7Click 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.
Open Ports on a Router
-
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." [11] X Research source
- Mac: Open the Launchpad, type terminal , and click Terminal . [12] X Research source Then, type or paste netstat -nr and press Return to find the IP next to "Default."
-
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.
-
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.
- If you've forgotten your login information, you may have to reset the router .
-
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.
-
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 TIPComputer & Tech SpecialistLuigi 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.Don't open ports unless you know what you are doing. If you are opening ports, you're opening more doorways into your network. Use unique ports that people aren't using, maybe in the thousands or so, because a lot of people use three-digit ports.
-
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.
Community Q&A
-
QuestionWill this put my device or router in danger of hacking or viruses?Community AnswerYes, opening the wrong port may compromise your computer's security and render it vulnerable to viruses and other malicious activity, like hacking.
-
QuestionHow can a hacker open a port?Community AnswerBy using ipconfig command at the command prompt or using Windows log key and type run and then cmd.
-
QuestionHow do I tell if a port is open on my router?Community AnswerGo to command prompt and enable telnet services, syntax, telnet (ipadress) (port number).
Video
Tips
- Most applications use TCP ports. Time-sensitive programs, like multiplayer video games and live streaming apps, may use both UDP and TCP ports.Thanks
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 .Thanks
References
- ↑ https://learn.microsoft.com/en-us/sql/reporting-services/report-server/configure-a-firewall-for-report-server-access?view=sql-server-ver16
- ↑ https://learn.microsoft.com/en-us/sql/reporting-services/report-server/configure-a-firewall-for-report-server-access?view=sql-server-ver16
- ↑ https://learn.microsoft.com/en-us/sql/reporting-services/report-server/configure-a-firewall-for-report-server-access?view=sql-server-ver16
- ↑ https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior
- ↑ https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior
- ↑ https://support.apple.com/guide/mac-help/block-connections-to-your-mac-with-a-firewall-mh34041/mac
- ↑ https://support.apple.com/guide/mac-help/block-connections-to-your-mac-with-a-firewall-mh34041/15.0/mac/15.0
- ↑ https://support.apple.com/guide/mac-help/block-connections-to-your-mac-with-a-firewall-mh34041/15.0/mac/15.0
- ↑ https://support.apple.com/guide/mac-help/change-firewall-settings-on-mac-mh11783/mac
- ↑ https://support.apple.com/guide/mac-help/change-firewall-settings-on-mac-mh11783/mac
- ↑ https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig
- ↑ https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac
- ↑ https://documentation.ubuntu.com/server/how-to/security/firewalls/index.html
- ↑ https://firewalld.org/documentation/howto/open-a-port-or-service.html
- ↑ https://portchecker.co/canyouseeme
- ↑ https://canyouseeme.org
- ↑ https://www.portcheckers.com/
- ↑ https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netstat
- ↑ https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac
- ↑ https://www.techtarget.com/searchnetworking/definition/port-number
- ↑ https://httpd.apache.org/docs/2.4/bind.html
- ↑ https://learn.microsoft.com/en-us/intune/configmgr/core/plan-design/hierarchy/ports
About This Article
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.
Reader Success Stories
- "This article helped me, but there was one tip that helped me a lot. It was number 3, because I didn't know where to create a new rule. Thanks!" ..." more