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.
Use the exact test-site address:
The
Both services should show a status of
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.
The site returns HTTP 404 or displays an IIS error instead of
Check the site path and file name:
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
Then recycle the site:
The browser shows a proxy-related error, but
Some browser or corporate proxy configurations handle
If a proxy is forced by organizational policy, request a proxy bypass for
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.
- Folder:
C:\inetpub\LocalTestSite - IP address:
127.0.0.1 - Port:
8080
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
- 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.
- In Windows Features, select Internet Information Services.
- 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
- Select OK.
- Wait for Windows to apply the changes. Select Close when installation completes.
- 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.
2. Create the local website folder and test page
- Open Windows Terminal (Admin):
- Right-click Start.
- Select Terminal (Admin) or Windows PowerShell (Admin).
- Approve the UAC prompt.
- 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 - Close Windows Terminal, or leave it open for verification later.
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
- 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 - In the left Connections pane, expand the computer name.
- Right-click Sites and select Add Website.
- In the Add Website window, enter the following values:
Field Value Site name LocalTest8080Application Pool Leave the automatically created selection unchanged Physical path C:\inetpub\LocalTestSiteType httpIP address 127.0.0.1Port 8080Host name Leave blank Start Website immediately Selected - Select OK.
- In the Sites list, select LocalTest8080. Confirm that its state is Started.
LocalTest8080, using the content folder you created and listening only at 127.0.0.1:8080.4. Verify that the site works
- Open a browser on the same PC.
- Enter this exact address:
- Confirm that the page displays:
IIS local test site is working - 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 - To confirm IIS is listening on the intended loopback address and port, run:
netstat -ano | findstr :8080
Expected result: A listening entry for127.0.0.1:8080appears.
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:- Open IIS Manager.
- Select Sites > LocalTest8080.
- In the right Actions pane, select Start if it is available.
Get-Service WAS,W3SVCBoth services should show a status of
Running:- Windows Process Activation Service (
WAS) - World Wide Web Publishing Service (
W3SVC)
Code:
Start-Service WAS
Start-Service W3SVC
IIS reports that another process is using port 8080
A second site or application is already bound to the address and port combination.- Check which process owns the port:
netstat -ano | findstr :8080 - Note the PID in the final column.
- Identify the process:
Get-Process -Id <PID> - 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
httpbinding, then select Edit. - Change Port from
8080to8081. - 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:- In IIS Manager, select LocalTest8080.
- Select Basic Settings in the Actions pane.
- Confirm Physical path is:
C:\inetpub\LocalTestSite - In File Explorer, confirm that this exact file exists:
C:\inetpub\LocalTestSite\index.html - If the file is named
index.html.txt, enable View > Show > File name extensions in File Explorer, then rename it toindex.html. - 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 outsideC:\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:
- In IIS Manager, select LocalTest8080.
- Select Stop.
- Select Start.
- Refresh the browser.
icacls "D:\Sites\LocalTestSite" /remove:g IIS_IUSRSThe 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:- Open IIS Manager.
- Expand the computer name, then select Sites.
- Select LocalTest8080.
- Select Stop in the Actions pane.
- Select Remove.
- Confirm the removal.
- Delete the test folder:
Remove-Item "$env:SystemDrive\inetpub\LocalTestSite" -Recurse -Force
References
- Official source: support.microsoft.com
Free up space for Windows updates | Microsoft Support
Learn how to free up space for Windows update including deleting nonessential files, using an external hard drive, and updating your hard drive.support.microsoft.com - Official source: support.microsoft.com
Media Feature Pack list for Windows N editions | Microsoft Support
Lists the Media Feature Pack releases for Windows N editions.
support.microsoft.com