You decide which services we may enable for analytics, personalization, and external content.
We use cookies and similar technologies on our website to personalize content, embed external media, and better understand how individual areas are used.
Necessary cookies
These entries support essential functions such as security, stability, and form processing.
Optional sections
AnalyticsMarketingPersonalizationExternal media
Your data may be processed with your consent or on the basis of legitimate interests. In the cookie settings, you can reject or explicitly allow each optional category.
Some services process personal data in third countries. By consenting, you also agree to this transfer. You can find more information in our Privacy Policy.
You can reopen and change your selection at any time. · 1.0.2
Setting Up Node.js on a Windows Server – Launch Modern JavaScript Applications
Discover how to set up Node.js for scalable real-time applications in a streamlined environment → Learn more now
10 November 20263 min read0 Views0 helpful
Introduction
Node.js is a cross-platform, open-source JavaScript runtime environment that executes JavaScript code outside the browser, for example on servers or in command-line tools. Based on the V8 engine, it supports asynchronous, event-driven I/O, making it extremely efficient for building scalable network and real-time applications.
The “JavaScript everywhere” paradigm allows developers to use a single language both in the backend and frontend.
FAQ
Frequently asked questions
First, update your system and install Docker (using curl -fsSL https://get.docker.com -o get-docker.sh and sh get-docker.sh), since Node.js is provided and run via Docker containers.
Node.js is a cross-platform, open-source JavaScript runtime that runs JavaScript code outside the browser, based on the V8 engine with asynchronous, event-driven I/O.
Feedback
Was this article helpful?
Your feedback helps us prioritize and improve content.
0 of 0 Users found this article helpful.
Personal support
Need more help than the guide provides?
Our ZAP support team knows your product — briefly describe your issue and we'll help you personally.
Navigation
Software
Preparation
Before setting up Node.js, you should prepare your system. This includes updating your operating system to the latest version and installing all necessary dependencies. This preparation ensures a stable environment and helps avoid issues during or after installation.
Update System
To keep your system running with the latest software and security updates, always start by performing a system update. Run the following command:
Code
sudo apt update && sudo apt upgrade -y
This ensures your system has all current security patches and software versions before proceeding.
Install Dependencies
After the update is complete, you can proceed with installing dependencies. Node.js is provided and run on your system via various Docker containers. Docker must be installed first. Run the following commands:
Code
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
A detailed step-by-step guide for installing and using Docker is available in our Docker tutorial.
Installation
Now that all prerequisites are met and preparations are complete, you can start installing the Node.js application.
To use Node.js in an isolated environment, first download the official Alpine-based image. Use the following command to get the latest Node.js 22 image on your system, ready for container deployments:
Code
docker pull node:22-alpine
Then you can start a container based on this image and open a shell session inside it. Start the container with an interactive shell like this. The --rm option ensures the container is automatically removed when you exit, keeping your host clean.
Code
docker run -it --rm --entrypoint sh node:22-alpine
Inside the container, check the installed Node.js version with node -v, which should display v22.19.0. Check the npm version with npm -v, expected to be 10.9.3. This confirms the image contains the correct versions of Node.js and npm and is ready to use immediately.
Configuration
After starting the Node.js container, it is recommended to configure important Node.js settings directly in the environment. A common approach is defining environment variables, for example:
Code
export NODE_ENV=production
This activates production mode, enabling performance optimizations and adjusting logging. For development purposes, you can set NODE_ENV=development to get more detailed error messages and debugging features.
A well-structured project directory is important, starting with a configuration file you create with the following command:
Code
npm init -y
This generates a package.json file that defines dependencies, scripts, and metadata for your project. It is the central configuration file for every Node.js application.
Install dependencies with npm install <package>, while development dependencies are added with npm install <package> --save-dev. The scripts section in package.json allows you to define custom commands like npm start or npm run build to simplify execution and project management.
For advanced setups, you can customize Node.js with .npmrc or .nvmrc files to configure private registries, cache options, or a specific Node.js version. This ensures your application runs consistently across different environments.
Completion and Further Resources
Congratulations! You have now successfully installed and configured Node.js on your VPS/Dedicated Server. We also recommend checking out the following resources that can help you with server configuration: