How to Install NodeBB on Ubuntu Linux

programmer 1653351 640
programmer 1653351 640

NodeBB Forums is an open-source community forum solution for the modern web and powers discussions on thousands of sites to drive user engagement.

When looking for a next-generation forum platform that’s powerful and mobile-friendly, you might want to take a look at NodeBB Forums software. It’s simple and efficient and makes online discussion easy and fun.

NodeBB is written in Node.js and requires Redis or MongoDB database software.

Individuals and web admins can use NodeBB Forums software to set up communities in minutes to stay in touch with groups of people or ideas.

This brief tutorial will show students and new users an easy way to get NodeBB Forums working on Ubuntu 16.04 / 18.10 and 18.04 with MongoDB support. To get started with installing NodeBB Forum Software, please follow the steps below:

Install Node.js

The first requirement for NodeBB forum software is to get Node.js installed. To do that, run the commands below.

sudo apt update
sudo apt install curl git gcc g++ make

After that, install the Node.js repository by running the commands below.

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

After that, run the commands below to install Node.js.

sudo apt install nodejs

That should install Node.js

Install MongoDB Database Server

The following requirement is to install MongoDB. To do that, run the commands below to add the MongoDB repository to Ubuntu, including its repository key.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

After that, run the commands below to install MongoDB

sudo apt update
sudo apt install mongodb-org

After installing MongoDB, the following commands can be used to stop, start and enable MongoDB service to start automatically when the server boots.

sudo systemctl stop mongod.service
sudo systemctl start mongod.service
sudo systemctl enable mongod.service

Create NodeBB Database

After installing the MongoDB database server, create a new database for NodeBB Forum software. To do that, use the guide below:

Login to MongoDB by running the commands below:

mongo

Then switch the DB admin and create a new admin user.

use admin

Create a new admin user named admin with a new password.

db.createUser( { user: "admin", pwd: "admin_password", roles: [ { role: "readWriteAnyDatabase", db: "admin" }, { role: "userAdminAnyDatabase", db: "admin" } ] } )

Next, create a new database called nodebb

use nodebb

Then create a new NodeBB user named nodebbuser with rights to administer the database.

db.createUser( { user: "nodebbuser", pwd: "new_password_here", roles: [ { role: "readWrite", db: "nodebb" }, { role: "clusterMonitor", db: "admin" } ] } )

After that, quit.

quit()

After that, run the commands below to open MongoDB config file.

sudo nano /etc/mongod.conf

Change the highlighted line to enable.

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

security:
authorization: enabled

#operationProfiling:

#replication:

#sharding:

When you’re done, save your changes.

Install NodeBB Forum

Now that all NodeBB Forum software requirements are in place, run the commands below to download NodeBB.

cd ~/
git clone -b v1.9.x https://github.com/NodeBB/NodeBB.git nodebb
cd nodebb

Finally, run the setup.

./nodebb setup

After a moment,  you should see a message that the setup is done.

Welcome to NodeBB v1.9.3!

This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
Press enter to accept the default setting (shown in brackets).
URL used to access this NodeBB (http://localhost:4567) 
Please enter a NodeBB secret (b5528104-4fbd-4560-9d6a-efd8fecf3069) 
Which database to use (mongo) 
2018-10-23T15:34:46.062Z [8359] - info: 
Now configuring mongo database:
MongoDB connection URI: (leave blank if you wish to specify host, port, username/password and database individually)
Format: mongodb://[username:password@]host1[:port1][,host2[:port2],.[,hostN[:portN]]][/[database][?options]] 
Host IP or address of your MongoDB instance (127.0.0.1) 
Host port of your MongoDB instance (27017) 
MongoDB username nodebbuser
Password of your MongoDB database 
MongoDB database name (nodebb) 
2018-10-23T15:35:32.123Z [8359] - info: [database] Checking database indices.
2018-10-23T15:35:32.217Z [8359] - info: [database] Checking database indices done!
Configuration Saved OK
Populating database with default configs, if not already set.
2018-10-23T15:35:34.174Z [8359] - warn: [cache-buster] could not read cache buster message=ENOENT: no such file or directory, open '/home/richard/nodebb/build/cache-buster', stack=Error: ENOENT: no such file or directory, open '/home/richard/nodebb/build/cache-buster', errno=-2, code=ENOENT, syscall=open, path=/home/richard/nodebb/build/cache-buster
Enabling default theme: nodebb-theme-persona
No categories found, populating instance with default categories
2018-10-23T15:35:35.491Z [8359] - warn: No administrators have been detected, running initial user setup

Administrator username admin
Administrator email address admin@example.com
Password 
Confirm Password 
Creating welcome post!
Enabling default plugins

After setting it up, run the commands below to start it.

./nodebb start

Now open your browser and browse to the server hostname or IP address followed by port # 4567

http://localhost:4567

You should see the NodeBB Forum page.

NodeBB Forum Ubuntu

Log on to the backend using the admin account you created above.

http://localhost:4567/admin
NodeBB Forurm Ubuntu install

That’s it!

You may also like the post below:

Posted by
Richard

I love computers; maybe way too much. What I learned I try to share at geekrewind.com.

2 Comments

  1. Я из россии Я приветствую всех.

  2. lol, where is final step – install nginx???

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: