What Are Network Ports?
A network port is a number from 0 to 65535 that identifies a specific service or process on a device, alongside its IP address. Ports let one server run many services at the same time, for example a web server on port 443 and a mail server on port 25 on the same machine. The combination of IP address, port number and protocol (TCP or UDP) uniquely identifies a connection.
Why ports exist
A server has one IP address but often runs several services: a website, a mail server, a database, a remote login service. Without ports, the operating system would have no way to know which program should receive an incoming packet. The port number, carried inside the TCP or UDP header alongside the IP address, tells the operating system exactly which process is listening and should handle the request.
Port number ranges
| Range | Name | Typical use |
|---|---|---|
| 0 to 1023 | Well-known ports | Standard services like HTTP, HTTPS, SSH, FTP; require admin privileges to bind on most systems |
| 1024 to 49151 | Registered ports | Specific applications and databases, for example MySQL on 3306 |
| 49152 to 65535 | Dynamic or private ports | Temporary ports a client picks for its side of an outgoing connection |
Common ports in web hosting
| Port | Service |
|---|---|
| 21 | FTP |
| 22 | SSH / SFTP |
| 25 | SMTP (mail sending between servers) |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 3306 | MySQL |
| 5432 | PostgreSQL |
A firewall typically blocks everything except the specific ports a server actually needs, which reduces the number of ways an attacker can reach it.
TCP ports vs. UDP ports
The same port number can exist independently on TCP and on UDP, since they are separate protocols. TCP ports are used where delivery and order matter, such as web pages and file transfers, because TCP confirms every packet arrived. UDP ports are used where speed matters more than guaranteed delivery, such as DNS lookups and some video or voice traffic. DNS, for example, mainly uses UDP port 53 but falls back to TCP port 53 for larger responses.
Checking which ports are open
# List listening ports on a Linux server
ss -tulnp
# Older alternative
netstat -tulnp
# Test if a specific port is reachable from another machine
telnet example.com 443
nc -zv example.com 443
Frequently asked questions
What is a port number in simple words?
A port number is a number that tells a server which service should handle an incoming connection, since one IP address can run several services at once. HTTPS normally uses port 443, for example.
What is the difference between a port and an IP address?
An IP address identifies the device on the network, like a building's street address. A port number identifies the specific service inside that device, like a suite number inside the building.
What port does HTTPS use?
HTTPS uses port 443 by default. Plain, unencrypted HTTP uses port 80.
Can two applications use the same port?
Not on the same IP address and protocol at the same time. If a second program tries to listen on a port that is already in use, it will fail to start with an "address already in use" error.
How do I check which ports are open on my server?
On Linux, run ss -tulnp or netstat -tulnp to see which ports are listening locally. To test from another machine, tools like telnet or nc can check if a specific port actually responds.
What does a firewall do with ports?
A firewall allows or blocks traffic based on rules that usually include the port number, so a server can expose only the ports it needs, such as 80, 443 and 22, and block everything else.
Why do ports below 1024 need special privileges?
On Unix-like systems, binding to a port under 1024 traditionally requires root or administrator privileges, since these well-known ports are reserved for standard system services and this rule limits which programs can claim them.
Related topics
- What Is an IP Address? Networking & IP
- What Is a Web Server? Web Servers
- What Is Port 443? Networking & IP
- What Is an Email Server? Email Hosting
- What Is a Database? Databases