Now for the NodeBB installation

cd ~
sudo apt install -y git build-essential
git clone -b v1.7.x https://github.com/NodeBB/NodeBB.git $HOME/nodebb
cd nodebb
npm install --production

Tip: you can always check for the latest release but going to https://github.com/NodeBB/NodeBB/releases – as of this post it is v1.7.3 so we use v1.7.x in the command above

Before you proceed to the next step, make sure you have MongoDB. You can follow the Install MongoDB on Ubuntu guide if it’s not installed.

Now to get the database ready for NodeBB, open terminal and type the following

mongo
use nodebb
db.createUser( { user: "nodebb", pwd: "nodebbpwd", roles: [ "readWrite" ] } )
exit

NOTE: you should replace nodebb and nodebbpwd with your own!!