Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

What is: localhost

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

In computer networking localhost literally means “this computer”. When you type a URL into your browser, you are essentially connecting to a “host” computer somewhere else in the world. This computer serves you the web page that you requested. If you type “localhost” into your browser, however, then your browser will know that you want to connect to the computer you are currently using. If your computer is running web server software like Apache, then your browser will be served a web page by your own computer, which is otherwise known as the localhost. Every computer connected to the internet has an IP address and your localhost has one too. Typically the IP address is 127.0.0.1.

Localhost is often used for testing and development. When a developer installs WAMP, LAMP, or MAMP software stack on their personal computer, then they will typically type “localhost” into their browser in order to pull up their WordPress web site. Local server environments can speed up the development time. It is also great for learning purposes.

Another common usage of localhost is when you are trying to connect to your MySQL database. Usually this happens when you are installing WordPress on your server. It is beyond the scope of this article, but during the WordPress installation you are asked for a hostname which is usually localhost. The reason for this is that WordPress and MySQL both are typically installed on the same server. In order for them to communicate with each other, they must be aware of this. By telling WordPress that your MySQL database server is “localhost” you are basically telling WordPress to look for the database on the same computer.

Additional Reading

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!