Host a Node.js /w Next.js Application
Last updated
Was this helpful?
Last updated
Was this helpful?
Running a Next.js app on a Windows Server with IIS (Internet Information Services) so it's publicly accessible requires a few steps, since IIS is not built to directly run Node.js apps. But you can do it by using a reverse proxy to forward IIS requests to your Next.js app running on a local port.
Go to and download the LTS version.
Install it and verify with:
Copy your app to the Windows Server.
Navigate to the app folder and run:
This starts your app, likely on http://localhost:3000
.
If needed, you can configure it to use a different port (e.g., 5000) by setting the PORT
environment variable:
To make the app accessible via IIS:
URL Rewrite Module
ARR
Open IIS Manager
Click on the server name (root node)
Open Application Request Routing Cache
On the right-hand side, click "Server Proxy Settings"
Check "Enable proxy" and click Apply
Point the site root to any folder (even if empty—it won’t serve files directly).
Assign a host name (e.g., myapp.mydomain.com
) or use a port binding.
Select the website in IIS
Open URL Rewrite
Click "Add Rules" → Choose "Reverse Proxy"
Set the destination as:
(or whatever port your Next.js app is running on)
IIS won’t run the Node app directly, so use one of these tools:
PM2 (recommended for production):
NSSM (Non-Sucking Service Manager) to run it as a Windows Service
Make sure your domain (e.g., myapp.mydomain.com
) points to your Windows server’s IP.
Open a browser and visit the domain — you should see your Next.js app!
Make sure ports 80/443 are open in the firewall.
You can also configure HTTPS using a certificate in IIS.