### Run Setup Script and Install Node.js Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/ubuntu/node/install.md Execute the downloaded setup script with root privileges to add the NodeSource repository, then install the Node.js package. ```bash sudo -E bash nodesource_setup.sh sudo apt-get install -y nodejs ``` -------------------------------- ### Run NodeBB Setup Utility Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/cloud9.md Initiates the NodeBB setup process, guiding you through configuration options. ```bash node app --setup ``` -------------------------------- ### Update and Install Prerequisites Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/ubuntu/node/install.md Before downloading the Node.js setup script, update your package list and install necessary packages like ca-certificates and curl. ```bash sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg ``` -------------------------------- ### Setup NodeBB Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/template.md Run the NodeBB setup utility to install npm modules and configure NodeBB. Use a non-privileged user. You will be prompted for database credentials and administrator information. ```bash {{nodebb.setup}} ``` -------------------------------- ### Start NodeBB Application Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/freebsd.md Starts the NodeBB application after the setup is complete. The forum will be accessible at http://FQDN:4567/. ```bash .\nodebb start ``` -------------------------------- ### Install NGINX using Homebrew Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macos-bigsur.md Installs NGINX using Homebrew and starts the NGINX service. This is a prerequisite for setting up NGINX as a reverse proxy. ```sh brew install nginx brew services start nginx ``` -------------------------------- ### Run NodeBB Interactive Installer Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/openshift.md Execute the NodeBB setup script to configure your application's details. Ensure you are in the correct directory. ```bash cd ~/app-root/repo && ./nodebb setup ``` -------------------------------- ### Download Node.js Setup Script Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/ubuntu/node/install.md Download the NodeSource setup script for the LTS version of Node.js. This script prepares your system to install Node.js from the NodeSource repository. ```bash curl -fsSL https://deb.nodesource.com/setup_lts.x -o nodesource_setup.sh ``` -------------------------------- ### Setup NodeBB Configuration Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/nitrous.md Runs the NodeBB setup script. It is recommended to leave most settings as default, but you can customize the port binding, for example, to 8080. ```bash ./nodebb setup ``` -------------------------------- ### NodeBB Docker Compose Console Output Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/docker.md Example console output when NodeBB starts via Docker Compose, indicating the web installer is launching. Access the installer via http://localhost:4567. ```text nodebb_1 | Config file not found at /opt/config/config.json nodebb_1 | Starting installer nodebb_1 | 2022-07-10T15:05:35.085Z [23] - info: Launching web installer on port 4567 nodebb_1 | 2022-07-10T15:05:47.697Z [23] - info: Web installer listening on http://0.0.0.0:4567 ``` -------------------------------- ### Manage NodeBB with Forever Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/running.md Install and start NodeBB using the forever package to monitor and re-launch the process if it stops. This command starts the application and keeps it running. ```bash npm install -g forever forever start app.js ``` -------------------------------- ### MongoDB Version Verification Output Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macos-bigsur.md Example output when verifying the MongoDB installation. This confirms the installed version and build details. ```text db version v4.0.27 git version: d47b151b55f286546e7c7c98888ae0577856ca20 allocator: system modules: none build environment: distarch: x86_64 target_arch: x86_64 ``` -------------------------------- ### Install LTS Node.js Version Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/upgrade.md Update Node.js to the latest LTS version, which is recommended for NodeBB. This script fetches setup instructions and installs Node.js using apt-get. ```bash curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs ``` -------------------------------- ### Install MongoDB on Ubuntu Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/ubuntu/mongo/install.md Installs MongoDB on Ubuntu by adding the GPG key, configuring the repository, updating package lists, and installing the MongoDB packages. Ensure you use the correct version numbers for your setup. ```bash sudo apt-get install gnupg curl curl -fsSL https://www.mongodb.org/static/pgp/server-{{versions.recommended.mongo}}.asc | \ sudo gpg -o /usr/share/keyrings/mongodb-server-{{versions.recommended.mongo}}.gpg \ --dearmor echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-{{versions.recommended.mongo}}.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/{{versions.recommended.mongo}} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-{{versions.recommended.mongo}}.list sudo apt-get update sudo apt-get install -y mongodb-org ``` -------------------------------- ### Start NodeBB with Docker Compose Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/docker.md Use this command to start NodeBB with Docker Compose, specifying the database profile. Ensure Docker Compose version 3.8 or higher is installed. ```bash $ docker-compose --profile {DATABASE} up ``` -------------------------------- ### MongoDB Configuration File Example Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/windows/mongo/install.md Define storage and logging paths for the mongod service. Ensure the paths exist before starting the service. ```yaml systemLog: destination: file path: C:\MongoDB\logs\mongod.log storage: dbPath: C:\MongoDB\data\db ``` -------------------------------- ### Install Redis Server Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macOS.md Install the Redis server using Homebrew. This command downloads and installs the Redis package. ```bash brew install redis ``` -------------------------------- ### NodeBB Command Line Interface Usage Source: https://github.com/nodebb/docs/blob/master/src/docs/faq.md Use the ./nodebb executable for various server management tasks. Available commands include start, stop, restart, status, log, setup, install, build, activate, plugins, events, info, reset, user, and upgrade. ```bash $ ./nodebb Usage: ./nodebb [options] [command] Welcome to NodeBB Options: -V, --version output the version number --json-logging Output to logs in JSON format (default: false) --log-level Default logging level to use (default: "info") --config Specify a config file (default: "config.json") -d, --dev Development mode, including verbose logging (default: false) -l, --log Log subprocess output to console (default: false) -h, --help display help for command Commands: start Start the NodeBB server stop Stop the NodeBB server restart Restart the NodeBB server status Check the running status of the NodeBB server log Open the output log (useful for debugging) setup [options] [config] Run the NodeBB setup script, or setup with an initial config install Launch the NodeBB web installer for configuration setup build [options] [targets...] Compile static assets (JS, CSS, templates, languages) activate [plugin] Activate a plugin for the next startup of NodeBB (nodebb-plugin- prefix is optional) plugins List all installed plugins events [count] Outputs the most recent administrative events recorded by NodeBB info Outputs various system info reset [options] Reset plugins, themes, settings, etc user [command] Manage users upgrade [options] [scripts...] Run NodeBB upgrade scripts and ensure packages are up-to-date, or run a particular upgrade script help [command] Display help for [command] ``` -------------------------------- ### Install Base Software Stack Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/centos.md Installs essential development tools, Git, Redis, ImageMagick, and npm. ```bash yum -y groupinstall "Development Tools" yum -y install git redis ImageMagick npm ``` -------------------------------- ### Install Base Software Stack Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/databases/mongo.md Installs git, build-essential, and imagemagick required for NodeBB. ```bash # apt-get install git build-essential imagemagick ``` -------------------------------- ### Start NodeBB Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/template.md Use the NodeBB command-line utility to start the NodeBB application. Ensure you are using a non-privileged user. ```bash {{nodebb.start}} ``` -------------------------------- ### Run NodeBB Interactive Setup Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/freebsd.md Initiates the interactive setup process for NodeBB. It is recommended to choose 'redis' as the database during this configuration. ```bash .\nodebb setup ``` -------------------------------- ### Run NodeBB Setup Wizard Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/fedora.md Navigates to the NodeBB directory and initiates the setup wizard by running the application as the 'nodebb' user. The wizard will prompt for database configuration details. ```bash cd /opt/nodebb ``` ```bash sudo -u nodebb ./nodebb setup ``` -------------------------------- ### Setup NodeBB Application Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/databases/mongo.md Initiates the NodeBB application setup process, prompting for configuration details like hostname, database type, credentials, and database name. ```bash $ node app --setup ``` -------------------------------- ### Enable and Start PostgreSQL Service Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/fedora.md Configures the PostgreSQL service to start automatically on boot and starts it immediately. ```bash systemctl enable --now postgresql ``` -------------------------------- ### Install MkDocs Source: https://github.com/nodebb/docs/blob/master/README.md Installs MkDocs, a static site generator, using pip. For Windows users, use 'python -m pip install mkdocs'. ```bash pip3 install mkdocs ``` -------------------------------- ### Start NodeBB with Logging Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/upgrade.md Start the NodeBB application with logging enabled to monitor its startup process and identify any potential issues. This command should be run from the NodeBB directory. ```bash ./nodebb start -l ``` -------------------------------- ### Start and Check Nginx Service Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/template.md Commands to start the Nginx service and check its current status. Ensure the service is running correctly after installation or configuration changes. ```bash {{nginx.service.start}} ``` ```bash {{nginx.service.status}} ``` -------------------------------- ### NodeBB Configuration with Redis for Pub/Sub Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/scaling.md Example config.json for NodeBB using MongoDB as the primary datastore and Redis for inter-process communication (pub-sub) and session storage. Ensure Redis is installed and accessible. ```json { "url": "http://example.org", "secret": "your-secret-goes-here", "database": "mongo", "port": [4567, 4568,4569], "mongo": { "host": "127.0.0.1", "port": "27017", "database": "0" }, "redis": { "host":"127.0.0.1", "port":"6379", "database": 0 } } ``` -------------------------------- ### Start NodeBB Server Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/nitrous.md Starts the NodeBB application. After starting, access the application via the 'Preview URI' provided by Nitrous.IO, omitting the port number if it's the default. ```bash ./nodebb start ``` -------------------------------- ### Enable and Start Redis Service Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/freebsd.md Enables the Redis service to start automatically on boot and then starts the service immediately. Redis is used as the database for NodeBB. ```bash service redis enable && service redis start ``` -------------------------------- ### Run NodeBB Setup Script Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/smartos.md Executes the NodeBB setup script to configure the application. Follow the prompts to enter URL, port, secret, and binding information. ```bash $ ./nodebb setup ``` -------------------------------- ### Start and Enable Redis Service Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/centos.md Starts the Redis service and configures it to start automatically on system reboot. ```bash systemctl start redis systemctl enable redis ``` -------------------------------- ### Install Redis on Ubuntu/Debian Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/databases/redis.md Use apt to install the redis-server package. Ensure you are running these commands as the root user. ```bash // as root user add-apt-repository ppa:chris-lea/redis-server apt-get update apt-get install -y redis-server ``` -------------------------------- ### Start and Autostart MongoDB Service Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macos-bigsur.md Starts the MongoDB service using Homebrew services and configures it to automatically start on system boot. ```shell brew services start mongodb/brew/mongodb-community@4.0 ``` -------------------------------- ### Start MkDocs Development Server Source: https://github.com/nodebb/docs/blob/master/README.md Starts the MkDocs development server for local testing. For Windows, use 'python -m mkdocs serve'. The server will automatically refresh on file changes. ```bash mkdocs serve ``` -------------------------------- ### Install Base Software Stack Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/fedora.md Installs essential packages including Git, Node.js, PostgreSQL server, and SELinux policy utilities required for NodeBB. ```bash dnf install -y git nodejs postgresql-server policycoreutils-python-utils ``` -------------------------------- ### Install MkDocs Material Theme Source: https://github.com/nodebb/docs/blob/master/README.md Installs the MkDocs Material theme and its imaging dependencies. ```bash pip3 install mkdocs-material "mkdocs-material[imaging]" ``` -------------------------------- ### Install a NodeBB Theme via npm Source: https://github.com/nodebb/docs/blob/master/src/docs/development/themes/index.md Themes are distributed as npm packages. Use this command to install a theme. ```bash npm install nodebb-theme-modern-ui ``` -------------------------------- ### Install Nginx Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/ubuntu/nginx/install.md Use this command to install Nginx on Debian or Ubuntu systems. Ensure you have sudo privileges. ```bash sudo apt-get install -y nginx ``` -------------------------------- ### Start NodeBB Application Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/fedora.md Starts the NodeBB forum application by running the executable as the 'nodebb' user. NodeBB can also be managed with tools like 'forever'. ```bash sudo -u nodebb ./nodebb start ``` -------------------------------- ### Install MongoDB Service Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/windows/mongo/install.md Install the mongod service using the configuration file. This command must be run from an administrator command prompt. ```bash mongod.exe --config "{{mongo.config}}" --install ``` -------------------------------- ### Install Node.js via NVM Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/centos.md Installs Node Version Manager (NVM) and then installs Node.js version 14.18.1. Always check available versions using `nvm list-remote`. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash source ~/.bash_profile nvm list-remote nvm install v14.18.1 ``` -------------------------------- ### Install Grunt CLI Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/running.md Install the Grunt command-line interface globally to manage Grunt tasks. ```bash npm install -g grunt-cli ``` -------------------------------- ### Start Redis Server Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macOS.md Start the Redis server in your terminal. This command launches the Redis in-memory data structure store. ```bash redis-server ``` -------------------------------- ### Start NodeBB Process Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/smartos.md Manually starts the NodeBB application. This method is not recommended for production environments; consider using process managers like Forever or Supervisor. ```bash $ node app ``` -------------------------------- ### Install Redis Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/nitrous.md Installs the Redis in-memory data structure store, which is a required dependency for NodeBB. ```bash parts install redis ``` -------------------------------- ### Install Imgur Plugin for NodeBB Source: https://github.com/nodebb/docs/blob/master/src/docs/admin/uploads.md Use this command to install the nodebb-plugin-imgur to enable post image attachments. ```bash $ npm install nodebb-plugin-imgur ``` -------------------------------- ### Start NodeBB Application Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/databases/mongo.md Starts the NodeBB application. Access it via your domain or IP address on port 4567. ```bash $ ./nodebb start ``` -------------------------------- ### Install Redis on Cloud 9 Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/cloud9.md Installs Redis using Cloud 9's package manager, 'nada-nix'. ```bash nada-nix install redis ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/nodebb/docs/blob/master/README.md Installs project dependencies using either Yarn or npm. ```bash yarn ``` ```bash npm ``` -------------------------------- ### Verify Node.js and npm Installation Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/template.md Check the installed versions of Node.js and npm. Ensure you have the recommended LTS version of Node.js and a compatible npm version. ```bash node -v npm -v (should output "{{versions.recommended.npm}}" or similar) ``` -------------------------------- ### Manage NodeBB with systemctl Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/running.md Commands to start, stop, enable, and disable the NodeBB service using systemctl. Enabling the service ensures NodeBB starts automatically on system boot. ```bash systemctl start nodebb systemctl stop nodebb ``` ```bash systemctl enable mongod systemctl enable nodebb ``` -------------------------------- ### Run NodeBB Application Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/cloud9.md Starts the NodeBB application. Access it via the specified URL in your browser. ```bash node app ``` -------------------------------- ### Install NodeBB Dependencies on SmartOS Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/smartos.md Installs essential software for NodeBB using the pkgin package manager. Ensure you have updated your package list before running these commands. ```bash $ sudo pkgin update $ sudo pkgin install scmgit nodejs build-essential ImageMagick redis ``` ```bash $ pkgin search *failed-name* $ sudo pkgin install *available-name* ``` -------------------------------- ### Verify MongoDB Installation Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/template.md Confirm the installed version of MongoDB. This step ensures compatibility with NodeBB. ```bash mongod --version db version v{{versions.recommended.mongo}} ``` -------------------------------- ### Install NodeBB Base Software Stack on Arch Linux Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/arch.md Installs necessary packages for NodeBB using pacman. Ensure your system is up-to-date with `pacman -Syu` before running this command. ```bash sudo pacman -S git nodejs npm redis imagemagick icu ``` -------------------------------- ### Start NodeBB Service on OpenShift Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/cloud/openshift.md Start the NodeBB application on OpenShift after configuration. Visit your application's URL to access it. ```bash cd ~/app-root/repo && ./nodebb start ``` -------------------------------- ### Install S3 Uploads Plugin for NodeBB Source: https://github.com/nodebb/docs/blob/master/src/docs/admin/uploads.md Use this command to install the @nodebb/nodebb-plugin-s3-uploads for automatic Amazon S3 file storage. ```bash $ npm i @nodebb/nodebb-plugin-s3-uploads ``` -------------------------------- ### Start MongoDB Service Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macOS.md Start the MongoDB community server using Homebrew services. This command ensures MongoDB runs in the background. ```bash brew services start mongodb-community@7.0 ``` -------------------------------- ### Verify Node.js and npm Installation Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macos-bigsur.md Checks if Node.js and npm are installed correctly and displays their versions. Expected output is v16.x.x for Node.js and 6.x.x for npm. ```shell node -v # v16.x.x npm -v # 6.x.x ``` -------------------------------- ### Install Xcode Command-Line Tools Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macOS.md Install the necessary Xcode command-line tools required by Homebrew. Run this command in your macOS Terminal. ```bash xcode-select --install ``` -------------------------------- ### Update Package List and Install Node.js Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/debian/node/install.md Updates the apt package index with the new repository and installs the Node.js package. ```bash sudo apt-get update sudo apt-get install nodejs -y ``` -------------------------------- ### Download and Import NodeSource GPG Key Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/debian/node/install.md Installs necessary packages and imports the NodeSource GPG key to verify package authenticity. Ensure you have curl and gnupg installed. ```bash sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg sudo mkdir -p /etc/apt/keyrings curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg ``` -------------------------------- ### Start and Verify MongoDB Service Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/template.md Initiate the MongoDB service and check its status to ensure it is running correctly. MongoDB should be active and running. ```bash {{mongo.service.start}} {{mongo.service.status}} ``` -------------------------------- ### Plugin Settings Object Example Source: https://github.com/nodebb/docs/blob/master/src/docs/development/database-structure.md Stores configuration settings for a specific NodeBB plugin. The `_key` follows the pattern `settings:`. ```javascript > db.objects.findOne({_key: "settings:mentions"}) { "_id" : ObjectId("5e8c8db8ba5ceec316de0b92"), "_key" : "settings:mentions", "autofillGroups" : "off", "disableFollowedTopics" : "off", "disableGroupMentions" : "[]", "display" : "", "overrideIgnores" : "off" } ``` -------------------------------- ### Install NodeBB NPM Packages Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/freebsd.md Installs the necessary Node.js packages for NodeBB using npm. This includes dependencies like 'node-addon-api', 'sharp', and 'lodash'. ```bash npm install node-addon-api node-gyp libvips tslib sharp lodash ``` -------------------------------- ### Install NodeBB Plugin via npm Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/plugins/index.md Use this command to install plugins not listed in the admin control panel. Incompatibilities may cause NodeBB to crash. ```bash $ npm install nodebb-plugin-someplugin ``` -------------------------------- ### Install Node.js LTS Version Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macos-bigsur.md Installs Node.js version 16 using Homebrew. This version is recommended for seamless future updates. You may need to manually link it. ```shell brew install node@16 brew link node@16 ``` -------------------------------- ### nginx proxy setup for NodeBB with subfolder install Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/proxies/nginx.md Configure nginx to proxy requests to a NodeBB instance installed in a subfolder (e.g., `/forum`). The `location` directive in nginx must match the subfolder path. ```nginx server { listen 80; server_name forum.example.org; # notice no subfolder defined here location /forum/ { # but it is defined here 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_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:4567; # no subfolder defined here proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } ``` -------------------------------- ### Caddyfile Reverse Proxy Configuration Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/proxies/caddy.md Save this configuration to `/etc/caddy/Caddyfile` for a permanent reverse proxy. This setup works even for NodeBB installations in subfolders. ```caddyfile example.org reverse_proxy localhost:4567 ``` -------------------------------- ### Update Node.js on Ubuntu/Debian Source: https://github.com/nodebb/docs/blob/master/src/docs/faq.md Install Node.js version 4 or higher on Ubuntu or Debian systems to resolve npm compatibility errors. This involves using NodeSource setup scripts and apt-get. ```bash # Using Ubuntu curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs ``` ```bash # Using Debian, as root curl -sL https://deb.nodesource.com/setup_4.x | bash - apt-get install -y nodejs ``` -------------------------------- ### Create and Enable New Nginx Site Configuration Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/debian/nginx/configs.md Use these commands to create a new Nginx configuration file and enable it by creating a symbolic link. Ensure you replace `forum.example.com` with your actual domain name. ```bash cd /etc/nginx/sites-available sudo nano forum.example.com # config entered into file and saved cd ../sites-enabled sudo ln -s ../sites-available/forum.example.com ``` -------------------------------- ### Verify Nginx Installation Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/template.md Check if Nginx is installed by displaying its version. This command is useful after installing Nginx to confirm the installation was successful. ```bash nginx -v ``` -------------------------------- ### Install Python Package Manager Source: https://github.com/nodebb/docs/blob/master/README.md Installs pip, the Python package installer, on Debian-based systems. ```bash sudo apt-get update && sudo apt-get install python3-pip ``` -------------------------------- ### Install MongoDB on Debian Source: https://github.com/nodebb/docs/blob/master/src/templates/installing/os/debian/mongo/install.md Installs MongoDB Community Edition on Debian systems. Ensure you have curl and gnupg installed. This script adds the MongoDB repository and installs the server package. ```bash sudo apt-get install gnupg curl curl -fsSL https://pgp.mongodb.com/server-{{versions.recommended.mongo}}.asc | \ sudo gpg -o /usr/share/keyrings/mongodb-server-{{versions.recommended.mongo}}.gpg \ --dearmor echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-{{versions.recommended.mongo}}.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/{{versions.recommended.mongo}} main" | sudo tee /etc/apt/sources.list.d/mongodb-org-{{versions.recommended.mongo}}.list sudo apt-get update sudo apt-get install -y mongodb-org ``` -------------------------------- ### Verify MongoDB Installation Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macOS.md Verify that MongoDB has been installed correctly by checking its version. This command displays the installed MongoDB version. ```bash mongod --version ``` -------------------------------- ### Basic Caddy Reverse Proxy Command Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/proxies/caddy.md Use this command for a quick, temporary reverse proxy setup. It forwards requests from example.org to NodeBB running on localhost:4567. ```bash caddy reverse_proxy --from example.org --to localhost:4567 ``` -------------------------------- ### Install MongoDB Community Edition Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macOS.md Install MongoDB Community Edition version 7.0 using Homebrew. This command installs the specified version of MongoDB. ```bash brew install mongodb-community@7.0 ``` -------------------------------- ### Create NodeBB User and Home Directory Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/freebsd.md Creates a dedicated user for NodeBB and sets up their home directory. Ensure this user and directory exist before proceeding with the installation. ```bash pw user add -n nodebb -m -s /bin/sh -d /usr/home/nodebb -c "NodeBB User" chown -R nodebb:nodebb /usr/home/nodebb ``` -------------------------------- ### Install MongoDB Community Edition Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/macos-bigsur.md Installs MongoDB community edition version 4.0 using Homebrew. This command first taps the MongoDB repository and then installs the specified version. ```shell brew tap mongodb/brew brew install mongodb-community@4.0 brew link mongodb-community@4.0 ``` -------------------------------- ### Initialize PostgreSQL Database Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/fedora.md Sets up the default PostgreSQL database cluster. This command initializes the database directory and configuration files. ```bash /usr/bin/postgresql-setup initdb ``` -------------------------------- ### View Build Command Help Source: https://github.com/nodebb/docs/blob/master/src/docs/development/index.md Run the build command with the -h flag to see a full list of available arguments for selective asset building. ```shell ./nodebb build -h ``` -------------------------------- ### Install NodeBB Dependencies Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/databases/mongo.md Installs NodeBB's required npm dependencies within the NodeBB directory. ```bash $ cd nodebb $ npm install ``` -------------------------------- ### Link Local Plugin to NodeBB Instance Source: https://github.com/nodebb/docs/blob/master/src/docs/development/plugins/index.md Use 'npm link' in your plugin's directory and then 'npm link ' in your NodeBB source folder to test plugins locally before publishing. A subsequent './nodebb build' is required. ```bash npm link ``` ```bash npm link my-plugin ``` ```bash ./nodebb build ``` -------------------------------- ### Sample Nginx Configuration with Clustering and Static Assets Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/scaling.md A comprehensive Nginx configuration integrating upstream load balancing for clustered NodeBB instances, static asset serving, and gzip compression. ```nginx upstream io_nodes { ip_hash; server 127.0.0.1:4567; server 127.0.0.1:4568; server 127.0.0.1:4569; } server { listen 80; server_name community.nodebb.org; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_redirect off; # Socket.io Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; gzip on; gzip_min_length 1000; gzip_proxied off; gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json; location @nodebb { proxy_pass http://io_nodes; } location ~ ^/assets/(.*) { root /path/to/nodebb/; try_files /build/public/$1 /public/$1 @nodebb; } location / { proxy_pass http://io_nodes; } } ``` -------------------------------- ### Manage NodeBB with Supervisor Source: https://github.com/nodebb/docs/blob/master/src/docs/configuring/running.md Install and run NodeBB using the supervisor package for automatic restarts on crashes. This method is best suited for development builds as it pipes output to stdout. ```bash npm install -g supervisor supervisor app ``` -------------------------------- ### Create NodeBB Application Directory Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/fedora.md Creates the directory structure where NodeBB will be installed. The '-p' flag ensures parent directories are created if they don't exist. ```bash mkdir -p /opt/nodebb ``` -------------------------------- ### Install NodeBB Dependencies Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/freebsd.md Installs essential packages required for NodeBB, including Redis, build tools, Node.js, and image processing libraries. ```bash pkg install redis gcc npm git vips node vips ``` -------------------------------- ### Install EPEL Release on CentOS 7 Source: https://github.com/nodebb/docs/blob/master/src/docs/installing/os/centos.md Installs the Extra Packages for Enterprise Linux repository, which is required for certain packages on CentOS 7. ```bash yum -y install epel-release ```