This article was co-authored 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.
There are 14 references cited in this article, which can be found at the bottom of the page.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 1,298,643 times.
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.
Click New Rule.... You'll see this option on the right side of the window.[2]XResearch source
4
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.[3]XExpert SourceLuigi OppidoLuigi Oppido Computer & Tech SpecialistExpert Interview
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.
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.
Open 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.[6]XResearch source To open one:
Press the Windows key and type cmd.
Right-click Command Prompt and select Run as Administrator.
Open 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:[7]XResearch source
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 port numbers on your Mac—the firewall manages ports on a per-application basis. Follow these steps to open your firewall settings:[8]XResearch source
macOS Ventura or later: Click the Apple menu, select System Settings, click Network, and then click Firewall.[9]XResearch source
macOS Monterey and earlier: Click the Apple menu, select System Preferences..., Click Security & Privacy, and then click the Firewall tab.
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.[12]XResearch source
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, click the dropdown menu to the right of the application’s name and select Allow incoming connections.
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."[13]XResearch source
Mac: Open the Launchpad, type terminal, and click Terminal.[14]XResearch 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.
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.
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.
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 a PC or on a Mac.
Make sure the port you want to open is not in use. You can do this using the netstat command at the command line. In this example, we'll check to see if port 3331 is open:
netstat -na | grep :3331
If you get a "Command not found" when using netstat, replace "netstat" with "ss" like this: ss -na | grep :3331
If the port is not currently in use, you will not get any sort of message because the port number was not found in the firewall rules. If the port is in use, you will see its associated rule.
Open the port in UFW (Uncomplicated Firewall). If you are using Debian, Ubuntu, or another Debian-based distribution running UFW, you would use this command to open port 3331:[15]XResearch source
Open the port in firewalld. If you are using firewalld, the default firewall for Fedora, CentOS, Red Hat, and other RH-based distros, you would use this command to open port 3331:[16]XResearch source
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.
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.[17]XResearch source
What does open ports mean? An open port is a network entry point that can accept connections. For example, when you load a website that begins with "https://", the SSL port (port 443) is open, which allows you to access the website.
2
Why do hackers scan for open ports? Hackers use port-scanning tools to scan for exploitable software/vulnerabilities in remote computers. For example, a hacker can enter an IP address, scan it for all open ports, and then use various tools to try exploiting the software running on those ports.[19]XResearch source
3
Why are ports 80 and 443 open? If these ports are open on your server, it's usually because there's a web server running (or installed and not yet running). Port 80 (and sometimes port 8080) is the standard unencrypted HTTP port, while 443 is the encrypted HTTPS port.[20]XResearch source In most cases, port 80 forwards to port 443 so that people attempting to load the unsecured version of the website will be served the SSL version.[21]XResearch source
4
What happens when you open a port? You're allowing inbound connections through your firewall. Essentially, you're opening a door to computers outside of your network to connect to the software that runs on that port.
Yes, opening the wrong port may compromise your computer's security and render it vulnerable to viruses and other malicious activity, like hacking.
Thanks! We're glad this was helpful. Thank you for your feedback.
If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even 1ドル helps us in our mission.
Support wikiHow
By using ipconfig command at the command prompt or using Windows log key and type run and then cmd.
Thanks! We're glad this was helpful. Thank you for your feedback.
If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even 1ドル helps us in our mission.
Support wikiHow
Go to command prompt and enable telnet services, syntax, telnet (ipadress) (port number).
Thanks! We're glad this was helpful. Thank you for your feedback.
If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even 1ドル helps us in our mission.
Support wikiHow
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.
This article was co-authored 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,298,643 times.
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.
Thanks to all authors for creating a page that has been read 1,298,643 times.
Reader Success Stories
Ogymus Shepherd
Ogymus Shepherd
Feb 11, 2017
"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
"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
Sudarshan K.
Sudarshan K.
Sep 5, 2016
"The idea that for forwarding to work, it's necessary to open ports in Firewall as well was most helpful. I only found this info here."..." more
H. L. Chong
H. L. Chong
Mar 23, 2018
"It gives me an understanding of open ports and opening ports. Thank you."
Rated this article:
T. C.
T. C.
Oct 30, 2017
"There were step-by-step directions that were accurate."