How to install from scratch on Ubuntu 12.04

A quick note: Before choosing for your next project, you should be aware of this article by Amos Haviv, the former lead devloper at The article explains that was being forced into a commercial product, which prompted the creation of mean.js, an open-source fork by two founding developers that to date has much better community support and documentaion. I wrote a guide to installing mean.js from scratch on Ubuntu here, if you’d rather do that.

All that aside, here’s how to install from scratch on Ubuntu 12.04, complete with bash script you can just download and run on your machine.

I’ll update this periodically as this process changes. This article was last updated April 11, 2014.

First we need to install node.js, npm and bower.

# Update repositories
sudo apt-get update
# Install git
sudo apt-get -y install git
# Install build tools
sudo apt-get -y install build-essential
# Clone node.js source code
git clone
# Configure, make and install from source
cd node && git checkout v0.10.26-release
make && sudo make install

sudo npm install -g bower
sudo npm install -g grunt-cli

Before we can install, we need to install and start MongoDb.

# Add the mongo repository information and update
sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
# Install Mongo
sudo apt-get -y install mongodb-org

Next, let’s set up our tool and first project.

# Install the tool
sudo npm install -g meanio
# Create your new project
mean init myNewMeanProject
# Install dependencies with npm and bower
cd myNewMeanProject
sudo npm install
bower update
# Start your MEAN server on port 3000

Now, your server should be up and running with a default project! You can view your website by visiting

If you just want your website to run on port 80, the default http port, edit the ‘/server/config/env/all.js’ file and change this line

	port: process.env.PORT || 3000,

to this

	port: process.env.PORT || 80,


  1. it works!!!
    thanks 🙂

  2. This is brillliant! I was struggling with it the whole day and your post just helped me complete the installation in 10 mins! Awesome! Thanks a ton!

  3. Does not work. Followed the exact procedure, and I end up with a error that says it could not find local grunt.


Submit a Comment

Your email address will not be published. Required fields are marked *