Network Ports Explained: The Number After a Website Hostname
What does the number after localhost mean in a preview address? A port helps direct a connection to the appropriate service on a device.
1:47 · No narration: the video shows each step as text on screen, and every step is written out below, with buttons that jump the video to it.
Prefer YouTube? Watch this video on our YouTube channel (opens in a new tab).
The six points in the video
This is a silent video. The headings, explanations and labels below reproduce the information on screen.
-
Step 1: The host identifies the destination
A hostname or IP address identifies where the connection is going.
On-screen labels: Hostname; IP address; Destination device.
-
Step 2: The port identifies a service
Different network services can listen on different ports.
On-screen labels: Service port; Listening application; Intended connection.
-
Step 3: A URL can show the port
It appears after the host, separated by a colon.
On-screen labels: Host name; Colon separator; Port number.
-
Step 5: Local previews often use others
A development server can listen on its configured local port.
On-screen labels: Preview application; Configured port; Running service.
-
Step 6: Check the exact preview address
A wrong port can reach another service or fail to connect.
On-screen labels: Correct host; Correct port; Expected application.
A practical check for your business
Check the intended hostname, protocol and port together when investigating a connection. The relevant service and network configuration determine which address the application needs.
Sources and further detail
Common questions
What does the number after localhost mean in a preview address?
A port helps direct a connection to the appropriate service on a device. Use the port supplied for the intended service.
Go further
More video tips
All 205 videos →
Parts of a Website URL Explained: Scheme, Host, Path, Query and Fragment
URL parts, explained.
Screen Readers Explained: How Website Structure Helps People Navigate
Screen readers, explained.