Installing the MEAN stack on Ubuntu 14.04.3 LTS

  • Want a fresh pair of eyes?

    A lot of times we find an outside perspective can work wonders. If you'd like to send us your information, we have no problems listening and offering our thoughts.

Like Us On Facebook:  

UPDATE: After my computer crapped out I had to start it all again but on Ubuntu 14.04.03. There were a few updates to the instructions noted below.

I wanted to use the MEAN stack for a new skovr / Kango Labs project I’m working on called Jump! Here’s the current ‘in progress’ site. I didn’t have the mean stack on my main linux dev box so here’s the steps it took to get things going! I’m going to skip the formalities and just dive right in.

First, check which version of ubuntu are you using by running this command line:


lsb_release -a

Next – make sure you don’t have node or npm already buy running these commands. If you do have them it’ll show a version number and you may need to just update or uninstall to start from scratch.


node -v
npm -v

Ok now to start. Install node by running (from the docs here)


curl -sL https://deb.nodesource.com/setup | sudo bash –
sudo apt-get update
sudo apt-get install nodejs

UPDATE: I updated to 14.04.3 and the nodejs may have been updated as well so I needed to also do these 2 things at this point to symlink the ‘nodejs’ command to ‘node’ and to explicitly install npm. This article helped out


sudo ln -s “$(which nodejs)” /usr/bin/node
sudo apt-get install npm

If you are like me you’ll have a permissions problem with installing npm packages. Follow these steps here. Step 2 is what I had to use.

Then back to the mean.io docs to install gulp and bower by running


npm install -g gulp
npm install -g bower

And… then the mean cli


npm install -g mean-cli

Now you’re set right! NO you still need mongo (probably). By the way did you know that mongo db is web scale?

Lets check the version and see if you’ve already got it


mongod –version

I didn’t have it already so here is what I ran (based on docs here). These commands will import the public key, create a list file for mongoDB (for the list of releases), reload the package list and then install the latest stable release.
UPDATE: I needed to add –force-yes AND watch out for the smart quotes below on copy/paste


sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10
echo “deb http://repo.mongodb.org/apt/ubuntu “$(lsb_release -sc)”/mongodb-org/3.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org –force-yes

That all went smoothly so just start up the mongoDB service using this command.


sudo service mongodb start

You can check to see if it started ok by looking at the log


more /var/log/mongodb/mongod.log

I discovered that my instance didn’t start right! It should said “waiting for connections on port 27017” but instead I got a message about insufficient free space. Rather than looking for disk space to free up I added “smallfiles=true” to my /etc/mongodb.config file which limits the journal file size. That works because this is a dev box. After that, starting up mongo worked! I got this line in my log file


[initandlisten] waiting for connections on port 27017

Installation is done. Now on to the fun stuff – creating an app. That will be next time!


4 Comments

Jed Jamison » 19 Jun 2015 » Reply

What about the E (express) and the A (angular)?

    Jeremy Dost » 24 Jun 2015 » Reply

    The E and A are baked into the framework – so you get those when you install mean-cli and create a project. Unfortunately my computer crapped out on me so I have to reinstall on my new box and haven’t gotten back to it yet. The old computer had a liquid cooling system that broke and it spilled green goo all over the graphics card and motherboard! I’d never seen that before.

Ricardo Bandala » 18 May 2016 » Reply

Where: sudo service mongod start, should be mongodb. Great article, thanks for the help!

Have your say!

Have your say!

Message

Name *

Email *

  • Want a fresh pair of eyes?

    A lot of times we find an outside perspective can work wonders. If you'd like to send us your information, we have no problems listening and offering our thoughts.

Recent Posts
Tags
Archives