This guide creates a local-only static test website on IIS using ` so it is available on the PC itself without opening a firewall port or exposing the site to your network. It applies to Windows 11 and Windows 10 version 22H2. Note that Microsoft support for Windows 10 ended on October 14, 2025; the IIS steps still work, but Windows 11 is the safer platform for ongoing development.

Prerequisites and compatibility​

  • An administrator account, or credentials that can approve UAC prompts.
  • A Windows installation that is not in S mode.
  • At least a few minutes for Windows to install the IIS feature.
  • A plain-text editor such as Notepad.
  • This procedure serves static files such as HTML, CSS, JavaScript, images, and JSON. It does not configure PHP, ASP.NET Framework, ASP.NET Core, databases, or HTTPS.
This guide intentionally uses:
  • Folder: C:\inetpub\LocalTestSite
  • IP address: 127.0.0.1
  • Port: 8080
Using the loopback address 127.0.0.1 keeps the website local to this computer. The existing Default Web Site can remain on port 80 without conflicting with this test site.

1. Enable IIS and its static-content tools​

  1. Open the Windows Features dialog.
    • Windows 11: Select Start > Settings > System > Optional features > More Windows features.
    • Windows 10: Select Start > Settings > Apps > Apps & features > Optional features > More Windows features.
    • Reliable path on either version: Open Start, type Windows features, and select Turn Windows features on or off.
  2. In Windows Features, select Internet Information Services.
  3. Expand Internet Information Services and confirm these components are selected:
    • Web Management Tools > IIS Management Console
    • World Wide Web Services > Common HTTP Features > Default Document
    • World Wide Web Services > Common HTTP Features > Static Content
    • World Wide Web Services > Common HTTP Features > HTTP Errors
    The normal IIS defaults usually include these options. Do not enable FTP, WebDAV Publishing, ASP, CGI, or additional application-development features unless your project specifically requires them.
  4. Select OK.
  5. Wait for Windows to apply the changes. Select Close when installation completes.
  6. If Windows requests a restart, save open work and restart the PC before continuing. A restart is not always required, but it can be required to complete Windows feature installation.
Expected result: IIS and IIS Manager are installed. Opening ` in a browser may show the IIS welcome page from the existing Default Web Site. That is normal and is not yet your test site.

2. Create the local website folder and test page​

  1. Open Windows Terminal (Admin):
    • Right-click Start.
    • Select Terminal (Admin) or Windows PowerShell (Admin).
    • Approve the UAC prompt.
  2. Run the following commands exactly:
    Code:
    $sitePath = "$env:SystemDrive\inetpub\LocalTestSite"
    
    New-Item -ItemType Directory -Path $sitePath -Force | Out-Null
    
    @'
    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>IIS Local Test Site</title>
    </head>
    <body>
      <h1>IIS local test site is working</h1>
      <p>This page is being served by IIS on this PC.</p>
    </body>
    </html>
    '@ | Set-Content -Path "$sitePath\index.html" -Encoding utf8
  3. Close Windows Terminal, or leave it open for verification later.
Expected result: The file C:\inetpub\LocalTestSite\index.html exists. The C:\inetpub location is preferable for this basic test because it normally inherits IIS-compatible read permissions.

3. Create an IIS site bound only to the local computer​

  1. Open Start, type IIS, and select Internet Information Services (IIS) Manager.
    If it does not appear, run this from the Run dialog or Windows Terminal:
    %windir%\System32\inetsrv\InetMgr.exe
  2. In the left Connections pane, expand the computer name.
  3. Right-click Sites and select Add Website.
  4. In the Add Website window, enter the following values:
    FieldValue
    Site nameLocalTest8080
    Application PoolLeave the automatically created selection unchanged
    Physical pathC:\inetpub\LocalTestSite
    Typehttp
    IP address127.0.0.1
    Port8080
    Host nameLeave blank
    Start Website immediatelySelected
  5. Select OK.
  6. In the Sites list, select LocalTest8080. Confirm that its state is Started.
Expected result: IIS has a separate website named LocalTest8080, using the content folder you created and listening only at 127.0.0.1:8080.

