IIS (Internet Information Services) is Microsoft’s web server, built into Windows Server. It’s the natural choice for ASP.NET and .NET applications, and it also runs PHP and static sites. This guide installs IIS and publishes a first website with a domain and HTTPS.

1. Install IIS

With PowerShell (fastest)

Open PowerShell as Administrator:

Install-WindowsFeature -Name Web-Server -IncludeManagementTools

Add common extras in the same way:

Install-WindowsFeature Web-Asp-Net45, Web-Http-Redirect, Web-Dyn-Compression, Web-WebSockets, Web-Http-Logging, Web-Request-Monitor

With Server Manager

Manage → Add Roles and Features → Role-based installation → select the server → tick Web Server (IIS) → accept the management tools → choose role services (defaults are fine to start) → Install.

2. Test

Open http://localhost on the server — you’ll see the IIS welcome page. From your computer, browse to http://YOUR_SERVER_IP. Installing IIS adds the “World Wide Web Services (HTTP Traffic-In)” firewall rule automatically.

3. Create a website

Put your files in a folder, e.g. C:\inetpub\sites\example.com, with an index.html to start.

IIS Manager (inetmgr) → right-click Sites → Add Website:

  • Site name: example.com
  • Physical path: C:\inetpub\sites\example.com
  • Binding: type http, IP All Unassigned, port 80, Host name example.com

Add a second binding for www.example.com (site → Bindings… → Add).

Or with PowerShell:

Import-Module WebAdministration
New-Item -ItemType Directory -Path C:\inetpub\sites\example.com
Set-Content C:\inetpub\sites\example.com\index.html '<h1>example.com on IIS</h1>'
New-WebAppPool -Name "example.com"
New-Website -Name "example.com" -PhysicalPath "C:\inetpub\sites\example.com" -HostHeader "example.com" -Port 80 -ApplicationPool "example.com"
New-WebBinding -Name "example.com" -HostHeader "www.example.com" -Port 80

Host-name bindings let many sites share one IP on port 80 — IIS picks the site by the requested domain. Remove or stop the Default Web Site once your own sites work, so unknown hostnames don’t land on it.

Point the domain’s DNS A record to the server’s IP and the site is live.

4. Application pools

Each site should run in its own application pool — a separate worker process (w3wp.exe) with its own identity. If one site crashes or leaks memory, the others aren’t affected. In IIS Manager → Application Pools you can set:

  • .NET CLR version — “No Managed Code” for ASP.NET Core, PHP and static sites.
  • Recycling — scheduled restarts; the default is every 1,740 minutes (29 hours). Many admins switch to a fixed off-peak time.
  • Idle timeout — the default stops the worker after 20 minutes without requests, causing a slow first request. Set to 0 for always-on apps.

5. File permissions

The app pool runs as the virtual account IIS AppPool\<pool name>. Grant it read access to the site folder (and write access only where the app must write, such as an uploads folder):

icacls "C:\inetpub\sites\example.com" /grant "IIS AppPool\example.com:(OI)(CI)RX"
icacls "C:\inetpub\sites\example.com\uploads" /grant "IIS AppPool\example.com:(OI)(CI)M"

6. HTTPS with a free certificate

IIS has no built-in Let’s Encrypt client. The popular free tool is win-acme (wacs.exe): download it from its official site, run it as Administrator, choose your IIS site, and it requests a certificate, adds the HTTPS binding and schedules renewal as a Windows task.

Then redirect HTTP to HTTPS with the URL Rewrite module (a free Microsoft download). See IIS SSL certificates for the full walkthrough.

Open port 443 if it isn’t already:

New-NetFirewallRule -DisplayName "HTTPS" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow

7. ASP.NET Core apps

Install the ASP.NET Core Hosting Bundle for your .NET version (from Microsoft’s .NET download page), then restart IIS (iisreset). Publish your app to a folder (dotnet publish -c Release), point a site at it, and use an app pool with “No Managed Code”. The bundle’s ASP.NET Core Module runs your app behind IIS. See hosting ASP.NET on IIS.

8. PHP on IIS

PHP runs on IIS via FastCGI. Install the CGI role service (Install-WindowsFeature Web-CGI), download the non-thread-safe PHP build for Windows, and map *.php to php-cgi.exe in Handler Mappings. See PHP on IIS. For PHP-heavy sites like WordPress, a Linux server with Nginx is generally simpler and faster.

Useful commands

iisreset                              # restart all IIS services
Get-Website                           # list sites
Start-Website "example.com"; Stop-Website "example.com"
Restart-WebAppPool "example.com"
Get-ChildItem C:\inetpub\logs\LogFiles   # logs, one folder per site ID

Troubleshooting

  • HTTP Error 500.19 — invalid web.config, or a module referenced in it isn’t installed (often URL Rewrite or the ASP.NET Core Module).
  • HTTP Error 403.14 Forbidden — no default document and directory browsing disabled; add index.html/default.aspx to Default Document.
  • HTTP Error 503 Service Unavailable — the application pool stopped; check Event Viewer → Windows Logs → Application, and the pool’s identity and permissions.
  • Site works locally, not remotely — firewall rule, host-name binding mismatch, or DNS not pointing to the server.

Running .NET or legacy ASP.NET applications? Our Windows VPS plans come with Windows Server ready for IIS, with full administrator access.

  • IIS
  • Windows Server
  • Web Server