{"id":13741,"date":"2019-01-18T08:11:45","date_gmt":"2019-01-18T08:11:45","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=13741"},"modified":"2025-04-28T07:42:59","modified_gmt":"2025-04-28T07:42:59","slug":"what-is-localhost","status":"publish","type":"post","link":"\/uk\/tutorials\/what-is-localhost\/","title":{"rendered":"What Is Localhost?"},"content":{"rendered":"<p>A good way to think of <strong>localhost<\/strong>, in computer networking, is to look at it as &ldquo;this computer&rdquo;. It is the default name used to establish a connection with your computer using the loopback address network.<\/p><p>The loopback address has a default IP (127.0.0.1) useful to test programs on your computer, without sending information over the internet. This helps when you are testing applications that aren&rsquo;t ready for the world to see.<\/p><p>When you call an IP address from your computer, you usually try to contact a different computer over the internet. However, with the loopback address, you are calling the localhost, aka your computer.<\/p><p>If you want to learn about computer networking, it&rsquo;s important to understand the language that you&rsquo;ll run into. No better place to start than learning about <strong>localhost.<\/strong><\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/Web-Development-Glossary-for-Beginners.pdf\" target=\"_blank\" rel=\"noopener\">Download glossary for web beginners<\/a><\/p><p>\n\n\n\n\n\n<div class=\"protip\"><div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                   What Is Localhost?\n                <\/p>\n            <\/div>\n            <p class=\"protip__content\"> Localhost is the hostname or the computer that is currently in use to run a program, in which the computer has the role as a virtual server. In web development, you can develop a server by editing the code in the localhost and exporting your data to the server. <\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-localhost-explained-in-a-video-tutorial\">Localhost Explained in a Video Tutorial<\/h2><p>Too busy to read? Check out our video tutorial instead.<\/p><figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"What is Localhost? | Explained\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/m98GX51T5dI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure><p>\n\n\n\n  <div class=\"youtube-shortcode\">\n    <div class=\"row\">\n      <div class=\"col-7 col-sm-8 d-flex align-items-center\">\n        <img decoding=\"async\" class=\"channel-logo\" src=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/themes\/tutorialsthemeuplift\/public\/images\/youtube-channels\/hostinger-academy.jpg\" alt=\"youtube channel logo\">\n        <div class=\"d-flex flex-column justify-content-between\">\n          <span class=\"slogan d-none d-sm-block\">Subscribe For more educational videos!<\/span>\n          <span class=\"channel-name\">Hostinger Academy<\/span>\n                    <\/div>\n      <\/div>\n      <div class=\"col-5 col-sm-4 d-flex align-items-center justify-content-end\">\n          <a class=\"subscribe-button\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"http:\/\/www.youtube.com\/channel\/UCbNIC-svDbtUOH2qsLnPQPg?sub_confirmation=1\">\n            <img decoding=\"async\" src=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/themes\/tutorialsthemeuplift\/public\/images\/icons\/youtube.svg\" alt=\"subscribe\">\n            <span>Subscribe<\/span>\n          <\/a>\n      <\/div>\n    <\/div>\n  <\/div>\n\n    \n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-what-is-127-0-0-1-and-a-loopback-address\">What is 127.0.0.1 and a Loopback Address?<\/h2><p>Like an <a href=\"\/uk\/tutorials\/what-is-ip-address\/\">IP address<\/a>, when typing <strong>google.com<\/strong> in a web browser it directs you to its local hosting website, Google&rsquo;s main page. So where will localhost take you? It will take you to your computer. This situation is also known as a loopback address.<\/p><p>Like any other domain name, localhost also has an IP (Internet Protocol) address. The addresses range from <strong>127.0.0.0<\/strong> to <strong>127.255.255.255<\/strong>, but it&rsquo;s normally <strong>127.0.0.1<\/strong>. Trying to open the address <strong>127.0.0.1<\/strong> in an <strong>IPv4<\/strong> connection will trigger a loopback, referring you back to your own web server. You can also start a loopback back to your own server with an <strong>IPv6<\/strong> connection by entering&nbsp;:1.<\/p><p>Fun fact: the first section of the address &ndash; <strong>127<\/strong> &ndash; is reserved only for loopbacks. For that reason, <strong>Transmission Control Protocol<\/strong> and <strong>Internet Protocol<\/strong> (TCP\/IP) immediately recognize that you want to contact your computer after entering any address that starts with these numbers. That is why no websites can have IP addresses that begin with <strong>127<\/strong>. If initiated, this action will create a loopback device; which is a virtual interface inside your computer&rsquo;s operating system (<strong>OS<\/strong>).<\/p><h2 class=\"wp-block-heading\" id=\"h-what-is-localhost-used-for\">What Is Localhost Used For?<\/h2><p>Despite its simple meaning, localhost is useful if you are a developer, network administrator, and for testing. Generally, there are three advantages that loopback offers:<\/p><h3 class=\"wp-block-heading\" id=\"h-program-or-web-application-test\"><strong>Program or Web Application Test<\/strong><\/h3><p>Using localhost is one of the main uses for developers; especially if they are creating web apps or programs that require an internet connection. During development, tests are run to see if the applications actually work. By using a loopback to test them, developers can create a connection to the localhost, to be tested inside the computer and system they are currently using.<\/p><p>Since your <strong>OS<\/strong> becomes a simulated web server once a loopback is triggered. You can load the necessary files of a program into the web servers and check its functionality.<\/p><h3 class=\"wp-block-heading\" id=\"h-site-blocking\"><strong>Site Blocking<\/strong><\/h3><p>Another interesting trick is blocking websites that you do not wish to access. Loopback is useful for preventing your browser from entering harmful sites, like ones containing viruses.<\/p><p>Before learning how this works, however, you need to know what &ldquo;<strong>hosts file<\/strong>&rdquo; is and its role in this context. As you already know, all <a href=\"\/uk\/domain-name-search\">domains<\/a> have IP addresses. You can enter a website because the <strong>DNS<\/strong> or <strong>Domain Name System<\/strong> searches for the appropriate IP address under which the site is registered.<\/p><p>Your computer helps improve this process by storing a hosts file for every site you have visited. This file contains the IP address and the domain names of websites. You can change the IP address into <strong>127.0.0.1<\/strong> and the site which hosts file you modified redirects you to the localhost instead.<\/p><p>An example could be a company&rsquo;s computer admin blocking access to a website.<\/p><h3 class=\"wp-block-heading\" id=\"h-speed-test\"><strong>Speed Test<\/strong><\/h3><p>As a network administrator, you will want to make sure that all equipment and the TCP\/IP are in top condition. You can do this with a connection test and by sending a ping request to the localhost.<\/p><p>For example, you can easily open the command prompt or the terminal and enter &ldquo;<strong>ping localhost<\/strong>&rdquo; or &ldquo;<strong>ping 127.0.0.1<\/strong>&rdquo;. The localhost test will show how well everything performs, from the number of data packets received, sent, or lost, to how long the data transmission takes. If there are any problems, you can immediately fix any that occur.<\/p><p>For more detailed testing and comprehensive insights, modify the packets sent to the localhost. Check out our <a href=\"\/uk\/tutorials\/linux-ping-command-with-examples\/\">Linux ping command<\/a> tutorial to learn how to do so.<\/p><figure class=\"wp-block-image size-full\"><a href=\"\/uk\/web-hosting\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/public\" alt=\"Hostinger web hosting banner\" class=\"wp-image-98604\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/11\/Web-hosting_in-text-banner.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/11\/Web-hosting_in-text-banner-300x88.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/11\/Web-hosting_in-text-banner-150x44.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/11\/Web-hosting_in-text-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Now you understand that localhost is not merely a technical term for your computer. It is a default name that enables you to test programs and even close access to websites. If you aspire to be an IT technician, it is essential to know what is localhost and how to use a loopback according to your needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A good way to think of localhost, in computer networking, is to look at it as &ldquo;this computer&rdquo;. It is the default name used to establish a connection with your computer using the loopback address network. The loopback address has a default IP (127.0.0.1) useful to test programs on your computer, without sending information over [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/uk\/tutorials\/what-is-localhost\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"What is Localhost? Localhost Explained for Beginners","rank_math_description":"In computer networking, localhost refers to a computer running a program; in which the computer works as a virtual server.","rank_math_focus_keyword":"what is localhost","footnotes":""},"categories":[22642,22640],"tags":[],"class_list":["post-13741","post","type-post","status-publish","format-standard","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/what-is-localhost","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/o-que-e-localhost","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/localhost-c-est-quoi","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/que-es-localhost","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/apa-itu-localhost","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/what-is-localhost","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/what-is-localhost","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/what-is-localhost","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/que-es-localhost","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/que-es-localhost","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/que-es-localhost","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/o-que-e-localhost","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/what-is-localhost","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/what-is-localhost","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/what-is-localhost","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/what-is-localhost","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/13741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/comments?post=13741"}],"version-history":[{"count":23,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/13741\/revisions"}],"predecessor-version":[{"id":94839,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/13741\/revisions\/94839"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media?parent=13741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/categories?post=13741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/tags?post=13741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}