Mortar has joined Datadog, the leading SaaS-based monitoring service for cloud applications. Read more about what this means here.

Install the Mortar Development Framework

To develop Pig and Hadoop scripts on your local computer, you'll first need to install the Mortar Development Framework. (If you don't already have a Mortar login, you can request a free trial here.)

Quick Installation (OSX, Linux)

You can install the Mortar Development Framework with one command on the following operating systems:

  • Mac OS X (10.8+)
  • Ubuntu (12.04+, 64-bit)
  • Red Hat/Centos (6.0+, 64-bit)

To perform the installation, open your Terminal application and run:

curl -sSL | bash

Logging into Mortar

If you don't yet have a Mortar login, you can request a free trial.


Once the Mortar Development Framework is installed and you have signed up for an account, open your terminal and run:

$ mortar login

Enter your Mortar credentials.
Password (typing will be hidden):

Authentication successful.

Set GitHub Username

Since Mortar snapshots your code to private Mortar repositories at GitHub, you'll be prompted for your GitHub username.

Please enter your github username (not email address).
GitHub Username: yourgithubusername

Setting GitHub username: Done!

Upon success, you will receive an email from GitHub inviting you to join the mortarcode organization.

Mortarcode GitHub Invite

Accept the invite, and you'll be ready to create private (or public, if you wish) projects in Mortar.

Checking Your GitHub Connection

In order to push code to GitHub, you'll need to be logged into GitHub with SSH.

To test whether your GitHub SSH login is active, run the following in a terminal:

$ ssh -T

Hi yourgithubuser! You have successfully authenticated, but GitHub does not provide shell access.

You should see a message saying that you've successfully authenticated to GitHub.

If you have a passphrase for your SSH key, have multiple SSH keys, or are trying out the Vagrant sandbox, you will want to use ssh-agent to add your keys. This helps avoid being prompted for a password or having to specify which key you want to use each time you run a mortar command. We use the common key path and name of id_rsa in the example below. Modify these settings to the key and path you set up when following the github instructions above.

First make sure you have the proper permissions on your key if you copied or moved it around.

chmod 0600 ~/.ssh/id_rsa

Next start ssh-agent and load your key.

ssh-agent /bin/bash
ssh-add ~/.ssh/id_rsa

Alternate Installation Methods (Windows)

Vagrant-based Installation

If you would like to try Mortar without installing anything on your local workstation or on a non Unix OS such as Windows, you can use our Vagrant-based sandbox installer.

First, you'll need to meet the following prerequisites:

  • VirtualBox 4.3.0 or later
  • Vagrant 1.5.0 or later
  • ~2Gb of disk space available for the virtual machine

With those prerequisites in place, follow these steps:

  1. Make sure you remove any prior Vagrantfile if you have run through these steps before (ensures you get the latest and greatest)
  2. Download the Mortar Vagrantfile
  3. Change to a local directory where you would like to run the Vagrant sandbox
  4. Copy the downloaded Vagrantfile to your working directory, making sure it stays named Vagrantfile
  5. Run vagrant up
  6. A VirtualBox window should appear where you can try Mortar by logging in with the username:mortar and password:mortar
  7. Double click the TRY_MORTAR icon on the desktop
  8. For the first run of the sandbox you will need to install Java in the vm which can be done via ./
  9. You will need to setup your github ssh keys in the sandbox - note that Vagrant makes use of the identity file id_rsa so you will need to choose a different name for your github keys in the vm
  10. When you are done run vagrant halt from your local workstation to stop the Vagrant sandbox

Rubygems-based Installation

You can also choose to install the Mortar Framework using Rubygems.

First, you'll need to make sure the following prerequisites are installed first:

Use your distribution's package manager to install JDK 6. Note that package installation directories change over time so your JAVA_HOME may be in a different directory then what is listed listed below. To confirm that your JAVA_HOME is correct after installation, you should check that $JAVA_HOME/bin/java exists.

Finally, install the Mortar framework via gem:

gem install mortar --no-rdoc --no-ri