IISWeb ServerWindows6 min read

Install IIS (web server)

Install IIS as a web server on Windows Server to host ASP.NET, PHP, and static sites.


Internet Information Services (IIS) is Microsoft's web server for hosting websites, web applications and APIs on Windows Server.

Step 1 — Install IIS via PowerShell

powershell
Install-WindowsFeature -Name Web-Server -IncludeManagementTools

This installs IIS with the management console.

Step 2 — Install additional features

powershell
# Common features for web hosting
Install-WindowsFeature Web-Asp-Net45, Web-Net-Ext45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Mgmt-Console, Web-Scripting-Tools, Web-Filtering, Web-Basic-Auth, Web-Windows-Auth, Web-Stat-Compression, Web-Dyn-Compression

Step 3 — Verify IIS is running

powershell
Get-Service W3SVC

Open a browser and navigate to http://YOUR_VPS_IP. You should see the IIS welcome page.

Step 4 — Create a new website

Create the site directory:

powershell
New-Item -Path "C:\inetpub\mysite" -ItemType Directory
Set-Content -Path "C:\inetpub\mysite\index.html" -Value "<h1>Site running on Baires Host</h1>"

Create the site in IIS:

powershell
New-IISSite -Name "MySite" -PhysicalPath "C:\inetpub\mysite" -BindingInformation "*:80:mydomain.com"

Step 5 — Manage IIS

Open IIS Manager:

powershell
inetmgr

Common PowerShell commands:

powershell
# List all sites
Get-IISSite

# Stop a site
Stop-IISSite -Name "MySite"

# Start a site
Start-IISSite -Name "MySite"

# Restart IIS
iisreset

Step 6 — Configure bindings

Add HTTPS binding (after installing SSL certificate):

powershell
New-IISSiteBinding -Name "MySite" -BindingInformation "*:443:mydomain.com" -Protocol https -CertificateThumbPrint "YOUR_CERT_THUMBPRINT" -CertStoreLocation "Cert:\LocalMachine\My"

Application Pool settings

powershell
# Create a new app pool
New-WebAppPool -Name "MySitePool"

# Set .NET CLR version
Set-ItemProperty "IIS:\AppPools\MySitePool" -Name "managedRuntimeVersion" -Value "v4.0"

# Assign to site
Set-ItemProperty "IIS:\Sites\MySite" -Name "applicationPool" -Value "MySitePool"

Tip

For production sites, always create a dedicated Application Pool per site. This isolates processes and prevents one site from affecting others on your Baires Host VPS.


Was this guide helpful?