Skip to content

Web development

Configure Node/Express js in windows server (IIS)

Step-by-step guide to hosting a Node/Express app on Windows Server: run it in the background with PM2, reverse proxy through IIS with URL Rewrite and ARR, and open port 80.

· Updated 2 min read

Below is a simple, clean, and production-ready guide to configure Express.js on a Windows Server.

Use this when hosting Node/Express apps on a Windows machine (local server or cloud VM).

Step 1. Install Node.js

Download and install LTS version:

https://nodejs.org

After install, verify:

node -v npm -v

Step 2. Set Up Your Express App

If you don’t already have an Express project:

mkdir myapp cd myapp npm init -y npm install express

Create index.js:

const express = require('express'); const app = express(); const PORT = 3000; app.get("/", (req, res) => { res.send("Server is running!"); });

app.listen(PORT, () => console.log(Server started on ${PORT}));

Run node index.js

Note : some projects may run node src/app.js depends on the arcitecture you have created

Step 3: Run Express App in Background Using PM2

npm install pm2 -g

Start app:

pm2 start index.js --name myapp / pm2 start src/app.js --name myapp

Enable auto-start on reboot:

pm2 startup pm2 save

Step 4:Prepare IIS to Reverse Proxy to Node

IIS will receive HTTP(S) traffic and forward to Node on port 3000.

Install URL Rewrite & ARR (one-time)

If not already installed, do these on the server (you may have done parts earlier):

  • Install URL Rewrite (rewrite_amd64.msi)
  • Install Application Request Routing (ARR) (requestRouter_amd64.msi)

Then in IIS Manager:

  • Click the server name (top left)
  • Open Application Request Routing Cache
  • Click Server Proxy Settings… (right side)
  • Tick Enable Proxy → Apply

Step 4:Create a Site in IIS for the APICreate the site

In IIS Manager:

  1. Right-click Sites → Add Website…
  2. Site name: MyApiSite (anything)
  3. Physical path: C:\apps\myapi
  4. Binding:
  • Type: http
  • IP: All Unassigned (or specific IP)
  • Port: 80
  • Host name: (e.g. api.yourdomain.com or leave empty for IP)

Click OK.

Add web.config to site root

Create C:\apps\myapi\web.config with:

<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="ReverseProxyInboundRule" stopProcessing="true"> <match url="(.*)" /> <action type="Rewrite" url="http://localhost:3000/{R:1}" logRewrittenUrl="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration>

Restart IIS

Now:

  • Make sure PM2 is running your app: pm2 list
  • Open browser from your PC (not just server):

If you used IP binding only:

http://SERVER_IP/api/healthhttp://SERVER_IP/api/hello

If you configured hostname (like api.yourdomain.com and DNS is pointing to server):

http://api.yourdomain.com/api/health

You should see the same JSON as when calling localhost:3000 before.

Step 5:Firewall Check (Important)

Make sure port 80 is open:

In Windows Firewall → Inbound Rules →

Allow World Wide Web Services (HTTP).

If you’re using a cloud VM (AWS/Azure/etc.), also open port 80 in the cloud security group / NSG.

This is all about configure Express.js on a Windows Server , if you want to confgure nextjs applications on linux platform please visit the here

Frequently asked questions

How do I keep an Express app running in the background on Windows Server?

Install PM2 globally with npm install pm2 -g and start the app with pm2 start index.js --name myapp. Run pm2 startup and pm2 save so it starts again after a reboot.

What does IIS need to reverse proxy requests to a Node.js app?

Install URL Rewrite and Application Request Routing (ARR), then tick Enable Proxy in Server Proxy Settings under Application Request Routing Cache. Add a web.config rewrite rule that forwards requests to http://localhost:3000.

Why can't I reach my Express app on IIS from another computer?

Port 80 may be closed. Allow World Wide Web Services (HTTP) in the Windows Firewall inbound rules, and on a cloud VM (AWS, Azure, etc.) also open port 80 in the security group or NSG.

  • #nodejs
  • #expressjs
  • #iis
  • #windows-server
  • #pm2
  • #reverse-proxy

Comments

  • Web development

    Advanced SEO, Content Marketing, and AI-Driven Content Generation to Improve Discoverability and Organic Traffic

    How Modern Search Strategies Help Brands Win Visibility in 2026 and Beyond Search engines are no longer simple keyword-matching machines. Today, Google and Bing evaluate context, intent, topical authority, and user experience before ranking content. As a result, businesses must move beyond basic…

    Read article

    Anat · 13 Jan 2026 · 3 min read

  • Web development

    Contentful + Shopify Integration: Automating Catalog Management for Multi-Channel Selling

    In today’s fast-paced eCommerce environment, managing product catalogs across multiple sales channels can be challenging. With customers shopping through websites, apps, marketplaces, and social media, keeping your product data consistent and updated everywhere is critical. That’s where Contentful…

    Read article

    Anat · 10 Nov 2025 · 5 min read

  • Web development

    Building a Headless Setup on Strapi + Next.js: Content Automations for Global Stores

    Why Global Stores Are Moving to Headless Commerce In today’s digital-first economy, flexibility and speed are everything. Global eCommerce brands are moving toward Headless CMS architectures to deliver content faster, personalize experiences, and integrate with diverse platforms seamlessly. A…

    Read article

    Anat · 23 Oct 2025 · 4 min read

  • Web development

    Dynamic Discount & Coupon Automations: Limiting Usage, Expiry, and Trigger-Based Offers

    Discounts and coupons continue to be among the best strategies for drawing in, converting, and keeping consumers in the cutthroat world of e-commerce today. However, because they are too generic, expire too soon, or are overused, traditional coupon programs frequently fail. This is where dynamic…

    Read article

    Anat · 22 Sept 2025 · 3 min read

  • Web development

    Automated Inventory Management: Syncing Stock Across Suppliers, Warehouses, and Sales Channels

    Introduction Managing inventory across numerous suppliers, warehouses, and sales channels is a frequent difficulty faced by organisations in today’s fast-paced retail and e-commerce environments. Operations can be rapidly disrupted by stockouts, overstocking, and poor visibility if the proper…

    Read article

    Anat · 19 Sept 2025 · 3 min read

  • Web development

    Abandoned Product Browsing: How to Retarget Shoppers with Personalized Recommendations

    Every eCommerce store owner knows the frustration: shoppers visit your website, view products, maybe even add items to their cart—then leave without buying. While cart abandonment often gets the spotlight, abandoned product browsing is just as critical. It shows intent, interest, and potential for…

    Read article

    Anat · 15 Sept 2025 · 3 min read

  • Web development

    Scaling Your Indian eCommerce Business with Shopify Plus: Advanced Features for Growth-Oriented Enterprises

    Introduction The Indian eCommerce market is booming. With millions of customers shopping online daily, enterprises need more than just a basic online store—they need scalability, performance, and flexibility. This is where Shopify Plus India steps in. For brands that are ready to expand beyond the…

    Read article

    Anat · 27 Aug 2025 · 3 min read

Have a project in mind?

Book a free intro call and let’s talk about your website or web app.