Monday, September 17, 2012

How to Host a Web Site on laptop!

This article is a step-by-step guide to host a website or a web application on your laptop with Windows 7 operating system. Sorry I didn't have time to write for other operating systems.

You may read the article from the beginning to end or if you directly want to kick-start implementing the web server jump to Steps directly.

OS: Windows 7


In plain words, a website is a software that runs inside another software called web server. It is a two way communication system. We have web browser as client side software at our end to request web pages and a software called web server that runs at the server side to respond our requests. We know how to surf webpages with a web browser. In this article I have tried to explain how you can setup your own webserver in your laptop!


LAN is an acronym for Local Area Network and WAN is an acronym for Wide Area Network. To understand in simple way: LAN is a network you use inside your home, office, school, colleges etc. WAN is a very large network like the one your ISPs (Internet Service Provider) have to provide you internet connections.

Wireless LAN

Wireless LAN allows you to access your LAN without wires. It requires a wireless adapter in your laptop or any device from which you want to access the network (Most laptops come with built-in wireless adapters) Wireless LAN could be established with a simple wireless router. You can buy one for Rs.1000 ($20). Once you purchase one, you can call your ISP provider to setup it for you. If you need a guide for setting up wireless LAN post a request on the comment space. I'll try to write one if there are more requests.

Intranet and Internet

There are two types of common classifications in website. Intranet, which are used by people inside a company or any group. Internet, is all known public website which is accessible to all public audience. 

Intranet are mostly hosted inside the company to provide fast access to its employees and to ensure security from threats of public internet.

IP Address

IP address are numerical address to access any network device like computers, printers, etc. Though there are many technicalities, I'll keep it simple. is a fixed IP address to access local computers  (It is called as local loop). In other words, you can type in the web browser in your machine to access the web server hosted in your machine. It is scoped only to the local computer itself. This is useful for testing your website hosted inside your computer during development etc,.

The IP addresses ranging -, - and - are local network IP addresses. That is, you could use it to access network resources inside your LAN. Assigning IP address to devices is out of scope of this article. If you need help, you can post your requests on the comment section.

Web Server

As a first step, you need to install a software (web server) to respond to web requests sent from other computers. You can understand the webserver in simple way: it is a software at your end that responds to requests made by software at other end. Here, Internet Information Services (IIS) is the server software and Web Browsers are the are client software on other computers.


Following are the steps:
  1. Install IIS as Web Server
  2. Create a Website / Web Application or Download Sample
  3. Host Website to the IIS Root Directory
  4. Configure IP Address for Your Machine
  5. Test the Website

1. Install IIS as Web Server

Note: You must be a member of the Administrators group (Windows Admin user) to install IIS. 

By default, IIS is not installed on Windows® 7. You can install IIS by clicking Windows Features in Advanced Options under Programs in Control Panel.

Click Start and then click Control Panel.

In Control Panel, click Programs and then click Turn Windows features on or off.

In the Windows Features dialog box, check Internet Information Services and then click OK.

2. Create a Website / Web Application or Download Sample

You may create your own website or download the sample from the following URL

Download the sample web application - FileBox, from the below url.   FileBox is a single page simple web application written on ASP.NET C# to upload photos. You may write your own applications or static HTML web pages as well.

3. Host Website to the IIS Root Directory

Open the following folder location and delete all files and folders inside.

Unzip all the files and folders in FileBox to the IIS root folder.

4. Configure IP Address for Your Machine

Now you need to assign an IP address to your machine, if it doesn't exists already.

First, let's check whether you are connected to the LAN network. You may check that in various ways. But the simple way is to ping your switch or router IP address. Usually, but not necessarily, it would be To ping and test open the start menu and type ping -t (replace the ip with your switch or router ip). You must be able to get response as follow:

If you get any other response then something is wrong with your network. You need to fix that first!
Note: Numerical values of bytes, time, TTL will change for every computer and networks

If the network is working well, check whether you have an IP address assigned. In the command prompt, type ipconfig -all and press enter. You will see information about the network ip addresses configured to your machine as below.

IPv4 Address is your local machine IP address. If you don't see screen like this, IP is not configured for your machine. You need to configure it manually by following steps below.

Assign IP Address Manually

Step 1: Go to Start menu and search for View Network Connections
or navigate to Control Panel\Network and Internet\Network and Sharing Center

Step 2: Click on Local Area Connection or Wireless Network

Step 3: Click Properties

Step 4: Select Internet Protocol Version 4 (TCP/IPv4) and Click Properties

Step 5: Select User Configured and enter your desired local IP address within the LAN IP range and click Ok to save and close all open windows.

Example / Typical Configuration:

IP Address:
Subnet Mask:
Default Gateway:

Preferred DNS:
Secondary DNS:

5. Test the Website

Test on Local Machine

First, let us test the website from the local machine. Open your webbrowser and navigate to http://localhost/ or You must be able to see the   FileBox homepage.

Test from a Remote Machine

You need another computer or a mobile phone or a tablet connected to the same LAN network to test our webpage. To test the page, open a web browser and navigate to http://<your machine ip address> (eg: You must be able to see the   FileBox homepage.

If it fails, you need to go through the steps 1 through 3 again or if you are not able to solve, post your problem in the comment section below to seek solution from me and peer readers.

Hint: If you buy a static IP from your ISP vendor and configure it you can access this website from internet. A static IP would typically cost you Rs.2000 ($40 approx) per year. Also note, this could be useful only for your personal use.

Hope this article would be useful to you. Please share your comments below.


  1. The server requires a username and password the server says: P-660R-T1.

    Username :

    i am geting pupup widow and above massage please replay what to do. my email id is

    1. Hi Bhushan

      This could be because of lack of IIS User permission to access the physical folder.

      Let me know if the following solution works for you.

      Go to IIS, select the website. On the right-side panel you can see "Basic Settings..." Select it. On the pop-up, click "Connect as" button. You will get another pop-up. Select "Specific user" and enter your windows username and password.

      Note: It is better to create a new username and password for testing. You can give administrative permission to the user for testing. Also note that password is must for this account.

      To create new user account go to Control Panel.
      Note: you cannot set password when you create a new account. You need to edit the created account to set password.


Share your comments