• Admin

    OK, this post will show you how to create a NodeBB Forum for yourself. Here’s what we will go over:

    • How to install Ubuntu 20.04 on your computer/an older computer/laptop (prefered)

    • How to install NodeBB Forum software (same as this website) on that machine, and how to

      • Obtain a Let’s Encrypt Certificate (to prevent the “This site is not secure” warning)
      • Use NGINX as a reverse proxy to connect to the site (to make it much, MUCH easier to connect to your site. Seriously, do this.)
      • Use MongoDB as your Forum’s Database (DB stands for Database), (where your website will store all its data)
    • How to get a free domain name (URL) to connect to your site, so people don’t have to type your IP.

    So, let us begin, shall we? While it may already sound complicated, we will go through it step by step, to make it much easier.

    The first step we will do is getting a free URL.-|
    So, open up a new tab and go to Freenom. (click this ➡ https://freenom.com)
    607d515e-e7a1-4b6c-84e5-57f8346434e2-image.png
    Do not click Get Free domain name yet, because it will not work if you are not yet logged in. Click sign in in the top right-hand corner and log in with either Google or your Email.
    Then, click Services > Register a New Domain.
    cffccc1b-10ac-42af-9fbf-7def5f5f1be8-image.png
    Now, you can type the domain you want into the slot that says, “Find Your New Domain.”

    Press enter, and either choose a free option or pay for one below if you would like to.

    37412414-4f20-4b09-9525-06e4bf423101-image.png
    Click Get it Now, then click the Green Checkout Button.
    Change “period” to 12 MONTHS @ FREE and click Continue.
    27ca037e-fb5e-4a4d-b2ea-8ffa69657026-image.png

    Click the Terms checkbox and then click Complete order. Leave this tab open, we will use it later.
    LIST OF TASKS:

    Get URL

    Install Ubuntu

    MongoDB

    Let’s Encrypt, Nginx, Port Fowarding

    Install NodeBB

    Installing Ubuntu-|
    As I’ve said before, you’re going to want to do this on another old computer that you have; You will not be able to do your everyday computer functions on a computer running Ubuntu (Ubuntu & Linux is very useful, but not for regular gamers/office computers)

    1. First, You’ll need a USB Drive at least 8 GB large that you won’t mind erasing.
    2. Next, you’ll need to download Rufus or find another way to fix an ISO file to a USB drive.
    3. Now just download this file.

    So, after installing Rufus, Open it up and your screen will look like this:
    e9c6740f-ac33-45ec-97c4-92a632f5c972-image.png
    Plug in the USB Drive and select the Ubuntu ISO File you downloaded earlier.
    Your screen should now look like this:

    057ad451-5db0-47ea-b587-374d3d2e942d-image.png
    Now change the format Options so that they look like this:
    d3a3d141-1883-4735-ba7c-0de5e3048d5c-image.png
    Now, click “START”. This will erase the drive. If it asks you whether to write in DD image mode or ISO image mode, select ISO image mode and click Next/OK/Enter.
    9cfe3a1a-888c-44a9-96c6-089649bf9588-image.png
    After it finishes, unplug the USB drive and close out of Rufus. Navigate over to your other old computer that you will install NodeBB on.
    Once you are here, make sure it is fully shut down. If it is dead, plug it in.
    You are going to have to get to the BIOS and boot from the USB drive. The method of doing this is different on many computers. (plug in the USB before booting up) On most HP Computers, if you repeatedly press ESC right after pressing the power button it will bring up a startup menu. Here is a list of BIOS entry keys for computer manufactures:

    • ASRock: F2 or DEL
    • ASUS: F2 for all PCs, F2 or DEL for Motherboards
    • Acer: F2 or DEL
    • Dell: F2 or F12
    • ECS: DEL
    • Gigabyte / Aorus: F2 or DEL
    • HP: F10
    • Lenovo (Consumer Laptops): F2 or Fn + F2
    • Lenovo (Desktops): F1
    • Lenovo (ThinkPads): Enter then F1.
    • MSI: DEL for motherboards and PCs
    • Microsoft Surface Tablets: Press and hold the volume up button.
    • Origin PC: F2
    • Samsung: F2
    • Toshiba: F2
    • Zotac: DEL

    After you’ve got to the Bios screen, get to the boot devices screen. It will probably show you what key to press to get there (typically one of the “F” keys on the top of the keyboard). Select the USB drive you have plugged in and wait for it to boot. Select “Ubuntu” if a dialogue appears. If you would like, hit CTRL + C to skip those checks that appear.

    Once it boots up, click “Install Ubuntu”
    4e11a0d9-09fe-4a01-b847-db75ac1df796-image.png
    Then fill out your Keyboard layout, Language, Time zone, etc.
    22e0e638-e96b-40fe-b3e4-2b0caecfb671-image.png
    Make sure the Next screen looks like this, then click continue.
    Leave the option, “Install alongside Windows Boot Manager”. This will not erase the files on the computer that you are using, but if you chose to erase them, do the other option.
    6fb3c360-7403-4141-8ae3-57d50fc25604-image.png
    I recommend changing it to at least 60 GB given to Ubuntu, leaving enough room for uploads from users. You can change it to be higher or lower if you would like to.
    Click Install Now, then click continue.

    e674c97e-10f6-400b-9f73-9bfcc27e2d71-image.png
    Fill out this info to what you would like.

    1f3c4ace-bc45-4cb1-a488-663c5ae328d9-image.png
    It truly doesn’t matter, but you need to remember the password, Or you won’t be able to install anything.

    Wait for it to finish installing, then restart. Take out the USB Drive, then press Enter when it says to.
    Boot into Ubuntu, and wait till it loads up.

    After it loads, go through the intro and stare at the home screen. If it looks like this, Ubuntu is successfully installed:
    5beca9a1-eb02-4ed5-8f84-a78e4d8b2230-image.png

    LIST OF TASKS:

    Get URL

    Install Ubuntu

    MongoDB

    Let’s Encrypt, Nginx, Port Fowarding

    Install NodeBB

    Instaling MongoDB

    Now that Ubuntu is installed, make sure you are connected to WiFi. Either plug in an Ethernet Cable or select your wifi and enter the password. (on the top right of the screen are the WiFi settings.)

    Before we install MongoDB, we will install Node.js which is the code that the forum runs on. press CTRL + ALT + T to open a terminal, and paste these commands in:

    TIP: In the Ubuntu Terminal, pasting text is the keyboard shortcut CTRL + SHIFT + V. - - - - - - CTRL + C is still copy.

    sudo dpkg-reconfigure tzdata
    

    then,

    sudo apt update && sudo apt upgrade -y
    

    then,

    sudo apt install -y git build-essential apt-transport-https
    

    If it helps, you may want to open this post on the Ubuntu computer so that you can copy & paste the commands.

    NOTE: When SUDO asks for your password, it is the same one you entered when setting up the computer. you might want to use the same password for this entire process to simplify it.

    Now run these commands one after another.

    sudo apt install curl -y
    
    curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
    
    sudo apt install -y nodejs
    

    Now run this command to be sure that both Node.js and NPM are installed:

    node -v && npm -v
    

    It should return this, but the numbers may not be exactly the same.

    v10.24.1
    6.14.12
    

    Now we can install MongoDB. Run this command to install:

    sudo apt install -y mongodb
    

    And now make sure that it is installed:

    mongo --version | head -n 1 && mongod --version | head -n 1
    

    Now, we will create a database and user for NodeBB:
    Type in

    mongo
    

    then type

    use admin
    

    We will now create a user, but in the following code, change the CREATE YOUR OWN PASSWORD to a secure password of your choice.

    db.createUser( { user: "admin", pwd: "CREATE YOUR OWN PASSWORD", roles: [ { role: "readWriteAnyDatabase", db: "admin" }, { role: "userAdminAnyDatabase", db: "admin" } ] } )
    

    EXAMPLE (click button):

    db.createUser( { user: "admin", pwd: "gggforum54", roles: [ { role: "readWriteAnyDatabase", db: "admin" }, { role: "userAdminAnyDatabase", db: "admin" } ] } )
    

    In this example, the password would be gggforum54. Make sure quotes are around the password.

    Make sure to remember this pas sword

    Now create a NodeBB Database:

    use nodebb
    

    now create a nodebb user, again do the same password from before in where it says SAME PASSWORD

    db.createUser( { user: "nodebb", pwd: "SAME PASSWORD", roles: [ { role: "readWrite", db: "nodebb" }, { role: "clusterMonitor", db: "admin" } ] } )
    

    Again make sure that the password you put there is surrounded by “quotes”.
    Now, leave the mongo shell by typing this:

    quit()
    

    Restart the MongoDB Service:

    sudo systemctl restart mongodb.service
    

    Now verify that your admin user can connect:

    mongo -u admin -p YOURPASSWORD --authenticationDatabase=admin
    

    This time, replace YOURPASSWORD with your password, but do not surround it with quotes. This works if it doesn’t say “Login failed”.

    Installing Nginx

    Now we will need to install nginx, the proxy that will connect you and your users to your forum.

    to do this, paste the following commands in one after another:

    wget https://nginx.org/keys/nginx_signing.key
    
    sudo apt-key add nginx_signing.key
    
    rm nginx_signing.key
    
    sudo -s
    
    printf "deb https://nginx.org/packages/mainline/ubuntu/ $(lsb_release -sc) nginx\ndeb-src https://nginx.org/packages/mainline/ubuntu/ $(lsb_release -sc) nginx\n" >> /etc/apt/sources.list.d/nginx_mainline.list
    
    exit
    
    sudo apt update
    
    sudo apt install -y nginx
    

    nginx should now be installed, run this command to check its version:

    sudo nginx -v
    

    Now, enable it, and run it:

    sudo systemctl enable nginx.service
    
    sudo systemctl start nginx.service
    

    nginx is now installed, and will automatically start as a system service when rebooting.

    Getting a Let’s Encrypt cert.

    Now we can get rid of security warnings. Run these commands:

    sudo mkdir /etc/letsencrypt
    
    git clone https://github.com/Neilpang/acme.sh.git
    
    cd acme.sh
    

    In the following command, replace YOUREMAIL@EMAIL.COM with the email address you would like your site to be contacted with. You can create a new GMail to put here by click this link. Here is the command to replace the YOUREMAIL@EMAIL.COM:

    sudo ./acme.sh --install --home /etc/letsencrypt --accountemail YOUREMAIL@EMAIL.COM
    

    Then, run these commands:

    cd ~
    
    source ~/.bashrc
    

Suggested Topics



Copyright :copy: 2021 GGG Realms | Terms & Policies