Deploying NodeBB 1.13 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.13.1. 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.13.x 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_13.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.13.x https://github.com/NodeBB/NodeBB nodebb cd nodebb ./nodebb setup ./nodebb start
-
Since you are using CentOS 8, how about updating that script to use
dnf
instead ofyum
? -
@black3dynamite there you go
-
@scottalanmiller said in Deploying NodeBB 1.13 on CentOS 8 with MongoDB 4.2:
If you do not want to expose it and only want it to be visible locally, simply remove the first firewall-cmd line.
This is horribly described.
You can only remove this line if you are going to host the reverse proxy on the same instance.
If your reverse proxy is on a separate instance, this is still required.Additionally, but I have not tested, will SELinux let NodeBB answer on this by default if the proxy is not local?
-
@scottalanmiller said in Deploying NodeBB 1.13 on CentOS 8 with MongoDB 4.2:
This setup assumes a plain CentOS 7 install.
<cough>8</cough>
-
@JaredBusch said in Deploying NodeBB 1.13 on CentOS 8 with MongoDB 4.2:
@scottalanmiller said in Deploying NodeBB 1.13 on CentOS 8 with MongoDB 4.2:
This setup assumes a plain CentOS 7 install.
<cough>8</cough>
Fixed
-
@JaredBusch said in Deploying NodeBB 1.13 on CentOS 8 with MongoDB 4.2:
You can only remove this line if you are going to host the reverse proxy on the same instance.
No reverse proxy needed if you are going to just look at it locally without going over the network.