How To Install Mozilla Open Badges On Linux Server

Last Updated on

Mozilla Open Badges
Installation Steps

It provides an open set of specifications, tools and services for generating verifiable badges that users can take with them wherever they go and use however they like.

The latest open standard can be found in the new assertion specification:
The assertion includes the open standard and the metadata specifications.

For more information, Please check out


Here are the steps to install openbadges in Ubuntu-11.10:

Setup a MySQL database. Create a database and a user with full privileges on that db. For example:

mysql> CREATE DATABASE openbadges;
mysql> GRANT ALL PRIVILEGES ON openbadges.* TO badgemaker@localhost IDENTIFIED BY ‘secret’;
mysql> CREATE DATABASE test_openbadges;
mysql> GRANT ALL PRIVILEGES ON test_openbadges.* to badgemaker@localhost IDENTIFIED BY ‘secret’;

Copy the openbadges/lib/environments/local-dist.js to openbadges/lib/environments/local.js and edit the configuration to match your local development environment. The MySQL database credentials should match step #1. For example:

database: {
driver: ‘mysql’,
host: ‘’,
user: ‘badgemaker’,
password: ‘secret’,
database: ‘openbadges’

Install external tools:

PhantomJS: We use PhantomJS for running unit tests. On a debian based Linux system
you can run sudo apt-get install phantomjs to install and run phantomjs –version to check
it is installed. For other systems you can try downloading and installing it or building it
from source.

Install local dependencies: npm install

Install submodules: git submodule update –init

Run the test suite: npm test

Start your server: npm start


Install phantomjs:

sudo apt-get update
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
git clone git://
cd phantomjs
git checkout 1.9

Create a link for phantomjs/bin/environments/phantomjs

ln -s phantomjs/bin/environments/phantomjs /usr/bin/phantomjs

Install nodejs version 0.8.x, Sometimes it becomes very tidy to get its accurate version for
the application. So here we have NVM to resolve this issue:

To install NVM use this script:

curl | sh


wget -qO- | sh


To download, compile, and install the latest v0.8.x release of node, do this:
# nvm install 0.8

And then in any new shell just use the installed version:
# nvm use 0.8
Or you can just run it:
# nvm run 0.8

If you want to see what versions are installed:
# nvm ls

If you want to see what versions are available to install:
# nvm ls-remote

To restore your PATH, you can deactivate it.
# nvm deactivate

To set a default Node version to be used in any new shell, use the alias ‘default’:
# nvm alias default 0.8

Optional: A real hostname

I like to be able to use http://openbadges.local for accessing the project. Assuming you used vagrant, you can change the hostname inlocal.js and do sudo echo “ openbadges.local” >> /etc/hosts to make it happen.

Database Migrations
If you need to modify the database schema, you’ll want to create a migration. You can do this as follows:

Come up with an alphanumeric name for your migration, e.g. add-issuer-column.

Run ./bin/db-migrate create add-issuer-column. This will create a new JS file prefixed with
a timestamp in the migrations directory. Something like the following should be displayed:

[INFO] Created migration at


Edit the new JS file as per the node-db-migrate instructions.

Try out your migration using ./bin/db-migrate up.

Try rolling back your migration using ./bin/db-migrate down.

And finally, note that during development, npm start automatically runs ./bin/db-migrate up for you. For production use, you’ll need to manually run this command yourself whenever you deploy changes that involve a schema change.



The codebase behaves slightly differently when run in an environment where environment variable NODE_ENV=production. These differences include:

less verbose logging using precompiled templates for client-side rendering run bin/template-precompile to generate “Test Site” banner will not show in the UI

References and Help:

Blog Media Entertainments Non Profit & Governments
Previous reading
7 Things To Look Forward To In Drupal 8.0
Next reading
Top 10 Reasons To Choose Drupal For Your Non Profit Site