What is a port?
A port is a numbered door on a computer that lets one machine run many network services at the same time.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
A port is a number between 0 and 65535 that tells a computer which program should receive incoming network traffic. Think of an apartment building: the IP address is the street address, and the port is the flat number. Mail for flat 80 goes to the web server, mail for flat 22 goes to SSH, and so on. Without ports, one machine could only ever offer a single service.
You meet ports every time you type a URL with a colon and a number, such as http://localhost:8080. Well known services have fixed defaults: 80 for HTTP, 443 for HTTPS, 22 for SSH, 5432 for PostgreSQL. When a service refuses to start with the message that the address is already in use, another program is already sitting on that port.
ss -tlnp
lsof -i :8080
See also: What is an IP address? and What is a firewall?
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0274 What is DNS? DNS is the internet's phone book: it turns names like example.com into the IP addresses computers actually use. Beginner · Explains an idea · Any system Article DNS, IP addresses & ports 15 Oct 2026
- 0275 What is an IP address? An IP address is the unique number that identifies a device on a network so data knows where to go. Beginner · Explains an idea · Any system Article DNS, IP addresses & ports 15 Oct 2026
- 0341 DNS, IP addresses and ports explained for beginners An IP address says which machine, a port says which program on it, and DNS turns names into addresses. The three ideas… Beginner · Explains an idea · Linux, macOS Article DNS, IP addresses & ports 15 Oct 2026
- 0342 Which process is using a port, and how to free it Find the program behind a busy port with ss, lsof or fuser, decide whether to stop it properly or kill it, and… Beginner · Step by step · Linux, macOS Article DNS, IP addresses & ports · Networking & firewalls 15 Oct 2026
- 0343 Fix: Connection refused and Connection timed out, what each one means Refused means the host answered and nothing is listening there. Timed out means no answer at all, usually a firewall or wrong… Beginner · Fixes an error · Linux, macOS Article DNS, IP addresses & ports · Firewalls 15 Oct 2026
- 0347 Port check script: test a list of host:port pairs with timeouts A bash script that tries a TCP connection to each host:port you give it, waits a few seconds at most, and reports… Beginner · Cheat sheet · Linux, macOS Script DNS, IP addresses & ports · Firewalls 15 Oct 2026
Repos in the wild
- Pi-hole: network-wide ad blocking with your own DNS server pi-hole/pi-hole A DNS server for your home or office network that answers queries for known advertising and tracking domains with nothing, so every device on the network is protected without installing anything on it. GitHub
- Nmap: the network mapper for inventorying your own network nmap/nmap Nmap is the long-standing open source tool for discovering hosts, open ports, services and operating systems on a network you administer, used to inventory systems and verify that firewall rules behave as intended. GitHub
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +791 chars