Skip to content
HOSTIGAN
Windows Server

How to install and configure IIS on Windows Server

Install IIS on Windows Server 2022 or 2025, create a site with host-name bindings and its own application pool, add HTTPS and fix 403, 500.19 and 503 errors.

Intermediate 6 min read Updated November 24, 2026

IIS (Internet Information Services) is Microsoft's web server, and it comes free with Windows Server as an optional role. It is the obvious host for ASP.NET applications, internal tools and anything built around the Windows ecosystem, and it handles static sites and PHP perfectly well too. In this guide you will install IIS, create a site for your own domain with a dedicated application pool, point DNS at it, add HTTPS, and learn where to look when a page returns an error instead of content.

You should be able to log in over Remote Desktop as an administrator. Everything works the same on Windows Server 2022 and 2025.

How a request travels through IIS

Knowing the path a request takes makes troubleshooting much easier, because every error belongs to one of these layers:

  1. DNS turns example.com into your server's IP address.
  2. Windows Firewall lets TCP 80 and 443 through.
  3. HTTP.sys, the kernel-level listener, matches the request against the site bindings — protocol, IP, port and host name.
  4. The site maps the request to a physical folder, such as C:\inetpub\example.com.
  5. The application pool runs the worker process (w3wp.exe) that executes your code.

When something fails, work down this list instead of guessing.

Install IIS

With PowerShell

Install-WindowsFeature -Name Web-Server -IncludeManagementTools
Get-WindowsFeature -Name Web-* | Where-Object Installed | Format-Table Name, DisplayName

Add role services as your application needs them:

Install-WindowsFeature -Name Web-Asp-Net45
Install-WindowsFeature -Name Web-CGI
Install-WindowsFeature -Name Web-Http-Redirect

Web-Asp-Net45 adds ASP.NET for .NET Framework 4.x, Web-CGI adds FastCGI (used for PHP), and Web-Http-Redirect enables simple redirects.

With Server Manager

Open Server Manager → Manage → Add Roles and Features, choose Role-based installation, tick Web Server (IIS) and accept the management tools. Under Role Services → Application Development you can add ASP.NET and CGI. No restart is normally needed.

Test it: open Edge on the server and browse to http://localhost. The IIS welcome page means the role is running.

Create your site

The Default Web Site that IIS creates points to C:\inetpub\wwwroot and answers every request on port 80 that no other site claims. Leave it alone for now, but give each real site its own folder, application pool and bindings.

In PowerShell

Import-Module WebAdministration
New-Item -ItemType Directory -Path "C:\inetpub\example.com" -Force
Set-Content -Path "C:\inetpub\example.com\index.html" -Value "<h1>It works</h1>"
New-WebAppPool -Name "example.com"
New-Website -Name "example.com" -PhysicalPath "C:\inetpub\example.com" -ApplicationPool "example.com" -Port 80 -HostHeader "example.com"
New-WebBinding -Name "example.com" -Protocol http -Port 80 -HostHeader "www.example.com"
icacls "C:\inetpub\example.com" /grant "IIS AppPool\example.com:(OI)(CI)RX"
Get-WebBinding -Name "example.com"

The last icacls line gives the pool's built-in identity read and execute rights on the folder — enough for most sites. If the application writes files, such as uploads or a cache, grant modify rights only on that subfolder, never on the whole site.

In IIS Manager

Run inetmgr, right-click Sites → Add Website, enter the site name and physical path, and set the binding to http, All Unassigned, port 80, host name example.com. IIS creates an application pool with the same name automatically. Add a second binding for www.example.com under Bindings in the right-hand pane.

Tip: Once your own sites are running, stop the Default Web Site. Otherwise any request to your IP without a matching host name — including scanners — lands on the IIS welcome page.

Application pools

An application pool is a separate worker process. One pool per site means a crash, memory leak or runaway loop in one site doesn't take the others down with it.

SettingRecommendation
.NET CLR versionv4.0 for ASP.NET on .NET Framework; No Managed Code for ASP.NET Core, PHP and static sites
IdentityApplicationPoolIdentity (default) — change only if the app needs a specific account
RecyclingSchedule it for a quiet time of day instead of the default fixed interval
Rapid-Fail ProtectionKeep it on; if it trips, fix the underlying crash

Day-to-day commands:

Get-WebAppPoolState -Name "example.com"
Restart-WebAppPool -Name "example.com"
Start-WebAppPool -Name "example.com"

Running ASP.NET Core or PHP

