Skip to main content

How to Host Your First Website on IIS in Windows Server 2022

After installing Internet Information Services (IIS) on Windows Server 2022, the next big step is hosting your first website. Whether you're deploying a static site, a .NET app, or an internal portal, IIS provides a powerful and flexible platform for web hosting.

This guide walks you through the full process of hosting your first website on IIS.

Step 1: Prepare Your Website Files

Create or copy your website files to a directory on the server. For example:

C:\inetpub\wwwroot\MyFirstSite

Make sure this folder contains an entry file like index.html, default.aspx, or home.html

indexhtml.PNG

Step 2: Create a New Website in IIS

  1. Open IIS Manager
    (Run inetmgr or open it via Server Manager > Tools > IIS Manager)
  2. In the Connections pane, expand the server node
  3. Right-click Sites > choose Add Website
  4. Fill in the website details:
    • Site Name: MyFirstSite
    • Physical Path: C:\inetpub\wwwroot\MyFirstSite
    • Binding: Keep http, set Port to 80, and add a host name (e.g., myfirstsite.local) if needed
  5. Click OK to create the site

    add.PNG

Step 3: Set NTFS Permissions (Optional but Recommended)

Ensure that IIS has read access to your website folder.

By default, IIS uses the IUSR or ApplicationPoolIdentity account:

  • Right-click your website folder > Properties > Security
  • Ensure these accounts have Read & Execute permissions
    rwe.PNG

Step 4: Set a Default Document (Optional)

If your site uses a specific file as the homepage (e.g., home.html instead of default.html):

  1. In IIS Manager, select your site
  2. Open Default Document
  3. Add or reorder the document names so your home page loads automatically

Step 5: Test the Website Locally

Open a browser on the server and go to:

http://localhost

or

http://localhost:80

You should see your custom website instead of the IIS default page.

If you set a host name, use it like:

http://myfirstsite.local

(You may need to add it to your hosts file for testing)

testwebpage.PNG


Step 6: Test Remotely (Optional)

If you want to access the site from another machine:

A. Open the Firewall Port

Run this PowerShell command to allow HTTP (port 80):

New-NetFirewallRule -DisplayName "IIS HTTP" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow

B. Use Server IP or DNS Name

From another device, open a browser and visit:

http://<ServerIPAddress>

If it loads, your IIS site is publicly accessible on your network.