Installing and Configuring IIS on Windows Server
Internet Information Services (IIS) is Microsoft’s integrated web server for Windows Server. It is used to host websites, deliver both static and dynamic content, and run applications like .NET and ASP.NET. IIS supports protocols such as HTTP, HTTPS, FTP, and WebDAV, and provides features including authentication, SSL, compression, and application deployment.
This guide explains how to install and configure IIS on Windows Server. You will learn how to create websites, manage authentication, deploy applications, and activate performance and security options like SMTP and HTTPS.
Install IIS
IIS is a built-in Windows Server role that can be enabled via Server Manager or PowerShell.
- Open Server Manager from the Start Menu.
- Click Manage > Add Roles and Features.
- Continue through the wizard until you reach Server Roles.
- Select Web Server (IIS).
- Finish the wizard and click Install.
After installation, you can open IIS Manager from the Tools menu in Server Manager.
To install IIS using PowerShell, run this command as Administrator:
Install-WindowsFeature -name Web-Server -IncludeManagementTools
This installs the IIS web server role along with the management tools.
Manage IIS Websites
IIS supports hosting multiple websites on a single server. Using IIS Manager, you can configure bindings, root directories, and hostnames.
- Open IIS Manager from the Start Menu.
- In the Connections pane, expand the server and select Sites.
- Right-click Sites, then select Add Website….
- Enter the details:
- Site name: Internal label (e.g., MySite)
- Application pool: Default, unless using a custom .NET version
- Physical path: Folder containing site files (e.g., C:\inetpub\wwwroot\mysite)
- Binding:
- Type: http or https
- IP address: All Unassigned or a dedicated IP
- Port: 80 (HTTP) or 443 (HTTPS)
- Host name: e.g., example.com
- Click OK to create the site.
The website will appear under Sites, where you can start, stop, or modify it at any time.
You can also create a website using PowerShell:
New-Item -Path "C:\inetpub\wwwroot\mysite" -ItemType Directory
New-WebSite -Name "MySite" -Port 80 -PhysicalPath "C:\inetpub\wwwroot\mysite" -HostHeader "example.com"
Adjust the site name, port, path, and host header according to your needs.
Start or Stop a Website
IIS provides control over each hosted website, allowing you to start, stop, or restart them individually without impacting others.
- Open IIS Manager.
- In the Connections pane, expand Sites and select your site.
- In the Actions pane, choose Start, Stop, or Restart.
PowerShell alternatives:
Start a site:
Start-WebSite -Name "MySite"
Stop a site:
Stop-WebSite -Name "MySite"
Restart a site:
Restart-WebItem 'IIS:\Sites\MySite'
Replace MySite with your site name.
Deploy Applications with Web Platform Installer
IIS supports installing popular applications like WordPress, Joomla, or Drupal through the Web Platform Installer (Web PI), which simplifies setup of web stacks and CMS systems.
- Open IIS Manager.
- In the Actions pane, select Deploy > Install Applications from Gallery.
- Search or browse for the desired application (e.g., WordPress).
- Click Add, then Install.
- Follow the prompts to complete setup.
Configure Authentication
IIS offers several authentication methods to regulate access. A common choice in internal or secure settings is Basic Authentication, which requires valid user credentials.
- Open IIS Manager and select your site.
- In Features View, double-click Authentication under the IIS section.
- Select Basic Authentication, then click Enable in the Actions pane.
- (Optional) Select Anonymous Authentication and click Disable to enforce login.
By default, Anonymous Authentication is enabled, allowing open access to all users.
Important: Basic Authentication transmits credentials in clear text unless combined with HTTPS. Always use SSL/TLS. You can further manage access with NTFS permissions or integrate with Active Directory accounts.
Enable SMTP for Outgoing Email
Many web applications such as WordPress, Joomla, or ASP.NET-based sites require outgoing email functionality for features like password resets, registration confirmations, and contact forms. Windows Server allows you to enable SMTP services to support these requirements.
Install the SMTP Server Feature
- Open Server Manager.
- Select Manage > Add Roles and Features.
- Navigate to the Features section.
- Check SMTP Server.
- Complete the wizard and restart if prompted.
This installs a simple SMTP relay on your server.
Configure SMTP Settings for Applications
After the SMTP feature is installed, configure your application’s mail settings. For ASP.NET applications:
- Open IIS Manager and select your application.
- Double-click SMTP E-mail in the ASP.NET section.
- Enter the following details:
- E-mail address: The sender address to appear in the From: header.
- Delivery method: Select Network.
- SMTP server: Specify your relay server (e.g., localhost, mail.example.com, or your company’s SMTP endpoint).
- Port: Common values are 25, 587, or 465, depending on your provider.
- Credentials: Configure if authentication is required.
- Click Apply to save changes.
Tip: For production workloads, it is best to use an external SMTP service such as SendGrid, Amazon SES, or your organization’s relay, rather than exposing the local server directly.
Enable Response Compression
IIS provides both static and dynamic content compression, which reduces the size of responses sent to clients. This optimization improves load times, reduces bandwidth consumption, and enhances performance for resources like HTML, CSS, JavaScript, and JSON.
Enable Compression in IIS Manager
- Launch IIS Manager.
- In the Connections pane, select either the server node (for global settings) or a specific site.
- In the Features View, double-click Compression.
- Check:
- Enable static content compression
- Enable dynamic content compression
- Click Apply in the Actions pane.
Note: Static compression stores compressed files on disk, while dynamic compression recompresses content on the fly, potentially increasing CPU usage. Evaluate both for your workload.
Use web.config for Site Settings
IIS relies on the web.config file for per-site configurations. Similar to Apache’s .htaccess, this file is XML-based and should be located in your site’s root directory (e.g., C:\inetpub\wwwroot\yoursite\web.config).
Common configurations include:
- URL rewriting
- Access restrictions
- Custom error pages
- MIME type definitions
Changes in web.config take effect immediately without requiring a server restart.
Secure a Site with SSL
Securing your website with HTTPS ensures data integrity and confidentiality. IIS allows you to bind an SSL certificate to your site for secure communication.
Import the SSL Certificate
- Open IIS Manager.
- In the Connections pane, select your server name (not the site).
- Double-click Server Certificates under the IIS section.
- In the Actions pane, click Import….
- Browse for your certificate file (commonly .pfx), enter the password if required, and complete the import process.
Bind the Site to HTTPS
- In IIS Manager, expand Sites and select your target website.
- Click Bindings… in the Actions pane.
- In the Site Bindings dialog, click Add….
- Set:
- Type: https
- IP address: Choose one or leave as All Unassigned
- Port: 443
- Hostname: e.g., yourdomain.com (optional)
- SSL certificate: Select the imported certificate
- Click OK, then Close.
Test by navigating to https://yourdomain.com
. A valid setup will display a secure padlock icon in the browser.
For automated SSL management, you can use free tools such as:
- Certify The Web: A GUI-based Let’s Encrypt client for Windows.
- win-acme: A command-line Let’s Encrypt client for Windows Server.
These utilities simplify certificate issuance and renewal, making them ideal for self-hosted or non-commercial websites.
Conclusion
In this tutorial, you installed and configured Internet Information Services (IIS) on Windows Server to host websites and applications. You enabled the IIS role, created and managed sites, deployed applications with Web Platform Installer, and configured services such as authentication, SMTP email, and compression. Additionally, you utilized web.config for granular site control and secured your application with SSL.
Whether hosting .NET applications, static files, or CMS platforms like WordPress, IIS provides a stable and adaptable platform. With these configurations in place, your Windows Server is now fully prepared for secure and efficient web hosting.