Introduction

NodeBB is an open-source forum software that uses Node.js. It is highly customizable and scalable. In this guide, we will show you how to install NodeBB with Nginx Proxy on a Windows VPS to ensure that your forum is well-protected, performant, and easily accessible.

Prerequisites

Before starting the installation, make sure you have the following:

  • A Windows VPS with administrative privileges.
  • Node.js and npm (Node Package Manager) installed on your system.
  • Access to the Windows VPS via Remote Desktop Protocol (RDP).
  • Internet access to download required packages.

Step 1: Install Node.js and npm

NodeBB requires Node.js to run, so the first step is to install it on your Windows VPS.

    1. Go to the official Node.js download page: Node.js Download.
    2. Download the LTS (Long-Term Support) version of Node.js for Windows.
    3. Run the installer and follow the on-screen instructions to complete the installation.
    4. After installation, verify Node.js and npm were installed correctly by running the following commands in PowerShell:
node -v
npm -v
  1. If both commands return version numbers, the installation was successful.

Step 2: Install MongoDB

NodeBB requires a database to store data, and MongoDB is one of the supported databases. To install MongoDB:

    1. Visit the MongoDB download page: MongoDB Download.
    2. Choose the Windows version and download the installer.
    3. Run the installer and follow the prompts to complete the installation.
    4. After installation, ensure MongoDB is running by executing:
net start MongoDB

Step 3: Install NodeBB

Once Node.js and MongoDB are installed, you can proceed with installing NodeBB.

    1. Open PowerShell on your Windows VPS and navigate to the folder where you want to install NodeBB.
    2. Run the following command to install NodeBB:
git clone -b master https://github.com/NodeBB/NodeBB.git
    1. Navigate to the NodeBB directory:
cd NodeBB
    1. Install the required Node.js dependencies using npm:
npm install
    1. Once the installation is complete, configure NodeBB:
./nodebb setup
  1. Follow the prompts to configure your NodeBB installation, including setting up the database and other necessary settings.

Step 4: Set Up Nginx as a Reverse Proxy

To access NodeBB through a domain or IP address, you need to set up Nginx as a reverse proxy. Follow these steps:

    1. Install Nginx for Windows. Download it from the official website: Nginx Download.
    2. Extract the downloaded Nginx zip file to a directory on your Windows VPS.
    3. Edit the Nginx configuration file, typically located at C:\nginx\conf\nginx.conf, to include a reverse proxy configuration for NodeBB:
server {
    listen       80;
    server_name  localhost;

    location / {
        proxy_pass http://127.0.0.1:4567;
        proxy_set_header Host $host;
        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;
    }
}
    1. Save the changes to the configuration file and restart Nginx.
    2. To start Nginx, open a command prompt in the Nginx folder and run:
start nginx
  1. Check that Nginx is working by visiting http:// or the domain name you configured.

Step 5: Start NodeBB

Finally, start the NodeBB application:

    1. In PowerShell, navigate to the NodeBB directory.
    2. Run the following command to start NodeBB:
./nodebb start
  1. NodeBB should now be running and accessible through the Nginx reverse proxy.

Step 6: Access NodeBB

Now that NodeBB is running and Nginx is set up as a reverse proxy, you can access your NodeBB forum by navigating to the server’s IP address or the domain you set up in the browser.

For example: http:// or http://yourdomain.com.

Conclusion

Congratulations! You have successfully installed NodeBB with Nginx Proxy on your Windows VPS. You can now customize your forum, add plugins, and start using it for your community.