How To Use Google Chrome As A Web Server

Full fledged web development environment like XAMPP or LAMP is great for testing and developing web apps.

However, for just running a basic web server without needing any specific environment directly in a browser, an extension like Web Server for Chrome developed by MIT is a very useful tool. It is an open source extension that is updated regularly.

This extension can be helpful for simple web server functions like just rendering basic web pages, sharing files locally or for minor HTML development work – all using just Google Chrome. Any other browser too can be used to fetch and display local content when this web server in Chrome is running.

Another place where this extension can be used is in Chromebook.

Using it is very simple too. First, add it to Chrome from here

installing Web Server for Chrome extension

Once installed, before running it, there are two main configuration tasks to be done :

Define a root folder : This is the root folder that will be accessible to web server (like public_html). That means all the files and sub folders inside it can be accessed by web server.

choosing a web root folder in Web Server for Chrome extension

To add one, click on CHOOSE FOLDER and point to the appropriate path.pointing to the web root folder in Web Server for Chrome extension

Define a web port : This is the port on which web server will listen. The default port for Web Server for Chrome extension is 8887.  It can be kept as it or be changed to something else if needed.

To do this, enter any other number in Port field. Then stop and restart the web server.

changing the default port number in Web Server for Chrome extension

The change should reflect in the accessible web server URL. It should now point towards the new port number.

web server urls for using Web Server for Chrome extension

To access the web folder that is set as root folder, simply open the web link as displayed in browser.

list of contents in web root folder


displaying html pages using Web Server for Chrome extension

It should display the contents of the folder and display the HTML pages if any.

If needed, it can be set to be accessible to local network (great for hosting files that other computers and devices can access) or even the Internet. These settings can be changed by enabling Accessible on local network and Also on Internet.

The start up behavior of web server too can be set to that during login or in background. To activate these settings, restart the web server.

changing settings in Web Server for Chrome extension

Overall, this is a great lightweight extension that can help in basic web development tasks or for sharing on local network/Internet.

Do try it out.

Comments are closed.