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

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

NodeBB is a forum platform built on Node.js.

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.

Install NodeBB

git clone -b v4.x https://github.com/NodeBB/NodeBB.git /opt/nodebb   # v4.x is the current release branch
cd /opt/nodebb
./nodebb setup      # enter the URL, MongoDB details and admin account
./nodebb start

NodeBB runs on port 4567. Put Nginx in front with HTTPS (proxy WebSockets too), and create a systemd service so it starts at boot.

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.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket