EN

Windows Server

Host a website with IIS and Let's Encrypt

Install IIS on Windows Server, publish a website and enable HTTPS with a free Let's Encrypt certificate, renewed automatically with simple-acme.

7 min read, updated on 18 November 2026

On this page

Your values

Enter them once and the commands in this guide update.

This guide takes you from installing IIS (Internet Information Services) to an HTTPS website whose certificate renews itself. The certificates are issued by Let's Encrypt and managed by simple-acme, an ACME client for Windows.

Prerequisites

  • A server running Windows Server 2019, 2022 or 2025, with an administrator account
  • A domain name whose records point to the server. The Point to an IP guide explains how to create the A record
  • Port TCP 80 reachable from the Internet: Let's Encrypt sends its HTTP validation there
  • Port TCP 443 reachable to serve the website over HTTPS

Run the commands in Windows PowerShell as administrator. In the examples, replace your-domain.com with your domain.

Step 1: Install IIS

Using the graphical interface:

  1. Open Server Manager.
  2. Choose Manage, then Add Roles and Features.
  3. Select a role-based installation, then your server.
  4. Check Web Server (IIS), accept the management tools, then finish the wizard.

Using PowerShell:

PowerShell
Install-WindowsFeature -Name Web-Server -IncludeManagementTools
Get-Service W3SVC

The W3SVC service should be in the Running state.

Step 2: Open the web ports

Add an explicit rule for HTTP and HTTPS:

PowerShell
New-NetFirewallRule -DisplayName 'Web-HTTP-HTTPS-In' -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action Allow

This rule adds an authorization and does not change your RDP access. To use the graphical interface instead, follow the Firewall configuration guide with ports 80, 443.

Step 3: Create the website

Create the folder, a test page, the application pool and the website:

PowerShell
Import-Module WebAdministration

$site = 'my-site'
$root = "C:\inetpub\$site"

New-Item -ItemType Directory -Force -Path $root | Out-Null
Set-Content -Path "$root\index.html" -Value '<!doctype html><title>IIS</title><h1>IIS OK</h1>' -Encoding UTF8

New-WebAppPool -Name $site
New-Website -Name $site -PhysicalPath $root -ApplicationPool $site -Port 80 -HostHeader 'your-domain.com'
New-WebBinding -Name $site -Protocol http -Port 80 -HostHeader 'www.your-domain.com'

# Read access for the application pool identity
icacls $root /grant "IIS AppPool\${site}:(OI)(CI)RX"

To get the same result in Internet Information Services (IIS) Manager (inetmgr):

  1. Right-click Sites, then choose Add Website.
  2. Enter the name, the physical path and the host name your-domain.com, on port 80.
  3. Select the website, open Bindings and add www.your-domain.com.

If your application needs to write to a folder, for example for uploaded files, give it modify rights on that folder only.

Check the website over HTTP

Before requesting a certificate, open http://your-domain.com from your computer. The IIS OK page should appear. You can also run this test from a Windows computer:

PowerShell
Test-NetConnection your-domain.com -Port 80
Invoke-WebRequest -UseBasicParsing http://your-domain.com | Select-Object StatusCode

Step 4: Install simple-acme

Download the win-x64.trimmed build from simple-acme.com or the project's releases page, then extract it to a permanent folder. This folder must stay in place, because the scheduled renewal task uses it.

PowerShell
$version = '2.4.1.2444'
$tag = 'v2.4.1'
$zip = "$env:TEMP\simple-acme.zip"

Invoke-WebRequest -UseBasicParsing -OutFile $zip -Uri "https://github.com/simple-acme/simple-acme/releases/download/$tag/simple-acme.v$version.win-x64.trimmed.zip"
Expand-Archive -Path $zip -DestinationPath 'C:\Program Files\simple-acme' -Force
Remove-Item $zip

These numbers correspond to version 2.4.1. Check the releases page for a newer version, and adjust $version and $tag accordingly.

Step 5: Get the certificate

Using the menu

  1. Start the program:
PowerShell
cd 'C:\Program Files\simple-acme'
.\wacs.exe
  1. Choose N to create a certificate with the default settings.
  2. Select your website, then the your-domain.com and www.your-domain.com bindings.
  3. Accept the terms of service and enter an email address if you wish.

The program validates the domain, places the certificate in the Windows store, creates the HTTPS bindings and sets up renewal.

With a single command

PowerShell
cd 'C:\Program Files\simple-acme'
$id = (Get-Website -Name 'my-site').id
.\wacs.exe --source iis --siteid $id --host 'your-domain.com,www.your-domain.com' --installation iis --accepttos --emailaddress 'contact@your-domain.com'

Then open https://your-domain.com. The browser should show a secure connection, with no warning.

Step 6: Redirect HTTP to HTTPS

IIS 10 version 1709 and later, so Windows Server 2019 and newer, natively support redirection and HSTS, with no additional module:

