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.
- Intermediate
- Windows VPS
- 2 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:
Install-WindowsFeature -Name Web-Server -IncludeManagementToolsOn Windows 10/11 Pro:
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-ManagementConsole -AllOpen http://localhost in a browser on the server. The IIS welcome page means it works.
2. Create a folder for your site
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
- Press Windows + R, type
inetmgrand press Enter. - Expand the server, right-click Sites and choose Add Website.
- Site name:
example. Physical path:C:\inetpub\example. - Binding: type
http, port80, Host namewww.example.com(your domain). - Click OK. Add a second binding for
example.comwithout www if you use both.
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:
New-NetFirewallRule -DisplayName "Web HTTP/HTTPS" -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action AllowTroubleshooting
- 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.configthe server cannot read; for ASP.NET Core install the hosting bundle (guide).
Next steps
- Add HTTPS for free: Free SSL for IIS with win-acme.
- Need a database? Install SQL Server Express.
Was this guide helpful?
Still stuck?
Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.
Related guides
Windows VPS & RDP
RunRacks RDP port 12230: how to connect to your Windows VPS and Admin RDP
RunRacks Windows VPS and Admin RDP servers accept Remote Desktop on port 12230, not 3389. Here is how to connect from every device and keep the port open.
- Beginner
- Windows VPS · Admin RDP
- 5 min read
Windows VPS & RDP
Allow or block multiple RDP sessions for one user
Understand why a new Remote Desktop login takes over your old session, how the single-session policy works on Windows Server, and which setting suits a team.
- Advanced
- Windows VPS
- 5 min read
Windows VPS & RDP
Create Windows users with Remote Desktop access
Give each person their own Windows login, add them to Remote Desktop Users, test the account and remove access cleanly later.
- Beginner
- Windows VPS · Admin RDP
- 2 min read