Glossary · Internet & Web

localhost

localhost is the hostname that always refers to the current device, resolving to 127.0.0.1 in IPv4 and ::1 in IPv6, used for local development and testing.

Updated October 6, 2026

localhost is a reserved hostname that points back to the computer you are using. It resolves to the loopback address 127.0.0.1 (IPv4) or ::1 (IPv6), so traffic never leaves the machine.

Why it matters

Developers run web servers and databases on localhost to build and test before deploying. It also explains confusing situations: a service bound only to localhost cannot be reached from other machines, and a monitoring tool cannot check your localhost:3000 from the internet.

Example

$ npm start
Server listening on http://localhost:3000

Opening that address works on your computer. A friend entering your public IP cannot reach it unless the server listens on all interfaces and the port is exposed.

Common mistakes

  • Giving a localhost URL to a webhook provider or monitor; it points to their machine, not yours.
  • Binding a database to 0.0.0.0 instead of localhost and exposing it publicly.
  • Mixing up localhost and your machine's network IP.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.