How to Install IIS Web Server with PowerShell
Applies to: Windows Server 2019, 2022 and 2025.
Internet Information Services hosts websites and applications through modular role services. Install only features required by the workload.
Web-server changes can expose data or interrupt production traffic. Use backups, least privilege and a staged validation path. Visit networkmanager.info for managed Windows VPS services.
Prerequisites
- Choose content and log volumes.
- Identify authentication and runtime requirements.
- Confirm firewall and DNS design.
- Take a baseline backup.
Procedure
Step 1: Inspect role state
Review Web-Server features.
Get-WindowsFeature Web-*Step 2: Install core IIS
Add management console.
Install-WindowsFeature Web-Server -IncludeManagementToolsStep 3: Inspect services
Confirm W3SVC and WAS.
Get-Service W3SVC,WASStep 4: Test local default site
Query loopback before opening external firewall.
Invoke-WebRequest http://localhost -UseBasicParsingStep 5: Harden modules
Remove sample content and unused role services.
Verification
Confirm role, services, bindings and HTTP response.
Get-WindowsFeature Web-Server
Get-Service W3SVC,WAS
Get-WebBinding
Invoke-WebRequest http://localhost -UseBasicParsingRollback
Migrate sites and preserve configuration before Uninstall-WindowsFeature Web-Server.
Security notes
Do not expose the default site publicly as proof of readiness; configure the production hostname, TLS and application first.
Official references
Explore Netcloud24 Canada.