How to Use IIS to Host a Website Locally on Windows

If you’re creating a website, you’ll probably want to test it before hosting it on the internet to ensure it works properly.

Ideally, you should test your site on the same web server that it will run on when you go live. This allows you to be sure that your site will behave in production the same way it behaves locally. Fortunately, most web servers are easy to install and use on your local computer.

4

On a Windows PC, you can use Internet Information Services (IIS). IIS comes free with Windows, so all you need to do is enable and configure it to view your website.

What Is Internet Information Services?

IIS is a web server that you can use to host static or dynamic websites. Aweb server works byserving content—such as HTML, JavaScript, or media files—to a user’s browser, in response to a request.

Some frameworks such as Angular already have basic built-in web servers. These will serve your website to preview and test locally, using the localhost domain. However, there are some scenarios where you need to set up a full-blown web server yourself.

MacBook and a Dell laptop running ZorinOS next to each other

One example of this is when publishing a scene from a Unity project. You are likely to get an error if you try to open the index.html file directly in your browser, without a web server running. In this case, you could store your Unity WebGL files in IIS, and run them on the server.

How to Enable IIS

Enable IIS using theTurn Windows Features On and Offmenu on Windows.

How to Create a Simple Test Website

Create a simple static website using HTML and CSS.

How to Add and Configure Your Website Using IIS

To host your website using IIS, create a new website and point it to your content.

How to Stop, Start or Restart Your Website on the Web Server

To start your web server and view your website, click on the Browse option in the right-hand menu. You can also restart or stop the web server at any time.

Hosting a Website Using IIS

Local testing is an important part of any development cycle, including when you’re building a website.

you’re able to host your website locally using the Internet Information Services (IIS) web server. You can use it to host any static website (such as a standard HTML or CSS site) or dynamic website (such as an ASP.NET site).

firefox logo with yellow warning symbol

There are various options you can choose from when hosting your website online. If you are hosting a simple website, you could store your website files on Dropbox, Google Drive, or One Drive, before hosting them.

If your website is simple, static, and just for fun, there’s another option: hosting on a free cloud storage service like Dropbox, OneDrive or Google Drive.

Dell monitor showing Windows 10 desktop

You’re conveying the wrong meaning when you send these emojis.

Now, I actually finish the books I start.

A laptop computer sitting in front of a window with code on the screen

You’ve been quoting these famous films wrong all along!

You can’t call this offline, Notion.

Taming data is easier than it looks.

Technology Explained

PC & Mobile