How to Install NodeBB on CentOS 7

How to Install NodeBB on CentOS 7

We’ll show you 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.

1. Update OS Packages

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

2. Install EPEL

Install the EPEL package using the following command:

yum install epel-release

3. Install Development Tools

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.

4. Install Node.js

Install nodejs and other required packages:

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

5. Start Redis

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

6. Install NodeBB Required Dependencies

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

7. Setup and Configure NodeBB

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 (127.0.0.1)  '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";
    }
}

8. Restart Nginx Server

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.
How to Install NodeBB on CentOS 7Of course you don’t have to Install NodeBB on CentOS 7, if you use one of our CentOS 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, on how to Install NodeBB on CentOS 7,  please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

 

Leave a Comment