NodeBB is a Node.js based forum software built for the modern web. It's built on either a MongoDB or Redis database. It utilizes web sockets for instant interactions and real-time notifications. NodeBB has many modern features out of the box such as social network integration and streaming discussions. Additional functionality is enabled through the use of third-party plugins. NodeBB is an open source project which can be found on Github. In this guide, we will walk you through the step-by-step NodeBB installation process on the CentOS 7 operating system.

Requirements

NodeBB requires the following software to be installed:

Node.js version 6 or greater

MongoDB version 2.6 or greater or Redis version 2.8.9 or greater

Nginx version 1.3.13 or greater

Git

Prerequisites

A server running CentOS 7 x86_64(64-bit) system with at least 1GB or RAM

Step 1: Install Node.js and npm

NodeBB is built on Node.js. We are going to installrecommended version for NodeBB which is version 8at the time of this writing. On Linux you have a few Node.js installation options: Linux Binaries (x86/x64), Source Code or via Package Managers. We will use Package Managment option which makes installing and updating Node.js a breeze.

Download and install the latest Long-Term Support (LTS) release of Node.js from the Nodesource repository:

NOTE: npm is distributed with Node.js - which means that when you download Node.js, you automatically get npm installed on your system.

Check the Node.js and npmversions:

node -v && npm -v# v8.12.0# 6.4.1

Npm is a separate project from Node.js, and tends to update more frequently. As a result, even if you’ve just downloaded Node.js (and therefore npm), you’ll probably need to update your npm. Luckily, npm knows how to update itself! To update your npm, type this into your terminal:

Step 2: Install and configure MongoDB

NodeBB needs database to store its data, and it supports MongoDB and Redis. In this tutorial, we chose MongoDB as data store engine. So, in the next few steps, we will download and install MongoDB database from the official MongoDB rpm repository:

Create a/etc/yum.repos.d/mongodb-org-4.0.repofile, so that you can install MongoDB directly usingyum:

Securing your NodeBB forum with HTTPS is not necessary, but it is a good practice to secure your site traffic. In order to obtain SSL certificate from Let's Encrypt we will use Acme.sh client. Acme.sh is a pure unix shell software for obtaining SSL certificates from Let's Encrypt with zero dependencies.

Finally, to install the latest mainline version of Nginx package, issue the following command:

sudo yum install -y nginx

After the installation, you can verify Nginx version by running:

nginx -v# 1.15.3

Start and enable (set it to start on reboot) Nginx service:

sudo systemctl start nginx.servicesudo systemctl enable nginx.service

Check the Nginx web server status by running:

sudo systemctl status nginx.service# active (running)

NodeBB by default runs on port4567. To avoid typinghttp://example.com:4567, we will configure Nginx as a reverse proxy for the NodeBB application. Every request on port80or443(if SSL is used) will be forwarded to port4567.