How to deploy node application in IIS | Deployment | IIS | Node JS | Tutorial 8

3 min read 3 hours ago
Published on Mar 18, 2026 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial provides step-by-step instructions on how to deploy a Node.js application on a Windows IIS (Internet Information Services) server. Deploying your application to IIS allows you to host web applications efficiently on Windows servers. This guide will walk you through the necessary steps, including prerequisites, configuration, and deployment processes.

Step 1: Install IIS and Required Components

Before deploying your Node.js application, ensure that IIS is installed on your Windows server along with the required components.

  1. Install IIS

    • Open the Control Panel.
    • Navigate to "Programs" > "Turn Windows features on or off."
    • Check the box for "Internet Information Services" and click "OK" to install.
  2. Install URL Rewrite Module

    • Download the URL Rewrite Module for IIS from the official Microsoft website.
    • Follow the installation instructions provided on the site.
  3. Install IISNode

    • Download the IISNode installer from the IISNode GitHub repository.
    • Run the installer to add IISNode to your IIS setup, which allows Node.js applications to run within IIS.

Step 2: Configure Your Node.js Application

To ensure your application runs smoothly under IIS, some configurations are necessary.

  1. Create a Web.config file

    • In the root directory of your Node.js application, create a Web.config file with the following content:
    <configuration>
        <system.webServer>
            <handlers>
                <add name="iisnode" path="app.js" verb="*" modules="iisnode"/>
            </handlers>
            <rewrite>
                <rules>
                    <rule name="NodeJs" stopProcessing="true">
                        <match url="^(.*)$" />
                        <action type="Rewrite" url="app.js" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    

    Replace app.js with the entry point of your application.

  2. Set Application Pool

    • Open IIS Manager.
    • Create a new Application Pool and set its .NET CLR version to "No Managed Code."
    • Assign your application to this Application Pool.

Step 3: Deploy Your Application to IIS

Now that you have configured IIS and your application, it's time to deploy it.

  1. Copy Application Files

    • Copy all your Node.js application files (including the Web.config file) to a directory on your server, such as C:\inetpub\wwwroot\YourApp.
  2. Create a Site in IIS

    • In IIS Manager, right-click on "Sites" and select "Add Website."
    • Enter the site name, select the physical path to your application folder, and configure the hostname and port as needed.
  3. Start the Website

    • After creating the site, ensure it is started in IIS Manager by right-clicking the site and selecting "Start."

Step 4: Test Your Application

To confirm that your Node.js application is running correctly on IIS, perform the following:

  1. Access the Application

    • Open a web browser and navigate to the URL configured for your site (e.g., http://localhost/YourApp).
  2. Check for Errors

    • If your application does not load as expected, check the Event Viewer for any error logs related to IIS or Node.js.

Conclusion

You have successfully deployed your Node.js application on a Windows IIS server. Key steps included installing IIS and the necessary components, configuring your application with a Web.config file, and creating a site in IIS. As a next step, consider monitoring your application’s performance and exploring scaling options for production use.