Node.js 22 LTS — JavaScript runtime on Ubuntu 24.04 LTS. Express + EJS sample app, PM2 manager, nginx proxy, pnpm, per VM admin API key. MIT licensed.
## Node.js 22 LTS on Ubuntu 24.04 by cloudimg
Pre configured Node.js 22.22.2 (the current Active LTS line, codename Jod, supported through April 2027) on Ubuntu 24.04 LTS, purpose built for Microsoft Azure and maintained by cloudimg. Node.js is the de facto server side JavaScript runtime — built on Google's V8 engine, with a non blocking event loop, and the largest open source package ecosystem in software (npm registry exceeds 3 million packages). This image ships a production typical stack so customers can drop their own Express, Fastify, Nest.js, Next.js, or Hapi application onto a hardened, secret rotated VM and start serving traffic in minutes.
Why Choose cloudimg?
* 24/7 Expert Support Guaranteed 24 hour response, one hour average for critical issues. support@cloudimg.co.uk
* Production Ready from Launch Pre configured, security patched, validated
* Azure Native Integration Azure Linux Agent, cloud init, Gen2 Hyper V with UEFI boot
* Per VM Auth Wall SESSION_SECRET (32 hex) and ADMIN_API_KEY (32 hex) rotated at first boot, written to /stage/scripts/nodejs-credentials.log mode 0600 root only and exposed to Node via /etc/nodeapp/cloudimg.env mode 0640 root:nodeapp
What is Included
* Node.js 22.22.2 LTS from the official NodeSource APT repository (deb.nodesource.com), MIT licensed
* Bundled npm 10.9.x — the standard JavaScript package manager
* pnpm installed globally — fast, disk efficient alternative to npm with content addressable storage
* PM2 installed globally — production grade process manager with cluster mode, log rotation, and zero downtime reload
* nginx 1.24 from Ubuntu noble main, terminating HTTP on TCP 80 and reverse proxying to the Node app on 127.0.0.1:3000
* Express 4 + EJS templating + helmet security headers + morgan request logging + ws WebSocket library — installed via `npm install --omit=dev` at build time so the customer VM boots with no network dependency
* Sample app at /opt/nodeapp/cloudimg owned by the unprivileged `nodeapp` system user (home /var/lib/nodeapp, shell /usr/sbin/nologin) demonstrating a homepage, JSON API at /api/info, admin endpoint at /api/admin protected by the per VM API key, and a WebSocket echo demo at /ws
* Static assets at /opt/nodeapp/cloudimg/public served directly by nginx for /static/ requests (faster than going through Node)
* systemd units: cloudimg-app.service (Type=simple, ExecStart wraps pm2-runtime under bash for env expansion), nginx.service, and nodejs-firstboot.service (oneshot)
* PM2 invoked through pm2-runtime (not pm2 start) so the process manager stays in foreground and pipes logs straight to the systemd journal — exactly the pattern PM2 documents for systemd integration
* Ubuntu 24.04 LTS (Noble Numbat) base with full apt dist-upgrade applied at build time
Use Cases
* REST APIs and JSON microservices — Express, Fastify, Hapi, Nest.js
* Real time apps — WebSocket chat, collaborative editing, live dashboards (sample /ws echo demo demonstrates the wiring)
* Server side rendering — Next.js, Nuxt, Remix, Astro SSR backends behind nginx
* JavaScript build tooling — Vite, Webpack, Turbopack, esbuild build servers
* Backend for frontend (BFF) layer translating between client apps and downstream APIs
* Migration target for Node.js 18 EOL workloads onto an Active LTS runtime
Getting Started
1. Deploy from the Azure Marketplace
2. SSH as azureuser, sudo cat /stage/scripts/nodejs-credentials.log for the URL and admin API key
3. Browse to http://your-public-ip/ for the sample homepage with runtime metadata
4. curl -H 'X-Admin-Key:
5. Restrict NSG inbound on 80 to trusted IPs
6. Drop your Node.js app into /opt/nodeapp/cloudimg or replace ecosystem.config.js with your own PM2 process definition
7. Tune /etc/nodeapp/cloudimg.env for SESSION_SECRET, ADMIN_API_KEY, custom env vars — systemctl restart cloudimg-app to apply
Technical Specifications
* Node.js 22.22.2 LTS (Active LTS, supported through 2027-04-30)
* Ubuntu 24.04 LTS (Noble Numbat)
* npm 10.9.x bundled, pnpm + PM2 installed globally
* nginx 1.24 reverse proxy on TCP 80 -> 127.0.0.1:3000
* App root: /opt/nodeapp/cloudimg (Express + EJS + ws sample)
* Service: systemd (cloudimg-app.service, nginx.service, nodejs-firstboot.service)
* Recommended Size: Standard_B2s
* VM Generation: Hyper V Gen2 with UEFI boot
Notes on TLS and Hardening
TLS is not enabled by default. Production deployments should terminate TLS at an upstream Application Gateway or Front Door, or install certbot + python3-certbot-nginx for Let's Encrypt automation (documented in the user guide). The /api/admin endpoint demonstrates the per VM API key pattern — customers extend this to their own routes with the same X-Admin-Key middleware.
Support
cloudimg provides 24/7/365 expert technical support. Contact support@cloudimg.co.uk.
Visit www.cloudimg.co.uk/guides/nodejs-22-on-ubuntu-24-04-azure for the full user guide.
Node.js is a registered trademark of the OpenJS Foundation. This image is a repackaged upstream distribution provided by cloudimg. Additional charges apply for build, maintenance, and 24/7 support.