ASP.NET Core / modern .NET. Install IIS first, then the .NET Hosting Bundle from Microsoft, which contains the runtime and the ASP.NET Core Module. Run iisreset afterwards, set the pool to No Managed Code, and publish your app into the site folder with dotnet publish.

PHP. Install the Web-CGI role service, download the Non Thread Safe x64 build of PHP from php.net, extract it to C:\PHP, and install the Visual C++ runtime it requires. In IIS Manager, open Handler Mappings → Add Module Mapping: request path *.php, module FastCgiModule, executable C:\PHP\php-cgi.exe. Finally add index.php under Default Document.

Point your domain at the server

Create two DNS records at your DNS provider, both pointing to the VPS's IPv4 address:

NameTypeValue
example.comAYOUR_SERVER_IP
wwwAYOUR_SERVER_IP

Add matching AAAA records if your server has IPv6. Step-by-step instructions are in pointing a domain to your server. To test before DNS has propagated, add the domain temporarily to the hosts file on your own computer.

Add HTTPS

IIS can use certificates but cannot request them. The common free route is Let's Encrypt with an ACME client; win-acme is a widely used open-source option for IIS.

  1. Make sure DNS already points to the server and port 80 is reachable — the validation happens over HTTP.
  2. Download win-acme from the project's official site and extract it to a permanent folder such as C:\Tools\win-acme.
  3. Run wacs.exe as administrator and choose to create a certificate for an IIS site, picking your site and both host names.
  4. Let it create the HTTPS binding on port 443 (with SNI) and the scheduled renewal task.
  5. Browse to https://example.com and check the certificate's expiry date.

Don't move or delete the win-acme folder later; the renewal task runs from it. To send all HTTP traffic to HTTPS, install Microsoft's URL Rewrite module before you add any <rewrite> rule to web.config — without the module, IIS returns error 500.19.

Open the firewall

Installing IIS normally creates and enables the World Wide Web Services rules for ports 80 and 443. Check before you add your own:

Get-NetFirewallRule -DisplayGroup "World Wide Web Services (HTTP)", "Secure World Wide Web Services (HTTPS)" |
    Format-Table DisplayName, Enabled, Profile
Test-NetConnection YOUR_SERVER_IP -Port 443

Only if no rule is active, create one:

New-NetFirewallRule -DisplayName "Web - HTTP/HTTPS" -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action Allow -Profile Any

See configuring Windows Firewall for scoping and logging.

Logs and common errors

Each site logs to C:\inetpub\logs\LogFiles\W3SVCn, where n is the site ID shown in IIS Manager. Look at the sc-status and sc-substatus columns. Requests rejected before reaching a site (for example because the pool is stopped) appear in C:\Windows\System32\LogFiles\HTTPERR, and application crashes in Event Viewer.

Get-ChildItem "C:\inetpub\logs\LogFiles\W3SVC2" | Sort-Object LastWriteTime | Select-Object -Last 1 | Get-Content -Tail 20
ErrorUsual causeFix
403.14 ForbiddenNo default document in the folderAdd index.html / default.aspx, or add your file under Default Document. Don't enable directory browsing
500.19web.config uses a module that isn't installed, or IIS can't read the fileInstall the module (URL Rewrite, Hosting Bundle) or fix permissions with icacls
503 Service UnavailableApplication pool stopped, often by Rapid-Fail ProtectionRead Event Viewer, fix the cause, Start-WebAppPool
400 Bad Request – Invalid HostnameNo binding for the host name requestedAdd the missing binding, often www

In short

Install Web-Server with Install-WindowsFeature, then give each domain its own folder, application pool and host-name bindings. Grant the pool identity read access, point A records at the server, add a Let's Encrypt certificate with an ACME client, and check that ports 80 and 443 are open. When something breaks, follow the request path and read the status code in the logs. Need other software alongside IIS? See installing software on Windows Server. Prefer Linux? Compare with Nginx on Ubuntu.

IIS on a Hostigan VPS

A Hostigan VPS gives you NVMe storage, IPv4 and IPv6 and full administrator access, so IIS runs exactly as described once Windows is installed from your own ISO and licence. Upstream DDoS filtering is always on for every plan; it handles traffic floods, while patching IIS and your application remains your responsibility.

Frequently asked questions

Yes. IIS is a built-in role of Windows Server and costs nothing extra beyond your Windows Server licence. You add it with Server Manager or Install-WindowsFeature.

Next in “Get started with Windows Server” · 8 of 8How to protect Windows Server against unauthorised access