Internet Information Services (IIS) is the web server built into Windows. It hosts static sites, ASP.NET and ASP.NET Core apps, and PHP through FastCGI. This guide installs IIS, publishes a simple site and opens it to the internet.
1. Install IIS
Open PowerShell as Administrator.
On Windows Server 2019, 2022 or 2025:
Install-WindowsFeature -Name Web-Server -IncludeManagementToolsOn Windows 10/11 Pro:
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-ManagementConsole -AllOpen http://localhost in a browser on the server. The IIS welcome page means it works.
2. Create a folder for your site
New-Item -ItemType Directory -Path "C:\inetpub\example" -Force
Set-Content -Path "C:\inetpub\example\index.html" -Value "<h1>It works</h1>"Copy your real site files into this folder later. Transfer files to a Windows server shows several ways.
3. Add the site in IIS Manager
- Press Windows + R, type
inetmgrand press Enter. - Expand the server, right-click Sites and choose Add Website.
- Site name:
example. Physical path:C:\inetpub\example. - Binding: type
http, port80, Host namewww.example.com(your domain). - Click OK. Add a second binding for
example.comwithout www if you use both.
Note: The Default Web Site also listens on port 80 without a host name. That is fine: requests for your domain go to your site, and anything else lands on the default site. Stop the Default Web Site if you do not need it.
4. Point your domain at the server
At your domain's DNS provider, create an A record for example.com and www pointing to your server's IPv4 address. Changes can take from a few minutes to a few hours to spread.
5. Allow web traffic in the firewall
Installing IIS on Windows Server normally enables the HTTP rule for you. Make sure both HTTP and HTTPS are open:
New-NetFirewallRule -DisplayName "Web HTTP/HTTPS" -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action AllowTroubleshooting
- 404 for your domain but the IP works: the host name in the binding does not match what you typed in the browser.
- Site loads on the server but not from outside: check the firewall rule and that DNS points to the right IP (
nslookup www.example.com). - HTTP Error 500.19: usually a
web.configthe server cannot read; for ASP.NET Core install the hosting bundle (guide).
Next steps
- Add HTTPS for free: Free SSL for IIS with win-acme.
- Need a database? Install SQL Server Express.
