Installing IIS
IIS is not installed by default. You enable it as a Windows feature and pick only the role services your apps need.
On this page · 5 min · Beginner
On this page
- In simple words
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Beginner
- Updated
- Oct 30, 2026
Related tutorials
Interview questions
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#
# 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
Name DisplayName
---- -----------
Web-Server Web Server (IIS)
Web-Mgmt-Console IIS Management Console
...
StatusCode
----------
200This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- Install-WindowsFeature adds IIS and selected role services on Windows Server.
- The backtick continues the command on the next line.
- Enable-WindowsOptionalFeature does the same on Windows 10/11.
- 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#
Unused features (WebDAV, CGI, FTP) add attack surface. Install only what apps need.
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
Install-WindowsFeature Web-Windows-Auth
Mini quiz#
Which PowerShell cmdlet installs IIS on Windows Server?
Want more? Practise all IIS MCQs · IIS interview questions
My notes#
Saved in this browser.