Updated: 28 September 2026 · Applies to: Ubuntu 24.04 LTS

Ubuntu 16.04 is no longer supported; this guide uses Ubuntu 24.04 LTS.

MEAN is MongoDB, Express, Angular and Node.js: a full JavaScript stack.

Install Node.js (current LTS)

Use the NodeSource packages for the current Long-Term-Support release (24.x at the time of writing; check nodejs.org):

curl -fsSL https://deb.nodesource.com/setup_24.x | bash -    # Ubuntu / Debian
apt install nodejs

curl -fsSL https://rpm.nodesource.com/setup_24.x | bash -    # AlmaLinux / Rocky
dnf install nodejs

Check with node -v and npm -v.

Tip: For development machines, or several Node versions side by side, use nvm instead: install it from its GitHub page, then nvm install --lts.

Install MongoDB Community (official repository)

MongoDB's documentation currently installs version 8.3. Ubuntu 24.04:

curl -fsSL https://pgp.mongodb.com/server-8.0.asc | gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.3 multiverse" > /etc/apt/sources.list.d/mongodb-org-8.3.list
apt update && apt install mongodb-org
systemctl enable --now mongod

On Debian 12 the repository line is deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.3 main.

AlmaLinux 9 / Rocky Linux 9: create /etc/yum.repos.d/mongodb-org-8.3.repo:

[mongodb-org-8.3]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/9/mongodb-org/8.3/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-8.0.asc

Then run dnf install mongodb-org && systemctl enable --now mongod.

Note: MongoDB listens on 127.0.0.1 by default. Keep it that way, or enable authentication before opening it to other servers.

Express back end

mkdir api && cd api && npm init -y
npm install express mongoose

Angular front end

npm install -g @angular/cli
ng new web
cd web && ng serve --host 0.0.0.0

For production, build Angular with ng build, serve the output with Nginx, and run the Express API with PM2 behind Nginx.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket