NodeJS on Windows User Guide
Overview
This guide covers the deployment and use of Node.js on Windows Server using cloudimg AMIs from the AWS Marketplace. Node.js is a JavaScript runtime built on Chrome's V8 engine, enabling server side JavaScript execution for building scalable network applications.
What's included in this AMI:
- Node.js v20.12.2 with npm package manager
- Node.js desktop shortcut for quick access to the REPL
- Command Prompt with Node.js in the system PATH
- Windows Server with Remote Desktop access
- 24/7 cloudimg support with guaranteed 24 hour response SLA
Prerequisites
Before launching this AMI, ensure you have:
- An active AWS account
- An active subscription to the NodeJS on Windows listing on AWS Marketplace
- An EC2 key pair for password decryption
- A Remote Desktop client application
Recommended Instance Type: t3.medium (2 vCPU, 4 GB RAM) or larger. The minimum requirements are 1 vCPU, 1 GB RAM, and 30 GB disk space.
Step 1: Launch the AMI
- Navigate to the AWS Marketplace and search for "NodeJS Windows cloudimg"
- Click Continue to Subscribe, accept the terms, then Continue to Configuration
- Select your preferred Region and Software Version
- Click Continue to Launch
- Choose Launch through EC2 for full control over instance configuration
- Select your instance type (
t3.mediumrecommended) - Configure storage: 30 GB gp3 minimum
- Configure your Security Group with the following inbound rules:
| Port | Protocol | Source | Purpose |
|---|---|---|---|
| 3389 | TCP | Your IP | Remote Desktop (RDP) access |
Note: Add additional port rules based on your application needs (for example, port 3000 for Express.js development servers).
- Select your EC2 key pair and launch the instance
Step 2: Retrieve the Windows Password
Wait for the EC2 instance to pass 2/2 status checks.
- Open the AWS Console and navigate to EC2 > Instances
- Select your instance
- Click Actions > Security > Get Windows password
- Click Browse and upload your EC2 key pair
.pemfile - Click Decrypt password
- Note the Username (
Administrator) and the decrypted Password
Important: It may take up to 15 minutes after launch before the Windows password is available.
Step 3: Connect via Remote Desktop
Open your Remote Desktop client:
On Windows:
1. Press Win + R, type mstsc, and press Enter
2. Enter the public IP address of your instance
3. Click Connect
On macOS: 1. Open Microsoft Remote Desktop 2. Click Add PC and enter the public IP address 3. Double click the connection to connect
When prompted:
- Username: Administrator
- Password: The decrypted value from Step 2
If a certificate warning appears, click Continue to proceed.
Step 4: Verify Node.js Installation
Once connected, open the Node.js desktop shortcut or Command Prompt and verify the installation:
node --version
Expected output:
v20.12.2
Check npm is available:
npm --version
Launch the Node.js REPL (interactive shell):
node
You will see the interactive prompt:
Welcome to Node.js v20.12.2.
Type ".help" for more information.
>
Type .exit or press Ctrl + C twice to exit the REPL.
Step 5: Create and Run a Node.js Application
Create a simple HTTP server:
-
Create a project directory:
cmd mkdir C:\Users\Administrator\Documents\my-app cd C:\Users\Administrator\Documents\my-app -
Create
server.js:cmd notepad server.js -
Enter the following code:
javascript const http = require('http'); const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello from Node.js on cloudimg AWS!\n'); }); server.listen(3000, () => { console.log('Server running at http://localhost:3000/'); }); -
Run the server:
cmd node server.js -
Open a browser and navigate to
http://localhost:3000
Using npm
Initialize a new project:
npm init -y
Install a package:
npm install express
Install packages globally:
npm install -g nodemon
Run a script defined in package.json:
npm start
Server Components
| Component | Version |
|---|---|
| Node.js | v20.12.2 |
| npm | Included with Node.js |
Filesystem Layout
| Drive | Description |
|---|---|
| C:\ | System drive with Windows and Node.js installation |
Key directories:
| Directory | Purpose |
|---|---|
| C:\Program Files\nodejs | Node.js installation |
| C:\Users\Administrator\AppData\Roaming\npm | Globally installed npm packages |
| C:\Users\Administrator\Documents | Default working directory |
Troubleshooting
Node command not found
- Open Command Prompt and type
node --version - Check that Node.js is in the system PATH:
echo %PATH% - Restart Command Prompt after any PATH changes
npm install fails
- Verify internet connectivity:
ping google.com - Check proxy settings if behind a firewall:
npm config list - Clear the npm cache:
npm cache clean --force - Check available disk space on C:\
Application cannot bind to port
- Verify no other process is using the port:
netstat -an | findstr <port> - Ensure your security group allows the port if accessing from outside
- Check Windows Firewall settings
Cannot connect via RDP
- Verify the instance has passed 2/2 status checks
- Check that your security group allows port 3389 from your IP
- Wait up to 15 minutes for the Windows password to be available
Security Recommendations
- Change the Administrator password after first login
- Restrict RDP access: Only allow port 3389 from your specific IP address
- Open only necessary ports: Only expose application ports that need external access
- Use environment variables for secrets: Never hardcode API keys or passwords in application code
- Keep Node.js updated: Check for security updates regularly
- Enable Windows Update: Keep the OS patched with the latest security updates
- Audit npm packages: Use
npm auditto check for known vulnerabilities in dependencies
Support
If you encounter any issues with this product, contact cloudimg support:
- Email: support@cloudimg.co.uk
- Website: www.cloudimg.co.uk
- Support hours: 24/7 with guaranteed 24 hour response SLA