MEAN stack (MongoDB, Express, Angular, Node 22) on Ubuntu 24.04
You get a JavaScript web stack on Ubuntu 24.04 LTS: Node.js 22, MongoDB 7.0, Express 4, the Angular CLI and PM2, with a sample Express app answering on port 3000. At first boot the VM creates its own MongoDB administrator password, turns on access control, and proves both before setup is marked complete.
Who it's for
- Developers building full-stack JavaScript apps on MEAN (MongoDB, Express, Angular, Node.js)
- Teams that need a development, test or demo server in their own Azure network
- Anyone who wants to skip the manual install of Node.js and MongoDB
What's included
- Node.js 22 LTS (long-term support) from NodeSource, with npm
- MongoDB 7.0 Community Server (the document database) as a systemd service (starts with the VM), listening only on the VM itself (127.0.0.1:27017)
- PM2 (keeps Node.js apps running), the Angular CLI (builds Angular front ends; no app is pre-built) and express-generator
- A sample Express 4 app in /var/www/mean-app/ on port 3000
- Host firewall (ufw) allowing only SSH, 80, 443 and 3000; 80 and 443 are left for a web server you add
After you deploy
- First boot generates the password for the MongoDB admin user (role root), enables authorization and checks that the password signs in and that an unauthenticated client is refused.
- Over SSH, the login message (MOTD) shows how to read the root-only password file and connect with mongosh.
- Allow port 3000 in your Azure network security group (NSG) from your own address and browse to http://<VM-IP>:3000/.
- Replace app.js with your application, then run sudo pm2 restart mean-landing and sudo pm2 save; the pm2-root systemd unit restarts it after a reboot. PM2 runs it as root, so give production apps their own user.
- Create a least-privilege database user, change the admin password and delete the file. For remote clients, change bindIp in /etc/mongod.conf, then allow 27017 in ufw and your NSG only from them.
Why this image
- No default or shared database password: each VM generates its own and tests it against the running server
- Every build is checked for baked-in secrets, then test-deployed to confirm the app, PM2 and the MongoDB sign-in
- Ubuntu updates applied when each image version is built
How it runs on Azure
A virtual machine in your own subscription and virtual network (VNet). The software charge is pay-as-you-go on your Azure invoice, alongside compute and storage. Recommended sizes: Standard_B2s to Standard_D8as_v5.
License and support: MongoDB Community Server is under the Server Side Public License (SSPL); Node.js, Express, the Angular CLI and PM2 are open-source. Packaged by Derek Coleman & Associates Inc; not affiliated with or endorsed by MongoDB, Inc., the OpenJS Foundation or Google. Get started with the setup guide at www.dcassociatesgroup.com/support/mean-stack/