tocOn this page 9 sections
To host a site on IIS with your own domain, point the domain's A record at your VPS IP, create an IIS site with a host-header binding for that name on port 80, and then run win-acme to request a free Let's Encrypt certificate. win-acme validates the domain over HTTP, adds the HTTPS binding on port 443 and creates a scheduled task that renews the certificate before it expires.
Before you start
- A Windows Server VPS with an administrator account you can reach over RDP.
- A registered domain where you can edit DNS records.
- The VPS public IPv4 address (and IPv6, if your plan has one).
Step 1: Point the domain at the VPS
At your DNS provider, create an A record for the bare domain (@) with your VPS IPv4 address, and a second A record or a CNAME for www. Only add an AAAA record if IPv6 actually works on the server; Let's Encrypt prefers IPv6 when an AAAA record exists, and a broken IPv6 path is a common cause of failed validation.
Check propagation from PowerShell on the VPS:
Resolve-DnsName example.com -Type A
Resolve-DnsName www.example.com
Both names must return your VPS IP before you request a certificate.
Step 2: Install IIS
Open PowerShell as Administrator in your RDP session:
Install-WindowsFeature Web-Server -IncludeManagementTools
If you host ASP.NET applications, add Web-Asp-Net45 as well, or install the ASP.NET Core Hosting Bundle for .NET apps. Browse to http://localhost on the server to confirm the default IIS page loads.
Step 3: Create the site with host-header bindings
Give each site its own folder and application pool so one site cannot crash another:
New-Item -ItemType Directory -Path 'C:\inetpub\example.com'
Import-Module WebAdministration
New-WebAppPool -Name 'example.com'
Import-Module IISAdministration
New-IISSite -Name 'example.com' -PhysicalPath 'C:\inetpub\example.com' -BindingInformation '*:80:example.com'
New-IISSiteBinding -Name 'example.com' -BindingInformation '*:80:www.example.com' -Protocol http
Set-ItemProperty 'IIS:\Sites\example.com' -Name applicationPool -Value 'example.com'
The third part of the binding string is the host name. IIS uses it to route requests, which lets many domains share port 80 and one IP. Copy your site files into C:\inetpub\example.com, then grant the pool identity read access:
icacls 'C:\inetpub\example.com' /grant 'IIS AppPool\example.com:(OI)(CI)RX'
If the site writes uploads or logs into its own folder, grant Modify (M) on that subfolder only, not the whole site.
Step 4: Open ports 80 and 443
Installing IIS normally enables the built-in World Wide Web Services (HTTP Traffic-In) rule. Make sure both ports are allowed:
Get-NetFirewallRule -DisplayGroup 'World Wide Web Services (HTTP)' | Select DisplayName, Enabled
New-NetFirewallRule -DisplayName 'HTTPS-In' -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
Keep port 80 open after HTTPS works. Let's Encrypt's HTTP-01 challenge connects over port 80 at every renewal, so closing it breaks renewals months later. If your provider has a separate network firewall in front of the VPS, open both ports there too. Test from your own PC with Test-NetConnection example.com -Port 80.
Step 5: Request the certificate with win-acme
win-acme is a free, open-source ACME client built for IIS. Download the latest release zip from its official site or GitHub page, extract it to a permanent folder such as C:\Tools\win-acme (the renewal task points to this path, so do not run it from Downloads), and launch wacs.exe from an elevated prompt.
- Choose N: Create certificate (default settings).
- Pick your site from the list of IIS sites. win-acme reads the host names from its bindings.
- Select the host names to include (bare domain and
www) and confirm. - Enter a contact email for expiry notices and accept the Let's Encrypt terms.
win-acme places a validation file under the site's /.well-known/acme-challenge/ path, Let's Encrypt fetches it over port 80, and on success the certificate is stored in the local machine's WebHosting store and bound to port 443 with SNI enabled for each host name.
Confirm the result:
Get-ChildItem Cert:\LocalMachine\WebHosting | Select Subject, NotAfter
Get-IISSiteBinding -Name 'example.com'
Get-ScheduledTask -TaskName 'win-acme*'
Step 6: Redirect HTTP to HTTPS
Install Microsoft's URL Rewrite module for IIS, then add this rule inside <system.webServer> in the site's web.config:
<rewrite>
<rules>
<rule name="Force HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
<add input="{REQUEST_URI}" pattern="^/\.well-known/acme-challenge/" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
The second condition keeps the ACME challenge path reachable over plain HTTP, which avoids renewal problems.
Renewals and troubleshooting
- Test renewal now: run
wacs.exe --renew --forcefromC:\Tools\win-acmeinstead of waiting for the scheduled task. - Validation fails: check that DNS resolves to this server, port 80 is reachable from outside, no stale AAAA record exists, and no redirect blocks
/.well-known/. - Wrong certificate served: open the 443 binding in IIS Manager (Sites > your site > Bindings) and confirm Require Server Name Indication is ticked with the correct host name.
- Rate limits: repeated failed attempts can be temporarily blocked by Let's Encrypt; fix the cause before retrying.
Once the site is live, work through our Windows Server VPS hardening checklist, and see the Windows VPS for IIS and ASP.NET hosting guide for sizing and plan options.
FAQ
Can I host several domains with separate certificates on one IP?
Yes. Create one IIS site per domain with its own host-header bindings and run win-acme for each. SNI lets IIS present the right certificate for each name on the same IP and port 443.
Can I get a wildcard certificate this way?
Wildcards need DNS-01 validation instead of HTTP-01. win-acme supports DNS validation through plugins for several DNS providers, or a manual TXT record option that is not suitable for automatic renewal.
Do I need to keep RDP open to renew?
No. Renewal runs from a Windows scheduled task under the SYSTEM account, so it works whether or not anyone is signed in over RDP.
Run this on your own Windows VPS
Get a Windows VPS from WindowsVPS in about 60 seconds, with full Administrator access over RDP, NVMe storage and the Windows license included.
Written by the WindowsVPS Team
We run Windows Server VPS hosting and write these guides from the same setups our customers use: RDP, PowerShell, trading terminals and always-on bots. Questions about a guide? Contact us.