> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Install IIS on Windows Server (and Add a Website)

> Install IIS on Windows Server with Install-WindowsFeature Web-Server -IncludeManagementTools or Server Manager, open ports 80 and 443, and add a website.

To install IIS on Windows Server, open PowerShell as administrator and run `Install-WindowsFeature -Name Web-Server -IncludeManagementTools`, or add the **Web Server (IIS)** role in **Server Manager > Manage > Add Roles and Features**. IIS starts straight away and serves its default page from `C:\inetpub\wwwroot` on port 80. Allow ports 80 and 443 in Windows Firewall, then add your own site in IIS Manager (`inetmgr`).

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Beginner | 10 to 20 minutes | Windows Server 2019 / 2022 / 2025 | Administrator account, a domain name for a real site |

## Before you start

* Sign in as an administrator with [Remote Desktop](https://help.freakhosting.com/portals/other/how-to-connect-to-windows-server-with-remote-desktop.md).
* If you want to use a domain such as `example.com`, create an `A` record pointing to your server's IP (for example `203.0.113.10`) at your DNS provider now, so it has time to spread.
* IIS (Internet Information Services) is Microsoft's web server. It is a Windows role, so it comes with Windows Server and needs no separate download.

## How to install IIS with PowerShell

Open PowerShell as administrator: select **Start**, type `PowerShell`, right-click **Windows PowerShell** and choose **Run as administrator**.

**1. Install the Web Server role**

```powershell theme={null}
Install-WindowsFeature -Name Web-Server -IncludeManagementTools
```

`-IncludeManagementTools` adds IIS Manager. Without it you get the web server only ([Microsoft Learn](https://learn.microsoft.com/powershell/module/servermanager/install-windowsfeature)).

**2. Check the result**

The output shows `Success : True`. If `Restart Needed` is `Yes`, run `Restart-Computer`.

**3. Add extra role services (optional)**

List what's available, for example ASP.NET, CGI (for PHP) or FTP:

```powershell theme={null}
Get-WindowsFeature -Name Web-*
```

Install the ones you need by the value in their **Name** column, for example `Install-WindowsFeature -Name <Name>`.

## How to install IIS with Server Manager

**1. Open the wizard**

In **Server Manager**, select **Manage > Add Roles and Features**.

**2. Choose the installation type**

Select **Next**, choose **Role-based or feature-based installation**, select **Next**, and keep your server selected.

**3. Select Web Server (IIS)**

On **Server Roles**, tick **Web Server (IIS)**. Select **Add Features** when asked, then **Next**.

**4. Install**

Select **Next** through the pages to accept the default web server settings, then **Install**. When it finishes, select **Close** ([Microsoft Learn](https://learn.microsoft.com/en-us/windows-server/networking/core-network-guide/cncg/server-certs/install-the-web-server-web1)).

Details about every page of the wizard are in [install roles and features](https://help.freakhosting.com/portals/other/how-to-install-roles-and-features-on-windows-server.md).

## How to open the firewall for your website

Allow HTTP and HTTPS in Windows Defender Firewall. Adding these rules is safe even if setup already allowed port 80:

```powershell theme={null}
New-NetFirewallRule -DisplayName "Web HTTP (TCP 80)" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
New-NetFirewallRule -DisplayName "Web HTTPS (TCP 443)" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
```

If you filter traffic in the [Firewall panel](https://help.freakhosting.com/portals/firewall/firewall-panel-overview.md), allow TCP 80 and 443 there as well. More on rules in [open a port in Windows Firewall](https://help.freakhosting.com/portals/other/how-to-open-a-port-in-windows-firewall.md).

## How to check IIS works

On your own computer, browse to `http://203.0.113.10` (your server's IP). You should see the IIS default welcome page. On the server itself:

```powershell theme={null}
Invoke-WebRequest -UseBasicParsing -Uri http://localhost | Select-Object StatusCode
```

`StatusCode 200` means IIS is answering.

## How to add your own website

The default site lives in `C:\inetpub\wwwroot`. For a real site, create its own folder and site so you can add more sites later.

> [tab] IIS Manager
>
> **1. Create the folder**
>
> Create `C:\inetpub\example.com` and copy your site files (with an `index.html` or `default.htm`) into it.
>
> **2. Open IIS Manager**
>
> Select **Start**, type `inetmgr` and press **Enter**.
>
> **3. Add the site**
>
> In **Connections**, expand your server, right-click **Sites** and choose **Add Web Site** (shown as **Add Website** in some versions).
>
> **4. Fill in the details**
>
> **Site name**: `example.com`. **Physical path**: `C:\inetpub\example.com`. **Binding**: type `http`, IP address **All Unassigned**, port `80`, **Host name** `example.com`. Tick **Start Web site immediately** and select **OK** ([Microsoft Learn](https://learn.microsoft.com/en-us/iis/get-started/getting-started-with-iis/create-a-web-site)).
>
> **5. Add www (optional)**
>
> Select the site, choose **Bindings** in the right-hand **Actions** pane, then **Add** a second `http` binding with host name `www.example.com`.

> [tab] PowerShell
>
> ```powershell theme={null}
> New-Item -ItemType Directory -Path C:\inetpub\example.com
> Set-Content -Path C:\inetpub\example.com\index.html -Value "<h1>example.com works</h1>"
> New-IISSite -Name "example.com" -PhysicalPath "C:\inetpub\example.com" -BindingInformation "*:80:example.com"
> ```
>
> The binding format is `IP:port:hostname`; `*` means all IP addresses ([New-IISSite on Microsoft Learn](https://learn.microsoft.com/powershell/module/iisadministration/new-iissite)).

Browse to `http://example.com`. Because the binding has a host name, IIS serves this site for that name and the default site for anything else.

## Next step: HTTPS

Get a free Let's Encrypt certificate and HTTPS binding with win-acme: see [free SSL certificate on IIS with win-acme](https://help.freakhosting.com/portals/other/how-to-get-a-free-ssl-certificate-on-iis-with-win-acme.md).

## Frequently asked questions

### Can I run PHP on IIS?

Yes. Install the **CGI** role service (find its name with `Get-WindowsFeature -Name Web-*`) and then PHP for Windows. Follow PHP's own Windows installation guide for the version you need.

### Why do I see the IIS welcome page instead of my site?

You're browsing by IP address or the host name doesn't match your binding. Browse to the exact host name in the binding, check your DNS `A` record, and make sure your site is **Started** in IIS Manager.

### How do I stop or remove IIS?

To take one site offline, select it in IIS Manager and choose **Stop** in the **Actions** pane. To remove it, run `Uninstall-WindowsFeature -Name Web-Server -IncludeManagementTools` and restart. Removing IIS takes all sites on the server offline.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Free SSL on IIS with win-acme](https://help.freakhosting.com/portals/other/how-to-get-a-free-ssl-certificate-on-iis-with-win-acme.md)
>
> Add HTTPS to your site.

> [card] [Install roles and features](https://help.freakhosting.com/portals/other/how-to-install-roles-and-features-on-windows-server.md)
>
> The full wizard explained.

> [card] [Open a port in Windows Firewall](https://help.freakhosting.com/portals/other/how-to-open-a-port-in-windows-firewall.md)
>
> Inbound rules explained.

> [card] [Install SQL Server Express](https://help.freakhosting.com/portals/other/how-to-install-sql-server-express-on-windows-server.md)
>
> A database for your site.

***

> [!NOTE]
>
> **Checked against Microsoft Learn: [Install-WindowsFeature](https://learn.microsoft.com/powershell/module/servermanager/install-windowsfeature), [Install the Web Server](https://learn.microsoft.com/en-us/windows-server/networking/core-network-guide/cncg/server-certs/install-the-web-server-web1), [Create a Web Site](https://learn.microsoft.com/en-us/iis/get-started/getting-started-with-iis/create-a-web-site) and [New-IISSite](https://learn.microsoft.com/powershell/module/iisadministration/new-iissite)** on 4 November 2026. Not tested on a live Windows server for this page.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.