In this article I am going to teach you how to use the Google Chrome browser to test your localhost website page speedbefore uploading it online.

Usually, when developing a website, it is recommended to deploy it on a localhost environment and test it before making it go live. But the major problem with this is that you can not test your page speed, as Google Page Speed Insights can only test websites that are hosted online.

Is website page speed so important?

Website page speed is a major SEO ranking factor nowadays, so that’s why you need to optimize your website, and get the highest score possible. After completing the test you will get a score between 1 and 100. 1 is the lowest score possible, whilst 100 is the maxium and highest score that your website can achieve. Google uses Lighthouse to test the page speed and quality of your website.

What is Lighthouse?

Lighthouse is an open source tool that Google uses to help you improve the quality of web pages. You can run Lighthouse on any page you desire. After finishing the test it will generate a report which includes performance, accessibility, best practices and SEO. The one that we are going to focus today it’s performance.

How to use Lighthouse to test website speed on localhost?

Open Google Chrome browser and type in the address bar your localhost website address. For example: http://localhost/my-website.

Now press either F12 or CTRL+Shift+I. You will see a window popping up at the bottom of your browser. It should look something like this:

Locate the Audits option tab as seen on the screenshot bellow:

As you have probably noticed already, you can test your website page speed for both devices: desktop and mobile.

In the Audits option make sure you select Performance if you are looking to test your website speed. If you want to test something else, choose accordingly.

Another thing to mention, is that you can simulate a slower user connection by selecting first or second option from Throttling. If you don’t want to test with a slower connection, leave this option to No Throttling.

Also make sure you check the Clear Storage option, as it will reset your local storage before running the tests.

When you are done configuring with device, audits and throttling you can push the Run Audits button, and have a little patience. The test shouldn’t take longer than 30 seconds (on a slower computer), or 3-5 seconds(on a faster computer).

When finishing the Audits, you will get a result just like the one in the screenshot bellow:

Tip! You can test any page you want, not only the homepage. Just point your browser to the localhost URL you want to test, open Audits and hit Run Audits.

Wrapping it up!

As you can see it’s super easy to test your website page speed on localhost with the help of Lighthouse and Google Chrome browser. All you have to do is follow the described instructions, and you are all set.

Tip: If you get a poor score, Lighthouse will also inform you what can you do to enhance your website speed.

If this article was helpful, a share would be appreciated, so other people can learn this trick too.