CentOS Debian Mint openSUSE Red Hat Ubuntu

What is Localhost?


Localhost is a combination of two words “local” (your computer) and “host” (server) is a term for a server running on a personal computer.

Localhost allows you to access network services running on that computer using a loopback network port. It is like a web server including Apache, MySQL, PHP, and PHPmyadmin. Below we will tell you what localhost is as we go through it below. address

Localhost is not just a term but it can also be a domain name. It is a network address. If you type “google.com”, it will navigate to Google home. So if you type localhost, it will navigate to your own device. In this case, it will use an IP address let the domain name localhost point to, this special address is called the loopback address.

The default loopback address is, located in the loopback IP range of your computer is from to If open address with IPv4 connection, it will enable loopback. You can enable loopback with IPv6 connection by typing :1.

Purpose of Localhost

What can you do with localhost? There are 3 special advantages that loopback/localhost does:

1. Check the internet connection:

You can check the internet connection by using the ping command. Open the terminal and type “ping” or “ping localhost” to check:

$ ping


2. Check software or web applications

This is very useful for programmers when they create web applications or software that need an internet connection.

3. Block site

The essence of this is that you change the IP address of a domain name to For example, I want to block the domain “google.com”:

Firstly. we will access to hosts file by text editor:

$ sudo nano /etc/hosts

Secondly, you type: google.com

Save it and the domain “google.com” was being blocked.


You have just seen the details of what localhost is, what is, and their purpose.

Thanks for reading.

Similar Posts