PowerShell
Import-Module IISAdministration
Reset-IISServerManager -Confirm:$false
Start-IISCommitDelay

$sites = Get-IISConfigSection -SectionPath 'system.applicationHost/sites' | Get-IISConfigCollection
$siteElement = Get-IISConfigCollectionElement -ConfigCollection $sites -ConfigAttribute @{ name = 'my-site' }
$hsts = Get-IISConfigElement -ConfigElement $siteElement -ChildElementName 'hsts'
Set-IISConfigAttributeValue -ConfigElement $hsts -AttributeName 'enabled' -AttributeValue $true
Set-IISConfigAttributeValue -ConfigElement $hsts -AttributeName 'max-age' -AttributeValue 86400
Set-IISConfigAttributeValue -ConfigElement $hsts -AttributeName 'redirectHttpToHttps' -AttributeValue $true

Stop-IISCommitDelay

Keep port 80 open: it is used for the redirection and for Let's Encrypt renewals.

Step 7: Check automatic renewal

simple-acme creates a daily scheduled task that runs under the SYSTEM account. It only renews certificates that are due and takes into account the renewal information provided by Let's Encrypt (ARI).

PowerShell
Get-ScheduledTask -TaskName 'simple-acme*' | Select-Object TaskName, State
Get-ScheduledTask -TaskName 'simple-acme*' | Get-ScheduledTaskInfo | Select-Object LastRunTime, LastTaskResult, NextRunTime

cd 'C:\Program Files\simple-acme'
.\wacs.exe --list

To test the whole chain once, force a renewal:

PowerShell
.\wacs.exe --renew --force --verbose

Do not count on an email alert: Let's Encrypt stopped sending its expiration reminders on June 4, 2025. Instead, monitor the expiration date with your monitoring tool, or check the logs:

PowerShell
Get-ChildItem "$env:ProgramData\simple-acme\*\Log" | Sort-Object LastWriteTime -Descending | Select-Object -First 3 FullName, LastWriteTime

Automation is becoming essential: Let's Encrypt plans to reduce the default lifetime of its certificates from 90 to 64 days on February 10, 2027, then to 45 days on February 16, 2028.

Check the result

  • https://your-domain.com and https://www.your-domain.com open with no warning.
  • http://your-domain.com redirects to HTTPS.
  • The simple-acme task exists and LastTaskResult is 0 after its first run.
  • The certificate presented is the right one:
PowerShell
Get-WebBinding -Name 'my-site' | Select-Object protocol, bindingInformation, sslFlags
Get-ChildItem Cert:\LocalMachine\WebHosting | Select-Object Subject, NotAfter, Thumbprint

Troubleshooting

Validation fails (Authorization failed, Timeout, Connection refused)

  • Check that the A record, and the AAAA record if there is one, points to this server: Resolve-DnsName your-domain.com.
  • Test port 80 from outside and check the Web-HTTP-HTTPS-In rule.
  • Validation uses a listener shared with IIS. It cannot be allowed by a firewall rule limited to wacs.exe, because the traffic goes through System: open the port itself.
  • If the HTTPS redirection was just enabled, disable it temporarily to rule out this cause, then run the request again.

Wait a few minutes between attempts to avoid reaching the failure limit.

too many certificates or rateLimited

You have reached a Let's Encrypt limit. Wait until the date given in the message. Reinstalling the client or deleting its configuration makes no difference, because the limits are tied to the domain names and the account.

Port 80 is already in use

Identify the process:

PowerShell
Get-NetTCPConnection -LocalPort 80 -State Listen | ForEach-Object { Get-Process -Id $_.OwningProcess }
netsh http show servicestate

The System process is normal with IIS. Any other web server, such as Apache or nginx, must be stopped or moved.

The browser reports an incorrect certificate name

The requested name is not in the certificate, often because www was forgotten. Add the binding in IIS, then run wacs.exe again and select all the names.

HTTP error 403.14

The folder has no default document, such as index.html. Add this file or configure Default Document in inetmgr.

HTTP error 500.19

The website configuration is invalid or unreadable. Read the code displayed:

  • 0x8007000d: web.config is malformed, or it uses a module that is not installed, such as URL Rewrite
  • 0x80070021: a section is locked at the server level
  • 0x80070005: IIS cannot access the folder or file, check the permissions with icacls

HTTP error 503

The application pool has probably stopped. Restart it, then check the Application log in Event Viewer if it stops again:

PowerShell
Get-WebAppPoolState -Name 'my-site'
Start-WebAppPool -Name 'my-site'

The certificate does not renew

From C:\Program Files\simple-acme, run .\wacs.exe --renew --verbose, then read the logs. If the task has disappeared or reports an error, recreate it:

PowerShell
cd 'C:\Program Files\simple-acme'
.\wacs.exe --setuptaskscheduler