Windows VPS & RDP

Install IIS on Windows Server and host a website

Install IIS with PowerShell, create a site with its own application pool, bind a domain, add a free SSL certificate and set the right folder permissions.

IntermediateWindows VPS3 min read

IIS (Internet Information Services) is the web server built into Windows Server. It hosts static sites, ASP.NET and .NET apps, and PHP. This guide shows how to install IIS on Windows Server 2019, 2022 or 2025 and publish a site with HTTPS.

Before you start

  • RDP access as an administrator.
  • A domain whose A record points to the VPS IP.
  • Ports 80 and 443 allowed in Windows Defender Firewall (IIS adds these rules during install).

Install IIS

Open PowerShell as administrator:

Install-WindowsFeature -Name Web-Server -IncludeManagementTools

For ASP.NET apps, add:

Install-WindowsFeature Web-Asp-Net45, Web-Net-Ext45

For .NET (Core) apps, also install the ASP.NET Core Hosting Bundle from Microsoft. Browse to http://localhost on the server; the IIS welcome page confirms it works.

Create the site folder

New-Item -ItemType Directory -Path C:\Sites\example.com

Copy your site files there (via the RDP clipboard, a shared drive, FTP or Git).

Create an application pool and website

Each site should have its own application pool, so a crash in one site does not affect others:

Import-Module WebAdministration
New-WebAppPool -Name "example.com"
New-Website -Name "example.com" -PhysicalPath "C:\Sites\example.com" -ApplicationPool "example.com" -HostHeader "example.com" -Port 80

Add the www binding:

New-WebBinding -Name "example.com" -HostHeader "www.example.com" -Port 80

You can do the same in IIS Manager (inetmgr) → Sites → Add Website. For .NET Core apps set the pool's .NET CLR version to No Managed Code.

Set folder permissions

The application pool runs as a virtual account named IIS AppPool\example.com. Give it read access, and write access only to folders that need it (uploads, cache):

icacls "C:\Sites\example.com" /grant "IIS AppPool\example.com:(OI)(CI)RX"
icacls "C:\Sites\example.com\uploads" /grant "IIS AppPool\example.com:(OI)(CI)M"

Add free SSL with win-acme

  1. Download win-acme (a Let's Encrypt client for Windows) from its official site and extract it, e.g. to C:\Tools\win-acme.
  2. Run wacs.exe as administrator and choose N: Create certificate (default settings).
  3. Pick the IIS site; win-acme reads its bindings, validates the domain over HTTP, installs the certificate and adds an HTTPS binding.
  4. It also creates a scheduled task that renews the certificate automatically.

Redirect HTTP to HTTPS

Install the URL Rewrite module from Microsoft, then add to the site's web.config:

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="HTTPS" stopProcessing="true">
          <match url="(.*)" />
          <conditions><add input="{HTTPS}" pattern="off" /></conditions>
          <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Check that it works

  • Open https://example.com from your own computer; the padlock should show a valid certificate.
  • Logs are in C:\inetpub\logs\LogFiles\W3SVC<site id>.

Troubleshooting

  • HTTP Error 403.14 - Forbidden: no default document. Add index.html or configure Default Document.
  • HTTP Error 500.19: invalid web.config or a module it references (e.g. URL Rewrite) is not installed.
  • HTTP Error 500.30 / 502.5 (.NET Core): the app fails to start. Install the matching Hosting Bundle and check stdout logs.
  • 401.3 Unauthorized: the app pool identity lacks read permission on the folder.
  • Site not reachable from outside: check the bindings, DNS and firewall rules for ports 80/443.

IIS FAQ

Can IIS run PHP?

Yes, through FastCGI. Install PHP for Windows (non-thread-safe build) and register it as a handler, or use the PHP Manager for IIS.

IIS or Plesk on Windows?

Plain IIS is free and fine for a few sites you manage yourself. Plesk adds a control panel for many sites, email and customers.

Does IIS need a Windows licence?

IIS is included with every Windows Server licence; there is no extra cost.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.