Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4
-
NodeBB is a powerful, open source package for building online communities and forums. We usually recommend running it on CentOS 7. The current NodeBB release is 1.11.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.0, NodeJS 11, and NodeBB 1.11.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 7 install. The EPEL and other extra packages not handled by the script are not needed.
#!/bin/bash yum -y update yum -y groupinstall "Development Tools" yum -y install git ImageMagick curl firewall-cmd --zone=public --add-port=4567/tcp --permanent firewall-cmd --reload curl -sL https://rpm.nodesource.com/setup_11.x | bash - yum install -y nodejs cat > /etc/yum.repos.d/mongodb-org-4.0.repo <<EOF [mongodb-org-4.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/7Server/mongodb-org/4.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc EOF yum -y install mongodb-org systemctl start mongod systemctl enable mongod cd /opt git clone -b v1.11.x https://github.com/NodeBB/NodeBB nodebb cd nodebb ./nodebb setup ./nodebb start
-
What specific reasons for the CentOS recommendation here?
It looks like they recommend Ubuntu. I have one for testing running on Fedora and it works like a champ.
-
@bnrstnr said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
What specific reasons for the CentOS recommendation here?
It looks like they recommend Ubuntu. I have one for testing running on Fedora and it works like a champ.
Personal preference really, I'm quite a Ubuntu Server Fan, but a lot of people here prefer Fedora and CentOs.
-
@scottalanmiller last install I did, I swear it used mongo by default.
-
@bnrstnr not sure why he is using CentOS7 instead of Fedora, but the OS for any NodeJS based project should not matter. That is kind of the point of using NodeJS
-
@StuartJordan said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@bnrstnr said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
What specific reasons for the CentOS recommendation here?
It looks like they recommend Ubuntu. I have one for testing running on Fedora and it works like a champ.
Personal preference really, I'm quite a Ubuntu Server Fan, but a lot of people here prefer Fedora and CentOs.
I would not say a lot, but the most active. That is a different thing.
I know a number of users on here that use Debian/Ubuntu primarily.
-
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller last install I did, I swear it used mongo by default.
The setup wizard does, but the official NodeBB docs default to REDIS instructions. It's weird.
-
@StuartJordan said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
Personal preference really, I'm quite a Ubuntu Server Fan, but a lot of people here prefer Fedora and CentOs.
Install variation should be tiny as long as you use similar NodeJS and MongoDB install instructions.
-
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller last install I did, I swear it used mongo by default.
The setup wizard does, but the official NodeBB docs default to REDIS instructions. It's weird.
Not particularly. Documentation is hard (read: time consuming) and always falls behind on almsot everything.
-
@bnrstnr said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
What specific reasons for the CentOS recommendation here?
Experience in production for this specific workload for one. And because we are installing all the key pieces separately from the OS. I assume Fedora would work flawlessly, but we want to avoid the temptation of using Fedora's RPM packages for NodeJS or MongoDB. CentOS appeals to a far wider audience when looking for a production deployment of something of this nature. Personally I'd prefer Fedora, yes.
I think the instructions might work for both (best to swap YUM for DNF.)
-
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@bnrstnr said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
What specific reasons for the CentOS recommendation here?
Experience in production for this specific workload for one. And because we are installing all the key pieces separately from the OS. I assume Fedora would work flawlessly, but we want to avoid the temptation of using Fedora's RPM packages for NodeJS or MongoDB. CentOS appeals to a far wider audience when looking for a production deployment of something of this nature. Personally I'd prefer Fedora, yes.
I think the instructions might work for both (best to swap YUM for DNF.)
So because you are preparing to deploy this as a business offering and want the "stabliity" of old?
Otherwise, there is no reason to use CentOS, nor avoid the Fedora RPM packages.
-
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@bnrstnr said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
What specific reasons for the CentOS recommendation here?
Experience in production for this specific workload for one. And because we are installing all the key pieces separately from the OS. I assume Fedora would work flawlessly, but we want to avoid the temptation of using Fedora's RPM packages for NodeJS or MongoDB. CentOS appeals to a far wider audience when looking for a production deployment of something of this nature. Personally I'd prefer Fedora, yes.
I think the instructions might work for both (best to swap YUM for DNF.)
So because you are preparing to deploy this as a business offering and want the "stabliity" of old?
Because customers do, I'd prefer the "stability" of updated more if doing it for internal use.
-
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@bnrstnr said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
What specific reasons for the CentOS recommendation here?
Experience in production for this specific workload for one. And because we are installing all the key pieces separately from the OS. I assume Fedora would work flawlessly, but we want to avoid the temptation of using Fedora's RPM packages for NodeJS or MongoDB. CentOS appeals to a far wider audience when looking for a production deployment of something of this nature. Personally I'd prefer Fedora, yes.
I think the instructions might work for both (best to swap YUM for DNF.)
So because you are preparing to deploy this as a business offering and want the "stabliity" of old?
Because customers do, I'd prefer the "stability" of updated more if doing it for internal use.
Well, I don't deal with customers wanting these types of services, so I'll not comment further.
-
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
Otherwise, there is no reason to use CentOS, nor avoid the Fedora RPM packages.
Actually there is, the RPM packages for MongoDB are "breaking". You can't auto-update with them without bringing your forum down. Several updates in the last two years were not just breaking, but very breaking. Fedora RPM for NodeJS is acceptable, but would put you several versions behind typically. For MongoDB, it would put you behind with updates while creating a risk that a seemingly trivial update to the OS would be expected to totally hose the database (3.4 to 3.6 to 4.0 are all updates that have to be manually handled for MongoDB with the actual data being massaged to handle it, but the OS just changes the engine version and lets the data stop working.)
-
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
Otherwise, there is no reason to use CentOS, nor avoid the Fedora RPM packages.
Actually there is, the RPM packages for MongoDB are "breaking". You can't auto-update with them without bringing your forum down. Several updates in the last two years were not just breaking, but very breaking. Fedora RPM for NodeJS is acceptable, but would put you several versions behind typically. For MongoDB, it would put you behind with updates while creating a risk that a seemingly trivial update to the OS would be expected to totally hose the database (3.4 to 3.6 to 4.0 are all updates that have to be manually handled for MongoDB with the actual data being massaged to handle it, but the OS just changes the engine version and lets the data stop working.)
Its probably be best to start using the MongoDB repo instead of using RHEL and Fedora repo, with the news about them planning on removing MongoDB from their repo.
-
@black3dynamite said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
Otherwise, there is no reason to use CentOS, nor avoid the Fedora RPM packages.
Actually there is, the RPM packages for MongoDB are "breaking". You can't auto-update with them without bringing your forum down. Several updates in the last two years were not just breaking, but very breaking. Fedora RPM for NodeJS is acceptable, but would put you several versions behind typically. For MongoDB, it would put you behind with updates while creating a risk that a seemingly trivial update to the OS would be expected to totally hose the database (3.4 to 3.6 to 4.0 are all updates that have to be manually handled for MongoDB with the actual data being massaged to handle it, but the OS just changes the engine version and lets the data stop working.)
Its probably be best to start using the MongoDB repo instead of using RHEL and Fedora repo, with the news about them planning on removing MongoDB from their repo.
I would assume that they will be added to RPMFusion. I plan to use it form there if so.
-
@black3dynamite said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
Otherwise, there is no reason to use CentOS, nor avoid the Fedora RPM packages.
Actually there is, the RPM packages for MongoDB are "breaking". You can't auto-update with them without bringing your forum down. Several updates in the last two years were not just breaking, but very breaking. Fedora RPM for NodeJS is acceptable, but would put you several versions behind typically. For MongoDB, it would put you behind with updates while creating a risk that a seemingly trivial update to the OS would be expected to totally hose the database (3.4 to 3.6 to 4.0 are all updates that have to be manually handled for MongoDB with the actual data being massaged to handle it, but the OS just changes the engine version and lets the data stop working.)
Its probably be best to start using the MongoDB repo instead of using RHEL and Fedora repo, with the news about them planning on removing MongoDB from their repo.
I do that anyway. MongoDB is very good about their repos.
-
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@black3dynamite said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
Otherwise, there is no reason to use CentOS, nor avoid the Fedora RPM packages.
Actually there is, the RPM packages for MongoDB are "breaking". You can't auto-update with them without bringing your forum down. Several updates in the last two years were not just breaking, but very breaking. Fedora RPM for NodeJS is acceptable, but would put you several versions behind typically. For MongoDB, it would put you behind with updates while creating a risk that a seemingly trivial update to the OS would be expected to totally hose the database (3.4 to 3.6 to 4.0 are all updates that have to be manually handled for MongoDB with the actual data being massaged to handle it, but the OS just changes the engine version and lets the data stop working.)
Its probably be best to start using the MongoDB repo instead of using RHEL and Fedora repo, with the news about them planning on removing MongoDB from their repo.
I do that anyway. MongoDB is very good about their repos.
You do the same with nodejs on Fedora too?
-
@black3dynamite said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@black3dynamite said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@scottalanmiller said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
@JaredBusch said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
Otherwise, there is no reason to use CentOS, nor avoid the Fedora RPM packages.
Actually there is, the RPM packages for MongoDB are "breaking". You can't auto-update with them without bringing your forum down. Several updates in the last two years were not just breaking, but very breaking. Fedora RPM for NodeJS is acceptable, but would put you several versions behind typically. For MongoDB, it would put you behind with updates while creating a risk that a seemingly trivial update to the OS would be expected to totally hose the database (3.4 to 3.6 to 4.0 are all updates that have to be manually handled for MongoDB with the actual data being massaged to handle it, but the OS just changes the engine version and lets the data stop working.)
Its probably be best to start using the MongoDB repo instead of using RHEL and Fedora repo, with the news about them planning on removing MongoDB from their repo.
I do that anyway. MongoDB is very good about their repos.
You do the same with nodejs on Fedora too?
There are lots of ways to do it, but I like this model for control. NVM is good, too.
-
@bnrstnr said in Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4:
What specific reasons for the CentOS recommendation here?
Revisiting a little...
Basically the three main Linux releases supported by MongoDB are CentOS, Ubuntu, and Debian. CentOS and Ubuntu here are mostly six of one. But CentOS 8 Stream I like a little more than the Ubuntu LTS options. We use Ubuntu a little more often than CentOS today, but in this case I feel that CentOS is slightly better for us. But really, all three options are perfectly fine. We just have to pick one.