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.
- Go to the official Node.js download page: Node.js Download.
- Download the LTS (Long-Term Support) version of Node.js for Windows.
- Run the installer and follow the on-screen instructions to complete the installation.
- After installation, verify Node.js and npm were installed correctly by running the following commands in PowerShell:
node -v
npm -v
- 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:
- Visit the MongoDB download page: MongoDB Download.
- Choose the Windows version and download the installer.
- Run the installer and follow the prompts to complete the installation.
- 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.
- Open PowerShell on your Windows VPS and navigate to the folder where you want to install NodeBB.
- Run the following command to install NodeBB:
git clone -b master https://github.com/NodeBB/NodeBB.git
- Navigate to the NodeBB directory:
cd NodeBB
- Install the required Node.js dependencies using npm:
npm install
- Once the installation is complete, configure NodeBB:
./nodebb setup
- 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:
- Install Nginx for Windows. Download it from the official website: Nginx Download.
- Extract the downloaded Nginx zip file to a directory on your Windows VPS.
- 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; } }
- Save the changes to the configuration file and restart Nginx.
- To start Nginx, open a command prompt in the Nginx folder and run:
start nginx
- Check that Nginx is working by visiting http:// or the domain name you configured.
Step 5: Start NodeBB
Finally, start the NodeBB application:
- In PowerShell, navigate to the NodeBB directory.
- Run the following command to start NodeBB:
./nodebb start
- 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.