IIS (Internet Information Services) · Getting Started

Installing IIS

IIS is not installed by default. You enable it as a Windows feature and pick only the role services your apps need.

Beginner 5 min Lesson 2 of 33Covers IIS 10 on Windows Server 2019/2022/2025 and Windows 10/11.
Before you start:Introduction to IIS
0/33 in IIS
On this page · 5 min · Beginner

In simple words#

Installing IIS is like opening a shop and choosing which counters to set up. You only add the counters (role services) you will actually use — fewer counters, fewer doors to guard.

Role service
An optional IIS feature, e.g. Windows Authentication.
Server Manager
GUI for adding roles on Windows Server.
Install-WindowsFeature
PowerShell command to install IIS on Server.

Learning objectives#

  • Install IIS on Windows 10/11
  • Install IIS on Windows Server with PowerShell
  • Choose role services
  • Verify the installation

Explanation#

Windows 10/11: Control Panel → Programs → Turn Windows features on or off → Internet Information Services.

Windows Server: Server Manager → Add Roles and Features → Web Server (IIS), or one PowerShell command.

Install only what you need: Static Content, Default Document, HTTP Errors, HTTP Logging, Request Filtering, Static Compression and the Management Console. Add Windows Authentication, URL Authorization or IP restrictions when required.

After installing IIS, install the .NET Hosting Bundle for ASP.NET Core and the URL Rewrite module if you need rewrite rules.

Code example: Install IIS on Windows Server#

PowerShellinstall-iis.ps1 Illustrative
# Windows Server
Install-WindowsFeature -Name Web-Server, Web-Mgmt-Console, Web-Http-Logging, Web-Request-Monitor, `
  Web-Http-Tracing, Web-Stat-Compression, Web-Dyn-Compression, Web-Windows-Auth, Web-IP-Security, Web-Url-Auth


# Windows 10/11 (run as Administrator)
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-ManagementConsole, IIS-HttpLogging -All


# Verify
Get-WindowsFeature Web-* | Where-Object Installed | Select-Object Name, DisplayName
Invoke-WebRequest http://localhost -UseBasicParsing | Select-Object StatusCode
Expected output
Name                 DisplayName
----                 -----------
Web-Server           Web Server (IIS)
Web-Mgmt-Console     IIS Management Console
...
StatusCode
----------
       200

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. Install-WindowsFeature adds IIS and selected role services on Windows Server.
  2. The backtick continues the command on the next line.
  3. Enable-WindowsOptionalFeature does the same on Windows 10/11.
  4. Requesting http://localhost returns the IIS welcome page (200).

Real-world use case#

An operations team keeps this script in Git so every new web server gets exactly the same IIS features.

Common mistakes#

Installing every role service

Unused features (WebDAV, CGI, FTP) add attack surface. Install only what apps need.

Installing the Hosting Bundle before IIS

The ASP.NET Core Module registers with IIS only if IIS exists. Reinstall the bundle after IIS if needed.

Best practices#

  • Script the installation
  • Minimal role services
  • Install the Hosting Bundle after IIS
  • Restart or run iisreset after installing modules

Remember this#

Server: Install-WindowsFeature Web-Server.

Windows 10/11: Windows features → IIS.

Only the role services you need.

Practice exercise#

Your task: Add Windows Authentication to an existing IIS installation on Windows Server.

Show solution
PowerShell Illustrative
Install-WindowsFeature Web-Windows-Auth

Mini quiz#

Installing IIS quizMultiple choice Question 1 of 1

Which PowerShell cmdlet installs IIS on Windows Server?

Score so far: 0/0

Want more? Practise all IIS MCQs · IIS interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.