### Install NodeBB: Start Server Source: https://docs.nodebb.org/installing/os/macOS Starts the NodeBB application using its command-line utility. After setup, this command launches the forum. ```bash ./nodebb start ``` -------------------------------- ### Run NodeBB Setup Utility Source: https://docs.nodebb.org/installing/cloud/cloud9 This command initiates the NodeBB setup utility, guiding the user through the configuration process for a new installation. ```bash node app --setup ``` -------------------------------- ### Install NodeBB: Setup Utility Source: https://docs.nodebb.org/installing/os/macOS Executes the NodeBB setup utility, which installs necessary npm modules and guides through the initial configuration process, including database and administrator setup. ```bash ./nodebb setup ``` -------------------------------- ### Start NodeBB Source: https://docs.nodebb.org/installing/os/ubuntu Starts the NodeBB application using its command-line utility. This command should be run after the setup process is complete. ```bash ./nodebb start ``` -------------------------------- ### Start NodeBB Service Source: https://docs.nodebb.org/installing/os/freebsd Starts the NodeBB application after the setup and configuration are complete, making the forum accessible. ```bash ./nodebb start ``` -------------------------------- ### Setup and Start NodeBB on Nitrous.IO Source: https://docs.nodebb.org/installing/cloud/nitrous These commands are used to set up the NodeBB configuration and start the application. The setup prompts for configuration details, and the start command launches the NodeBB server. ```Shell ./nodebb setup ``` ```Shell ./nodebb start ``` -------------------------------- ### Setup NodeBB Source: https://docs.nodebb.org/installing/os/ubuntu Executes the NodeBB command-line utility to set up the forum. This process includes installing npm modules and guiding the user through configuration questions for database connection and administrator setup. ```bash ./nodebb setup ``` -------------------------------- ### Run NodeBB Interactive Setup Source: https://docs.nodebb.org/installing/os/freebsd Executes the NodeBB setup script, which guides the user through the configuration process, allowing for default settings or custom adjustments. ```bash ./nodebb setup ``` -------------------------------- ### Run NodeBB Setup Script Source: https://docs.nodebb.org/installing/os/centos Initiates the NodeBB setup process by running the application with the 'setup' flag. This script guides the user through configuration options for databases, ports, and other settings. ```bash ./nodebb setup ``` -------------------------------- ### Start NodeBB Source: https://docs.nodebb.org/installing/os/debian Starts the NodeBB application using its command-line utility. This command should be run after the setup is complete. ```bash ./nodebb start ``` -------------------------------- ### Run NodeBB Setup Script Source: https://docs.nodebb.org/installing/os/arch Initiates the NodeBB setup process by executing the application with the 'setup' flag. This script guides the user through configuration options. ```bash ./nodebb setup ``` -------------------------------- ### Setup NodeBB Source: https://docs.nodebb.org/installing/os/windows Initiates the NodeBB setup process, which includes installing npm modules and running an interactive setup utility. Follow the prompts for database configuration and administrator setup. Avoid running with root privileges. ```bash nodebb setup ``` -------------------------------- ### Setup NodeBB Application Source: https://docs.nodebb.org/configuring/databases/mongo Command to initiate the NodeBB application setup process, which guides the user through configuring database connection, hostname, and user credentials. ```shell $ node app --setup ``` -------------------------------- ### Run NodeBB Setup Utility Source: https://docs.nodebb.org/installing/os/macos-bigsur This snippet executes the NodeBB setup utility, which installs npm modules and guides through the initial configuration, including database credentials and administrator setup. ```bash ./nodebb setup ``` -------------------------------- ### Setup NodeBB Source: https://docs.nodebb.org/installing/os/debian Executes the NodeBB command-line utility to set up the forum. This process installs npm modules and guides the user through configuration questions for database connection and administrator setup. ```bash ./nodebb setup ``` -------------------------------- ### Start NodeBB Server Source: https://docs.nodebb.org/installing/os/windows Starts the NodeBB application using its command-line utility. Ensure NodeBB is set up correctly before running this command. Do not execute with root privileges. ```bash nodebb start ``` -------------------------------- ### NodeBB Build Help Source: https://docs.nodebb.org/development View available build options and arguments for NodeBB by running the help command. This provides a comprehensive list of components that can be selectively built. ```shell ./nodebb build -h ``` -------------------------------- ### Run NodeBB Setup Script Source: https://docs.nodebb.org/installing/os/smartos Executes the NodeBB setup script, which guides the user through configuring essential settings like URL, port, secret, and IP binding. ```bash ./nodebb setup ``` -------------------------------- ### Clone NodeBB Repository and Navigate Source: https://docs.nodebb.org/installing/os/smartos Clones the NodeBB v2.x repository from GitHub and navigates into the newly created NodeBB directory. This prepares the project for setup. ```bash cd /parent/directory/of/nodebb/ git clone -b v2.x https://github.com/NodeBB/NodeBB.git nodebb cd nodebb ``` -------------------------------- ### Setup NodeBB Installation Source: https://docs.nodebb.org/installing/cloud/openshift Initiates the NodeBB interactive setup process within the application's repository on OpenShift. This configures NodeBB with your database details and other settings. ```bash cd ~/app-root/repo && ./nodebb setup ``` -------------------------------- ### Start NodeBB Manually Source: https://docs.nodebb.org/installing/os/smartos Starts the NodeBB application process manually using the 'node app' command. This is suitable for development but not recommended for production environments. ```bash node app ``` -------------------------------- ### Run NodeBB Application Source: https://docs.nodebb.org/installing/cloud/cloud9 This command starts the NodeBB application after the setup utility has been completed. The application can then be accessed via a web browser. ```bash node app ``` -------------------------------- ### Start Nginx Service Source: https://docs.nodebb.org/installing/os/windows Starts the Nginx web server. This command is typically run after navigating to the Nginx installation directory. It also includes a check to confirm the nginx.exe process is running. ```bash cd C:\nginx start nginx tasklist | findstr nginx.exe ``` -------------------------------- ### NodeBB Installation via OS - Ubuntu Source: https://docs.nodebb.org/activitypub/fep Instructions for installing NodeBB on Ubuntu, a recommended operating system. This section likely details package dependencies and setup commands. ```bash # Example command for installing NodeBB on Ubuntu # apt-get update # apt-get install nodejs npm # git clone https://github.com/NodeBB/NodeBB.git # cd NodeBB # npm install # ./nodebb setup ``` -------------------------------- ### NodeBB Docker Instance Console Output Source: https://docs.nodebb.org/installing/cloud/docker This is an example of the console output when starting a NodeBB Docker instance. It indicates that the configuration file was not found and the web installer is launching on port 4567. ```logs 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 ``` -------------------------------- ### Configure Redis: Start Redis Server Source: https://docs.nodebb.org/installing/os/macOS Starts the Redis server. This command is used after installing Redis to make it available for NodeBB. ```bash redis-server ``` -------------------------------- ### Enable and Start PostgreSQL Service Source: https://docs.nodebb.org/installing/os/fedora Configures PostgreSQL to start automatically on boot and starts the service immediately. ```bash systemctl enable --now postgresql ``` -------------------------------- ### Start NodeBB Application Source: https://docs.nodebb.org/installing/os/fedora Starts the NodeBB forum application as the 'nodebb' user. ```bash sudo -u nodebb ./nodebb start ``` -------------------------------- ### Run NodeBB Tests Source: https://docs.nodebb.org/development Commands to execute the test suite for NodeBB. You can run all tests using 'npm test' or target a specific test file using 'npx mocha'. ```bash npm test npx mocha test/your_test_file.js ``` -------------------------------- ### Install and Start NGINX Source: https://docs.nodebb.org/installing/os/macos-bigsur This snippet demonstrates how to install NGINX using Homebrew and start the NGINX service, ensuring it starts on system reboot. ```bash brew install nginx brew services start nginx ``` -------------------------------- ### Configure NodeBB Plugins for Testing Source: https://docs.nodebb.org/development This JSON configuration block allows you to specify which NodeBB plugins should be activated during testing. It takes an array of plugin names. ```json { "test_plugins": [ "nodebb-plugin-xyz" ] } ``` -------------------------------- ### Run NodeBB Setup Script Source: https://docs.nodebb.org/installing/os/fedora Navigates to the NodeBB directory and executes the setup script as the 'nodebb' user to configure the application. ```bash cd /opt/nodebb sudo -u nodebb ./nodebb setup ``` -------------------------------- ### Basic SCSS Styling Source: https://docs.nodebb.org/development/quickstart A simple example of SCSS code that could be included in a NodeBB plugin to define styles for the plugin's interface. ```sass $primary-color: #3498db; .quickstart-admin-settings { background-color: $primary-color; color: white; padding: 20px; border-radius: 5px; } ``` -------------------------------- ### Start NodeBB Application Source: https://docs.nodebb.org/configuring/databases/mongo Command to start the NodeBB application. It also mentions alternative methods like using supervisor or forever, and setting up nginx as a reverse proxy. ```shell ./nodebb start ``` -------------------------------- ### NodeBB Heroku Setup and Deployment Source: https://docs.nodebb.org/installing/cloud/heroku This snippet outlines the command-line steps required to set up and deploy a NodeBB application on Heroku. It includes cloning the repository, creating a Heroku app, configuring MongoDB, setting up a Procfile, and pushing the code to Heroku. ```bash heroku login heroku addons:create mongolab:sandbox heroku create echo "web: node loader.js --no-daemon" > Procfile git add -f Procfile config.json package.json build && git commit -am "adding Procfile and configs for Heroku" git push -u heroku v2.x:master heroku ps:scale web=1 ``` -------------------------------- ### Install and Run NodeBB with Forever Source: https://docs.nodebb.org/configuring/running This snippet demonstrates installing the Forever package globally via npm and then starting the NodeBB application using `app.js`. Forever monitors the NodeBB process and restarts it if it terminates unexpectedly. ```bash npm install -g forever forever start app.js ``` -------------------------------- ### Build and Run NodeBB with Grunt Source: https://docs.nodebb.org/development This snippet shows how to use Grunt to build NodeBB assets and run the application. Grunt can also watch for file changes and selectively rebuild assets, simplifying the development cycle. ```bash grunt grant --skip ``` -------------------------------- ### Start MongoDB Service Source: https://docs.nodebb.org/installing/os/windows These commands start the MongoDB service and query its status to ensure it is running. ```Shell net start MongoDB sc query "MongoDB" | findstr STATE ``` -------------------------------- ### Start NodeBB Application Source: https://docs.nodebb.org/installing/os/arch Starts the NodeBB forum application. NodeBB can also be managed using process managers like 'supervisor' or 'forever'. ```bash ./nodebb start ``` -------------------------------- ### Start NodeBB with Docker Compose Source: https://docs.nodebb.org/installing/cloud/docker This command starts a NodeBB instance using Docker Compose with a specified database profile. Ensure you have Docker Compose version 3.8 or higher installed. The `{DATABASE}` placeholder should be replaced with your chosen database (e.g., 'mongo', 'postgres', 'redis'). ```bash $ docker-compose --profile {DATABASE} up ``` -------------------------------- ### Install Grunt CLI and Run NodeBB Source: https://docs.nodebb.org/configuring/running This shows the installation of the Grunt CLI globally using npm. Running `grunt` afterwards will start NodeBB and also monitor for changes in code files, recompiling assets only when modified, which speeds up the development startup process. ```bash npm install -g grunt-cli grunt ``` -------------------------------- ### NodeBB Installation and Management Commands Source: https://docs.nodebb.org/faq This section covers essential commands for managing a NodeBB instance, including starting, stopping, and restarting the service. It also addresses common issues like password resets and upgrades. ```Shell node /path/to/your/nodebb/app.js --no-daemon # To stop NodeBB, you can usually kill the process: kill -SIGINT $(ps aux | grep "node app.js" | awk "NR==1 {print $2}") # To restart, stop it first and then start it again. ``` -------------------------------- ### Start NodeBB Service Source: https://docs.nodebb.org/installing/os/macos-bigsur This snippet starts the NodeBB application using its command-line utility. ```bash ./nodebb start ``` -------------------------------- ### NodeBB Plugin Core Logic (library.js) Source: https://docs.nodebb.org/development/quickstart The `library.js` file contains the main logic for a NodeBB plugin. It maps hook listeners defined in `plugin.json` to exported methods. For example, the `static:app.load` hook is mapped to the `init` method, which is responsible for setting up routes and mounting them to the express router. ```javascript const controllers = require('./lib/controllers'); const plugin = {}; plugin.init = async (params) => { const { router, middleware, controllers: siteControllers } = params.app; const routeHelpers = require('./lib/routeHelpers'); // Mount routes routeHelpers.mountRoutes(router, middleware, siteControllers); // Example: Registering a hook listener for user login // User.events.on('user:login:success', async (data) => { // console.log(`User ${data.user.username} logged in!`); // }); }; module.exports = plugin; ``` -------------------------------- ### Start NodeBB Application Source: https://docs.nodebb.org/installing/cloud/openshift Starts the NodeBB application on OpenShift after configuration. This command makes your NodeBB instance accessible via its public URL. ```bash cd ~/app-root/repo && ./nodebb start ``` -------------------------------- ### Start and Check MongoDB Service Status Source: https://docs.nodebb.org/installing/os/debian Starts the MongoDB daemon service and verifies that it is running. ```bash sudo systemctl start mongod sudo systemctl status mongod ``` -------------------------------- ### Start NodeBB Application Source: https://docs.nodebb.org/installing/os/centos Starts the NodeBB forum application. NodeBB can also be managed using process managers like 'forever' for persistent running. ```bash ./nodebb start ``` -------------------------------- ### Manage MongoDB Service Source: https://docs.nodebb.org/installing/os/ubuntu Starts the MongoDB service and checks its status to ensure it is running. ```bash sudo systemctl start mongod sudo systemctl status mongod ``` -------------------------------- ### Start MongoDB Service on macOS Source: https://docs.nodebb.org/installing/os/macOS This command starts the MongoDB Community Edition 7.0 service using Homebrew services, allowing it to run in the background. ```shell brew services start mongodb-community@7.0 ``` -------------------------------- ### Start Redis Server on Cloud 9 Source: https://docs.nodebb.org/installing/cloud/cloud9 This command starts the Redis server on a specified port (16379) and binds it to the instance's IP address. The '&' symbol runs the command in the background. ```bash redis-server --port 16379 --bind $IP & ``` -------------------------------- ### Configure NodeBB Test Database Source: https://docs.nodebb.org/development This JSON configuration block specifies the database connection details for running NodeBB tests. It includes host, port, username, password, and database name. ```json { "test_database": { "host": "127.0.0.1", "port": "27017", "username": "", "password": "", "database": "test" } } ``` -------------------------------- ### NodeBB Build Specific Assets Source: https://docs.nodebb.org/development Manually build specific parts of NodeBB assets like admin JavaScript, admin CSS, and templates. This command optimizes the development process by targeting only necessary components. ```shell ./nodebb build adminjs admincss tpl ``` -------------------------------- ### Troubleshooting Redis Startup Source: https://docs.nodebb.org/installing/cloud/cloud9 This command is used to restart the Redis server, often necessary when troubleshooting issues where the database hasn't started correctly. ```bash redis-server --port 16379 --bind $IP ``` -------------------------------- ### Upstart Configuration for NodeBB Source: https://docs.nodebb.org/configuring/running This Upstart script manages the NodeBB process, ensuring it starts on boot, stops on shutdown, respawns if it crashes, and runs with specified user permissions. It requires NodeBB to be installed in a specific path and uses the loader.js script to run the application. ```shell start on startup stop on runlevel [016] respawn setuid someuser setgid someuser script cd /path/to/nodebb node loader.js --no-silent --no-daemon end script ``` -------------------------------- ### NodeBB SmartOS Server Access Steps Source: https://docs.nodebb.org/installing/os/smartos Provides step-by-step instructions for accessing a SmartOS server instance. It covers signing into the Joyent account, creating a new instance, and logging in via SSH using provided credentials. ```Markdown 1. Sign in your Joyent account: Joyent.com 2. Select: `Create Instance` 3. Create the newest `smartos nodejs` image. > **Note:** The following steps have been tested with images: `smartos nodejs 13.1.0` `smartos nodejs 13.2.3` 4. Wait for your instance to show `Running` then click on its name. 5. Find your `Login` and admin password. If the `Credentials` section is missing, refresh the webpage. > **Example:** `ssh root@0.0.0.0` `A#Ca{c1@3` 6. SSH into your server as the admin not root: `ssh admin@0.0.0.0` > **Note:** For Windows users that do not have ssh installed, here is an option: Cygwin.com ``` -------------------------------- ### Navigate to NodeBB Directory Source: https://docs.nodebb.org/configuring/databases/mongo Command to change the current directory to the NodeBB root folder, necessary for running setup and start commands. ```shell $ cd /path/to/nodebb ``` -------------------------------- ### Deploy NodeBB on Elestio Source: https://docs.nodebb.org/installing/cloud/elestio Initiates the NodeBB deployment process on Elestio by clicking the 'Deploy' button. This action seamlessly sets up the NodeBB instance. ```Markdown ## Initiate Deployment Begin by clicking the "Deploy" button below to kickstart the deployment process. This will set up NodeBB on Elestio seamlessly. ``` -------------------------------- ### Start and Autostart MongoDB Service Source: https://docs.nodebb.org/installing/os/macos-bigsur Starts the MongoDB service and configures it to automatically start on system boot. ```bash brew services start mongodb/brew/mongodb-community@4.0 ``` -------------------------------- ### Install Node.js LTS on Ubuntu Source: https://docs.nodebb.org/installing/os/ubuntu Installs the latest LTS version of Node.js on Ubuntu using the NodeSource setup script. This ensures compatibility and simplifies future updates for NodeBB. ```bash sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg curl -fsSL https://deb.nodesource.com/setup_lts.x -o nodesource_setup.sh ``` ```bash sudo -E bash nodesource_setup.sh sudo apt-get install -y nodejs ``` ```bash node -v npm -v (should output "10.8.2" or similar) ``` -------------------------------- ### NodeBB Plugin Configuration (plugin.json) Source: https://docs.nodebb.org/development/quickstart The `plugin.json` file serves as the main configuration area for a NodeBB plugin. It defines the plugin's name, hook listeners, and associated files, allowing NodeBB to recognize and load the plugin. ```json { "id": "quickstart", "name": "Quickstart", "description": "A skeleton plugin for NodeBB.", "version": "1.0.0", "library": "./library.js", "hooks": [ { "hook": "static:app.load", "method": "init" } ] } ``` -------------------------------- ### Configure and Enable Redis Source: https://docs.nodebb.org/installing/os/centos Starts the Redis service and configures it to automatically start on system reboot. Redis is used as a database and cache for NodeBB. ```bash systemctl start redis systemctl enable redis ``` -------------------------------- ### NodeBB Configuration File Example (config.json) Source: https://docs.nodebb.org/faq Illustrates the structure of the config.json file used for configuring NodeBB. This includes settings for the port, database connection, and other essential parameters. ```JSON { "port": 4567, "database": { "type": "mongo", "host": "localhost", "port": 27017, "name": "nodebb", "username": "", "password": "" }, "redis": { "host": "localhost", "port": 6379, "password": "", "database": 0 }, "url": "http://localhost:4567", "secret": "YOUR_NODEBB_SECRET_KEY" } ``` -------------------------------- ### Install NodeBB Imgur Plugin Source: https://docs.nodebb.org/admin/uploads Installs the nodebb-plugin-imgur for enabling post image attachments in NodeBB. Refer to the plugin's GitHub page for setup instructions. ```bash $ npm install nodebb-plugin-imgur ``` -------------------------------- ### Install Latest Node.js LTS Source: https://docs.nodebb.org/configuring/upgrade Installs the latest Long Term Support (LTS) version of Node.js using NodeSource's setup script and apt-get. This ensures NodeBB has the necessary runtime environment. ```bash curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs ``` -------------------------------- ### Manage NodeBB Service with systemctl Source: https://docs.nodebb.org/configuring/running Commands to manage the NodeBB service using systemctl, including starting, stopping, and enabling the service to start on system boot. It also shows how to enable related services like mongod. ```bash systemctl start nodebb systemctl stop nodebb systemctl enable mongod systemctl enable nodebb ``` -------------------------------- ### Install NodeBB S3 Uploads Plugin Source: https://docs.nodebb.org/admin/uploads Installs the nodebb-plugin-s3-uploads-updated for enabling automatic Amazon S3 file storage in NodeBB. Consult the plugin's GitHub repository for detailed setup guidance. ```bash $ npm i @nodebb-community/nodebb-plugin-s3-uploads-updated ``` -------------------------------- ### NodeBB Installation on Cloudron Source: https://docs.nodebb.org/installing/cloud/cloudron Instructions for installing NodeBB on Cloudron, a platform for self-hosting web applications. NodeBB is available on the Cloudron Store, with automatic backups and updates. ```Markdown # Cloudron The following are installation instruction for the Cloudron. Cloudron is a platform for self-hosting web applications. NodeBB is available on the Cloudron Store. Your NodeBB installation is backed up and kept up-to-date automatically. ## Demo You can try NodeBB on our demo installation (username: `cloudron` password: `cloudron`) ## Code The source code for the package is available here. Made with Material for MkDocs ``` -------------------------------- ### NodeBB Child Theme CSS/LESS Example Source: https://docs.nodebb.org/development/themes Demonstrates how to set up a child theme by importing styles from a base theme like nodebb-theme-vanilla. ```LESS @import "nodebb-theme-vanilla/topics.less"; /* Your custom styles here */ ``` -------------------------------- ### Setup OpenShift Client Source: https://docs.nodebb.org/installing/cloud/openshift If the 'rhc app ssh' command fails, this command helps set up or reconfigure the OpenShift client, ensuring proper connectivity to your applications. ```bash rhc setup ``` -------------------------------- ### Start/Stop NodeBB with Executable Source: https://docs.nodebb.org/configuring/running NodeBB can be started and stopped using its executable. Alternatively, npm commands can be used for the same purpose. ```bash ./nodebb start ./nodebb stop npm start npm stop ``` -------------------------------- ### Clone NodeBB Repository Source: https://docs.nodebb.org/installing/cloud/openshift Clones the NodeBB Git repository from the provided URL onto your local machine. This is the initial step to get the NodeBB source code. ```bash git clone ssh://[code]@nodebb-[namespace].rhcloud.com/~/git/nodebb.git/ ``` -------------------------------- ### Start NodeBB Source: https://docs.nodebb.org/configuring/upgrade Starts the NodeBB application with logging enabled. This is the final step after the upgrade process is complete. ```shell ./nodebb start -l ``` -------------------------------- ### Start, Stop, Restart NodeBB Source: https://docs.nodebb.org/faq Use the `./nodebb` executable to manage the NodeBB server process. This includes starting, stopping, and restarting the application, as well as checking its status. ```shell ./nodebb start ./nodebb stop ./nodebb restart ./nodebb status ``` -------------------------------- ### Get Cloud 9 Instance IP Source: https://docs.nodebb.org/installing/cloud/cloud9 This command prints the global IP address of the Cloud 9 server instance to the console, which is needed for NodeBB configuration. ```bash echo $IP ``` -------------------------------- ### Increase MongoDB Connection Pool Size Source: https://docs.nodebb.org/configuring/databases/mongo Example of how to configure the connection pool size for the MongoDB Node.js driver by adding a 'poolSize' setting in the NodeBB config.json file under the 'mongo' block. ```javascript { "mongo": { "poolSize": 5 } } ``` -------------------------------- ### Define NodeBB Client-Side Module (JavaScript) Source: https://docs.nodebb.org/development/quickstart Demonstrates how to define a client-side module for NodeBB using require.js. The module is registered with a specific name, and NodeBB automatically executes an `.init()` method if it exists when the module is required. ```javascript define('admin/plugins/quickstart', function() { var Module = { init: function() { // Your initialization code here console.log('Quickstart admin module initialized!'); } }; return Module; }); ``` -------------------------------- ### Install Base Software Stack Source: https://docs.nodebb.org/installing/os/fedora Installs essential software for NodeBB, including Git, Node.js, PostgreSQL server, and SELinux policy utilities. ```bash dnf install -y git nodejs postgresql-server policycoreutils-python-utils ```