ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Deploying NodeBB 1.11.1 on CentOS 7 with MongoDB 4

    IT Discussion
    nodebb centos 7 linux mongodb mongodb 4.0 howto centos nodebb 1.11
    5
    20
    6.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      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
      
      1 Reply Last reply Reply Quote 2
      • B
        bnrstnr
        last edited by bnrstnr

        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.

        3857b527-ebdd-457d-b9aa-0e7568ac7d9c-image.png

        CloudKnightC JaredBuschJ scottalanmillerS 4 Replies Last reply Reply Quote 0
        • CloudKnightC
          CloudKnight @bnrstnr
          last edited by CloudKnight

          @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.

          3857b527-ebdd-457d-b9aa-0e7568ac7d9c-image.png

          Personal preference really, I'm quite a Ubuntu Server Fan, but a lot of people here prefer Fedora and CentOs.

          JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch
            last edited by

            @scottalanmiller last install I did, I swear it used mongo by default.

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch @bnrstnr
              last edited by

              @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

              1 Reply Last reply Reply Quote 2
              • JaredBuschJ
                JaredBusch @CloudKnight
                last edited by

                @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.

                3857b527-ebdd-457d-b9aa-0e7568ac7d9c-image.png

                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.

                1 Reply Last reply Reply Quote 1
                • scottalanmillerS
                  scottalanmiller @JaredBusch
                  last edited by

                  @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.

                  JaredBuschJ 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @CloudKnight
                    last edited by

                    @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.

                    1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch @scottalanmiller
                      last edited by

                      @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.

                      1 Reply Last reply Reply Quote 1
                      • scottalanmillerS
                        scottalanmiller @bnrstnr
                        last edited by

                        @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.)

                        JaredBuschJ 1 Reply Last reply Reply Quote 1
                        • JaredBuschJ
                          JaredBusch @scottalanmiller
                          last edited by

                          @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.

                          scottalanmillerS 2 Replies Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller @JaredBusch
                            last edited by

                            @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.

                            JaredBuschJ 1 Reply Last reply Reply Quote 0
                            • JaredBuschJ
                              JaredBusch @scottalanmiller
                              last edited by

                              @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.

                              1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller @JaredBusch
                                last edited by

                                @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.)

                                black3dynamiteB 1 Reply Last reply Reply Quote 0
                                • black3dynamiteB
                                  black3dynamite @scottalanmiller
                                  last edited by

                                  @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.

                                  JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 0
                                  • JaredBuschJ
                                    JaredBusch @black3dynamite
                                    last edited by

                                    @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.

                                    1 Reply Last reply Reply Quote 0
                                    • scottalanmillerS
                                      scottalanmiller @black3dynamite
                                      last edited by

                                      @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.

                                      black3dynamiteB 1 Reply Last reply Reply Quote 0
                                      • black3dynamiteB
                                        black3dynamite @scottalanmiller
                                        last edited by

                                        @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?

                                        scottalanmillerS 1 Reply Last reply Reply Quote 0
                                        • scottalanmillerS
                                          scottalanmiller @black3dynamite
                                          last edited by

                                          @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.

                                          1 Reply Last reply Reply Quote 0
                                          • scottalanmillerS
                                            scottalanmiller @bnrstnr
                                            last edited by

                                            @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.

                                            1 Reply Last reply Reply Quote 0
                                            • 1 / 1
                                            • First post
                                              Last post