Setting up a NodeBB Forum “for Dummies”

(Not a “dummy”? Head over to our wiki for advanced installation instructions.)



So I’ve been wanting to write a NodeBB setup guide for someone with pretty much no development experience at all – potentially somebody who’s never even seen a terminal in their life. I’m hoping it will reduce the barrier of entry for those wishing to try NodeBB out.

This guide will be using Digital Ocean* – but pretty much any host that gives you shell access will do. Digital Ocean is only $5 a month, which is as cheap as it gets for a host with SSH.

*DISCLAIMER: That’s a referral link, so if you spend $10 I’ll earn as much. Will spend it on more servers of course, because you can never have enough of ‘em. Thanks! :)

So on to the fun stuff. Click through for the installation guide complete with noob-friendly screenshots. :)




Setting up your server

Register for an account at Digital Ocean and add a credit card (you won’t be able to create a server without having one on file). Once you’re done, click on “Create droplet”.

Create a droplet

On the next screen, enter your desired hostname, ex. mynodebb. For your droplet’s size: 512MB should be more than enough for a small forum, so you can leave that intact. Then select a region where this server will be located (I chose New York 1).

Set up Droplet

Under “Select Image”, leave everything as default (ie. Ubuntu 12.04 x32). This is the operating system your server will be running. Lastly, click on the “Create Droplet” button.

Select operating system

Congratulations! Your server should be up and running in under a minute. Check your email; the server’s IP address and root password should have been emailed to you.

Note down your server’s IP address and root password – we’ll need them for the rest of this tutorial.



Logging into your server

On Linux / Mac

If you’re on Linux (surely you don’t need this tutorial?) or Mac, you can open a terminal window and type ssh root@<YOUR SERVER’S IP ADDRESS>

ex.

ssh [email protected]

and then enter your password when prompted.

On Windows

If you’re on Windows, download putty (direct link). Run it and you should see a configuration window. Under “Host Name (or IP Address)” paste your IP address and hit enter.

Logging into your server

You should see a security warning window, press Yes. You will be first prompted for your username; enter root. You will then be prompted for your password (tip: right click to paste and press enter).

login as: root
[email protected]
's password:

After logging in

You can change the root password now with the passwd command:

root@mynodebb:~# passwd



Setting up a new account on your server

Let’s set up an account for yourself which you can use to administer your server.

root@mynodebb:~# adduser psychobunny

You will be prompted to enter a password, and set up some optional profile information about yourself.

Finally, make this user a member of the sudo group to gain admin priviledges.

root@mynodebb:~# adduser psychobunny sudo

Now, lets logout of the root user

root@mynodebb:~# logout



Setting up the software to run NodeBB

First, login to your server using the same technique as above (See the Logging in to your server section), except replace root with your new account’s username (ie. psychobunny).

Once we’re in, we’ll make sure all our packages are up to date.

psychobunny@mynodebb:~$ sudo apt-get update

Let’s install the base software stack for NodeBB:

psychobunny@mynodebb:~$ sudo apt-get install git nodejs redis-server build-essential imagemagick

Press Y to confirm.

Let’s find out what version of Node.js was installed…

psychobunny@mynodebb:~$ node --version
v0.6.12

So NodeBB requires at least Node.js v0.8, so lets get on upgrading it.

psychobunny@mynodebb:~$ sudo apt-get install python-software-properties

Press Y to confirm. We’ll add chris-lea‘s PPA to your system.

psychobunny@mynodebb:~$ sudo add-apt-repository ppa:chris-lea/node.js

Press Enter to confirm. Let’s update Node.js now:

psychobunny@mynodebb:~$ sudo apt-get update && sudo apt-get dist-upgrade

Press Y again to confirm.

When you’re presented with some dialog boxes, just press enter to select the default option. (ie. “Keep the version that’s locally installed”).

After all that is done, lets verify that Node.js was updated to the latest version.

psychobunny@mynodebb:~$ node --version
v0.10.21

Yay! Almost there…



Setting up NodeBB

Okay we’re almost there, lets create a directory to host the NodeBB code base.

psychobunny@mynodebb:~$ mkdir mynodebb

And then lets clone the NodeBB repository into the mynodebb folder:

psychobunny@mynodebb:~$ git clone git://github.com/designcreateplay/NodeBB.git mynodebb

Enter the directory:

psychobunny@mynodebb:~$ cd mynodebb

Install NodeBB’s dependencies:

psychobunny@mynodebb:~/mynodebb$ npm install

And let’s finally set up NodeBB.

psychobunny@mynodebb:~/mynodebb$ node app --setup

You’ll be prompted with some questions. The only question you need to answer is the URL, which is http://<YOUR SERVER’S IP ADDRESS>.

URL of this installation (http://localhost) http://198.199.67.89

For the rest of the configuration questions you may press enter to select the default options. We’ll run through what the rest of these do on a later tutorial, but you safely ignore them for today.

After the server is configured, it will prompt you to create an administrator account for your NodeBB forum. Enter your username, email, and password.

Finally, we can run NodeBB:

psychobunny@mynodebb:~/mynodebb$ node app

Open your browser and navigate to http://<YOUR SERVER’S IP ADDRESS>:4567, ex. http://198.199.67.89:4567



Voila!

Your first NodeBB forum!



Developing with NodeBB

You can edit your files by connecting via FTP using software such as Filezilla. The problem is that every time you make a change to the codebase, you have to restart your server – which can get pretty annoying! To make life easier we can install supervisor, which monitors the files for you and restarts the server if it detects any changes:

psychobunny@mynodebb:~/mynodebb$ sudo npm install supervisor -g                 

Now all you have to do to run nodebb is:

psychobunny@mynodebb:~/mynodebb$ ./nodebb

Now any changes you make will force supervisor to automatically restart NodeBB for you.




Did you run into any problems while running through the install? Is there anything that you’d like me to cover on a later date? Leave a comment on the bottom and let me know! Thanks for supporting NodeBB – please head over to our Facebook page and Like us! :)


Comments