Andrew SB
We hope you find this tutorial helpful. In addition to guides like this one, we provide simple cloud infrastructure for developers. Learn more →

How To Use the MEAN One-Click Install Image

PostedSeptember 23, 2014 51.5k views One-Click Install Apps MEAN MongoDB Node.js DigitalOcean

MEAN is a quick start boilerplate for creating applications based on MongoDB, Node.js, Express, and AngularJS. DigitalOcean's MEAN One-Click Application pre-installs the Mean.js implementation of the stack. It also comes with the front-end package manager bower and grunt, a tool for automating JavaScript tasks. Together, these tools provide a solid base to build your web application.

Creating the MEAN Droplet

You can launch a new MEAN instance by selecting MEAN on Ubuntu 14.04 from the Applications menu during droplet creation:

Once you have created the droplet, connect to it via the web-based console in the DigitalOcean control panel or SSH:

ssh root@your.ip.address

Launch the project

A sample MEAN project is installed at /opt/mean To launch it, simply change to that directory and run grunt:

cd /opt/mean

It will now be available at http://your.ip.address:3000

Developing your application

The MEAN sample project provides you with a template on which to build your application. Let's look at the folder structure:

root@meanjs:/opt/mean# ls
app         config      fig.yml       karma.conf.js  node_modules  Procfile
bower.json  Dockerfile  gruntfile.js     package.json  public    server.js

The app folder contains the server-side Model View Controller (MVC) files. Mongoose is used to communicate with the MongoDB instance which is available at

Th config folder contains the configuration files for your application. This includes developer credentials for the social login feature provided by Passport. The template supports five social platforms out of the box: Facebook, Twitter, Google, Linkedin, and Github. If your application needs to send mail, you can also configure your Nodemailer settings here as well.

The public folder contains all of the static files for your application. You can use bower to install additional front-end libraries for use in your app. For instance if you need JQuery, it can be installed with:

bower --allow-root install jquery

It will now be installed to public/lib/jquery/

Deploying your own

If you already have an application built on the MEAN stack, there's no need to use the sample project. This image provides you with a pre-installed Node environment with MongoDB running on

Simply remove the existing project and deploy yours as you normally would:

rm -r /opt/mean
cd /opt/
git clone
cd your_project
npm install
NODE_ENV=production PORT=80 grunt

Further information

For more detailed information on the MEAN stack check out the the docs at Mean.js. To learn more about running MongoDB and Node, check out their respective tags here at DigitalOcean:


Creative Commons License