Deploying NodeBB 1.14 on CentOS 8 with MongoDB 4.2
-
NodeBB is a powerful, open source package for building online communities and forums. We usually recommend running it on CentOS 8, primarily because of the need for MongoDB deployment support. The current NodeBB release is 1.14. By default, NodeBB uses the REDIS NoSQL database, and this is fine for small and test deployments. For production, MongoDB is recommended. This setup script will install MongoDB 4.2, NodeJS 13, and NodeBB 1.14 in a default, vanilla configuration. When you are done, NodeBB will be running on port 4567 and MongoDB will be connected without credentials (not recommended, but is easily changed after install.)
Typically you will run a reverse proxy in front of NodeBB to handle things like SSL / TLS. Generally this would be nGinx. In this setup, we do not cover this portion. You can install your reverse proxy on the same box, or on a separate box. In this guide, NodeBB is exposed from this host to the outside world. If you do not want to expose it and only want it to be visible locally, simply remove the first firewall-cmd line.
During the script, the NodeBB Setup process will run. You can simple "hit enter" through all options and accept the defaults until it asks for the admin username, email, and password. These you must provide so that you can log in after the script completes.
This setup assumes a plain CentOS 8 install. The EPEL and other extra packages not handled by the script are not needed.
#!/bin/bash dnf -y update; dnf -y groupinstall "Development Tools" dnf -y install git ImageMagick curl firewall-cmd --zone=public --add-port=4567/tcp --permanent firewall-cmd --reload curl -sL https://rpm.nodesource.com/setup_14.x | bash - dnf install -y nodejs cat > /etc/yum.repos.d/mongodb-org-4.2.repo <<EOF [mongodb-org-4.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/7Server/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc EOF dnf -y install mongodb-org systemctl start mongod systemctl enable mongod cd /opt git clone -b v1.14.x https://github.com/NodeBB/NodeBB nodebb cd nodebb ./nodebb setup ./nodebb start
-
Its not entirely on one line, I don't know what to do now scott!
-
I guess I should get this going as well, it might matter to someone someday if I talk about it in an interview.
-
@scottalanmiller said in Deploying NodeBB 1.14 on CentOS 8 with MongoDB 4.2:
firewall-cmd --zone=public --add-port=4567/tcp --permanent
I've told you before, don't use a zone at all. It will simply use the default zone. Various spins have been known to use different names for the default zone.
Some where on here we have a conversation showing how choosing Fedora Minimal versus Fedora Server during an install will alter this default zone.
-
@scottalanmiller said in Deploying NodeBB 1.14 on CentOS 8 with MongoDB 4.2:
In this guide, NodeBB is exposed from this host to the outside world. If you do not want to expose it and only want it to be visible locally, simply remove the first firewall-cmd line.
You are making assumptions with that statement.
More clearly, if you have a standalone proxy in front of this, you still need to open this. Not just if it is open to the outside world. -
@scottalanmiller said in Deploying NodeBB 1.14 on CentOS 8 with MongoDB 4.2:
NodeJS 13,
@scottalanmiller said in Deploying NodeBB 1.14 on CentOS 8 with MongoDB 4.2:
curl -sL https://rpm.nodesource.com/setup_14.x | bash -
Those two things don't say the same thing.
-
@scottalanmiller said in Deploying NodeBB 1.14 on CentOS 8 with MongoDB 4.2:
By default, NodeBB uses the REDIS NoSQL database,
By default, in 1.15.x it uses Mongo
I'm pretty sure it did in the last version I installed also. But that was months ago and I do not recall clearly.