How to Install NodeBB on a CentOS 7 VPS

In this tutorial we are going to provide you with step-by-step instructions on how to install NodeBB on a CentOS 7 VPS. NodeBB is an open source forum software for the Node.js platform that is free and easy to use. It is great for powering any kind of community forums, discussion or bulletin boards. NodeBB utilizes web sockets for instant interactions and real-time notifications.

The first step before beginning the actual installation of NodeBB is to make sure your OS packages are up to date:

yum clean all
yum update

Install the EPEL package using the following command:

yum install epel-release

Then, install the ‘Development Tools’:

yum groupinstall "Development Tools"

The ‘Development tools’ are a yum group, which is a predefined bundle of software (GCC, C/C++ compilers, make etc.) that can be installed at once, instead of having to install each application separately. The Development tools are mainly used to allow a user build and compile software from source code etc.

Install nodejs and other required packages:

yum install nodejs git redis npm nginx
yum install libicu-devel

Start the redis service:

systemctl start redis

Pull down the latest NodeBB files to a directory on your server:

mkdir -p /opt/forum/
cd /opt/forum/
git clone -b v0.8.x https://github.com/NodeBB/NodeBB nodebb

Use ‘npm’ to install required dependencies to run the NodeBB forum software:

cd nodebb
npm install node-bcrypt -g
npm install

If you receive an error that there is no node-gyp module available, run the following commands to fix the problem:

npm install node-gyp -g
npm cache clean
rm -rf node_modules
npm install

Run the following command to start the setup and configure NodeBB:

./nodebb setup

You will have to answer a few questions:

URL of NodeBB: http://localhost:4567

Please enter a NodeBB secret (a741f18e-ce20-44ca-860d-a60c1bab136f) 'enter'

Which database to use (redis) 'enter'

Host IP or address of your Redis instance (  'enter'

Host port of your Redis instance (6379) 'enter'

Password of your Redis database 'enter your database password here'

Which database to use (0..n) (0) 'enter'

Administrator username 'admin'

Administrator email address 'admin@yourdomain.com'

Password 'enter your admin password here'

Confirm Password 'enter your admin password here'

Once the NodeBB setup is complete, create a new nginx configuration file for your domain:

vi /etc/nginx/conf.d/yourdomain.com.conf

Add the following lines:

server {
    listen       80;
    server_name  yourdomain.com;
    location / {
        proxy_pass        http://localhost:4567/;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_redirect off;
        proxy_buffering   off;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

Restart the nginx service for the changes to take effect:

systemctl restart nginx

Run ‘./nodebb start’ to manually start your NodeBB server:

cd /opt/forum/nodebb/
./nodebb start

That is it.The NodeBB forum installation is complete.
Open http://yourdomain.com in your favorite browser, then log in to the administrator back-end and configure the NodeBB forum according to your needs.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install NodeBB forum software for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.


Categories: Tutorials