Windows VPS & RDP

Install IIS and host a website on Windows Server

Install IIS, create a site with a host-name binding, point your domain's DNS at the server and allow HTTP and HTTPS through the firewall.

IntermediateWindows server2 min read

Internet Information Services (IIS) is the web server built into Windows. It hosts static sites, ASP.NET and ASP.NET Core apps, and PHP through FastCGI. This guide installs IIS, publishes a simple site and opens it to the internet.

1. Install IIS

Open PowerShell as Administrator.

On Windows Server 2019, 2022 or 2025:

PowerShell
Install-WindowsFeature -Name Web-Server -IncludeManagementTools

On Windows 10/11 Pro:

PowerShell
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-ManagementConsole -All

Open http://localhost in a browser on the server. The IIS welcome page means it works.

2. Create a folder for your site

PowerShell
New-Item -ItemType Directory -Path "C:\inetpub\example" -Force
Set-Content -Path "C:\inetpub\example\index.html" -Value "<h1>It works</h1>"

Copy your real site files into this folder later. Transfer files to a Windows server shows several ways.

3. Add the site in IIS Manager

  1. Press Windows + R, type inetmgr and press Enter.
  2. Expand the server, right-click Sites and choose Add Website.
  3. Site name: example. Physical path: C:\inetpub\example.
  4. Binding: type http, port 80, Host name www.example.com (your domain).
  5. Click OK. Add a second binding for example.com without www if you use both.

Note: The Default Web Site also listens on port 80 without a host name. That is fine: requests for your domain go to your site, and anything else lands on the default site. Stop the Default Web Site if you do not need it.

4. Point your domain at the server

At your domain's DNS provider, create an A record for example.com and www pointing to your server's IPv4 address. Changes can take from a few minutes to a few hours to spread.

5. Allow web traffic in the firewall

Installing IIS on Windows Server normally enables the HTTP rule for you. Make sure both HTTP and HTTPS are open:

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

Troubleshooting

  • 404 for your domain but the IP works: the host name in the binding does not match what you typed in the browser.
  • Site loads on the server but not from outside: check the firewall rule and that DNS points to the right IP (nslookup www.example.com).
  • HTTP Error 500.19: usually a web.config the server cannot read; for ASP.NET Core install the hosting bundle (guide).

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.