You can configure it to install the database of your choice at the same time

Using the ShellScript to install Node.js and MongoDB

1: Create the configuration

Using the radio buttons and checkboxes select which Ubuntu Package Manager (UPM) and database you want to use, and whether you want to install the Cloud9 IDE. As you make changes you’ll notice the text to the right of the buttons changing reflecting your choices.

I have chosen the default UPM apt-get, MongoDB and also to install Cloud9.

2: Create the ShellScript file

You can use a text editor to create the file, or use the code provided to do it for you. Open a terminal window and paste the following:

cd ~/ nano -w node.sh

This makes sure you’re in your home directory and creates a file called node.sh, opening it in Nano. Nano is a text editor that runs in the terminal.

Paste the script that you configured into the text editor. It should look something like this:

Press Ctrl+X followed by Y to exit Nano and save the changes.

3: Run the ShellScript file

Paste this into terminal to run as administrator – you will be asked for your password.

chmod +x node.sh && sudo ./node.sh

When you enter your password the script will run, downloading and installing Node.js and anything else you selected.

For me this took about 5 minutes, but it will depend on the options you selected, and your internet connection speed. When everything is finished you’ll be presented with your normal terminal prompt. Mine looked like this:

All done, Node.js is installed!

A quick reboot, and there you have it! Node.js, NPM, MongoDB and Cloud9 IDE all installed in a few minutes. I told you it was pretty easy!