4. Verify that the site works​

  1. Open a browser on the same PC.
  2. Enter this exact address:
  3. Confirm that the page displays:
    IIS local test site is working
  4. Optionally, verify the HTTP response from an elevated or standard Windows Terminal window:
    curl.exe -I
    A working static site should return an HTTP success response, normally similar to:
    HTTP/1.1 200 OK
  5. To confirm IIS is listening on the intended loopback address and port, run:
    netstat -ano | findstr :8080
    Expected result: A listening entry for 127.0.0.1:8080 appears.

Troubleshooting​

` shows the IIS welcome page instead of the test page​

This is expected if the Default Web Site is still using port 80.
Use the exact test-site address:
The :8080 portion is required because your local test site was deliberately configured on port 8080.

The browser says the site cannot be reached or connection was refused​

First, confirm that the IIS site is started:
  1. Open IIS Manager.
  2. Select Sites > LocalTest8080.
  3. In the right Actions pane, select Start if it is available.
Then check the required services in an elevated Terminal:
Get-Service WAS,W3SVC
Both services should show a status of Running:
  • Windows Process Activation Service (WAS)
  • World Wide Web Publishing Service (W3SVC)
If either is stopped, start it:
Code:
Start-Service WAS
Start-Service W3SVC
If the service cannot start, restart Windows once and try again. If IIS was only partially installed, return to Turn Windows features on or off, clear Internet Information Services, restart if prompted, then enable it again.

IIS reports that another process is using port 8080​

A second site or application is already bound to the address and port combination.
  1. Check which process owns the port:
    netstat -ano | findstr :8080
  2. Note the PID in the final column.
  3. Identify the process:
    Get-Process -Id <PID>
  4. Do not terminate an unknown process merely to free the port. Instead, change the IIS site to another local port such as 8081:
    • In IIS Manager, select LocalTest8080.
    • In the Actions pane, select Bindings.
    • Select the http binding, then select Edit.
    • Change Port from 8080 to 8081.
    • Select OK, then Close.
    • Browse to `

The site returns HTTP 404 or displays an IIS error instead of index.html

Check the site path and file name:
  1. In IIS Manager, select LocalTest8080.
  2. Select Basic Settings in the Actions pane.
  3. Confirm Physical path is:
    C:\inetpub\LocalTestSite
  4. In File Explorer, confirm that this exact file exists:
    C:\inetpub\LocalTestSite\index.html
  5. If the file is named index.html.txt, enable View > Show > File name extensions in File Explorer, then rename it to index.html.
  6. Confirm that the Default Document IIS feature remains installed. If it was removed, re-enable it under:
    Code:
    Internet Information Services
    > World Wide Web Services
    > Common HTTP Features
    > Default Document

The site returns HTTP 403 Forbidden after moving content to another folder​

A folder outside C:\inetpub may not grant IIS read permission.
Warning: Changing NTFS permissions changes who can read files on the computer. Grant only read-and-execute access to the specific test folder; do not grant broad access to an entire drive or user-profile folder.
For example, if you deliberately moved the site to D:\Sites\LocalTestSite, run this from an elevated Terminal:
icacls "D:\Sites\LocalTestSite" /grant "IIS_IUSRS:(OI)(CI)RX"
Then recycle the site:
  1. In IIS Manager, select LocalTest8080.
  2. Select Stop.
  3. Select Start.
  4. Refresh the browser.
To remove the explicit permission granted above after testing, run:
icacls "D:\Sites\LocalTestSite" /remove:g IIS_IUSRS

The browser shows a proxy-related error, but curl.exe succeeds​

Some browser or corporate proxy configurations handle localhost differently. Use the numeric loopback address configured in this guide:
If a proxy is forced by organizational policy, request a proxy bypass for 127.0.0.1 and localhost rather than exposing the site through a network binding.

Rollback and removal​

To remove only this test site while leaving IIS installed:
  1. Open IIS Manager.
  2. Expand the computer name, then select Sites.
  3. Select LocalTest8080.
  4. Select Stop in the Actions pane.
  5. Select Remove.
  6. Confirm the removal.
Warning: Deleting the content folder permanently removes the test files. Verify that the folder contains only disposable test content before deleting it.
  1. Delete the test folder:
    Remove-Item "$env:SystemDrive\inetpub\LocalTestSite" -Recurse -Force
To remove IIS entirely, open Turn Windows features on or off, clear Internet Information Services, select OK, and restart if Windows requests it.

References​

  1. Official source: support.microsoft.com
  2. Official source: support.microsoft.com