How to Setup Otto on Mac OS X

Two weeks ago Hashicorp announced Otto to the world. You can read more about the background of what Otto is and why it was created on the HashiCorp blog. The short version is that is the successor to Vagrant and is designed to make using microservices and deploying your code to production easier.

Getting Started

Install Homebrew

I assume you are using Homebrew on your Mac. If you haven’t already installed it follow these steps:

Run the following command in Terminal to begin the Homebrew installation:

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The script will explain what the installation process will do and prompt you to confirm proceeding:

==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin

Press RETURN to continue or any other key to abort  

You will be prompted to enter your password so the installer can run as root and complete the installation:

==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin
Password: ***********  
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 196644, done.  
remote: Compressing objects: 100% (53260/53260), done.  
remote: Total 196644 (delta 142208), reused 196644 (delta 142208)  
Receiving objects: 100% (196644/196644), 40.52 MiB | 166.00 KiB/s, done.  
Resolving deltas: 100% (142208/142208), done.  
From https://github.com/Homebrew/homebrew  
 * [new branch]      master     -> origin/master
HEAD is now at c5ea5df multimarkdown 4.5.3  
==> Installation successful!
==> Next steps
Run `brew doctor` before you install anything  
Run `brew help` to get started  

Run brew doctor before you do anything else.

Install Cask

Homebrew Cask enables you to install OS X applications and large binaries using the same process used for Homebrew.

Run the following command in Terminal to install Cask:

$ brew install caskroom/cask/brew-cask

Install VirtualBox

The development environment for Otto uses VirtualBox, so you will need to install it first if you haven’t already. At the time of writing the latest version is 5.0.6. In the future Otto is supposed to install this dependency for you but for now follow these steps to install VirtualBox and its Extension Pack:

Run the following command in Terminal to install VirtualBox:

$ brew cask install virtualbox
==> Downloading http://download.virtualbox.org/virtualbox/5.0.6/VirtualBox-5.0.6-103037-OSX.dmg
######################################################################## 100.0%
==> Running installer for virtualbox; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> installer: Package name is Oracle VM VirtualBox
==> installer: Installing at base path /
==> installer: The install was successful.
🍺  virtualbox staged at '/opt/homebrew-cask/Caskroom/virtualbox/5.0.6-103037' (4 files, 87M)

Run the following command in Terminal to install the VirtualBox Extension Pack:

$ brew cask install virtualbox-extension-pack
==> Satisfying dependencies
==> Installing Cask dependencies: virtualbox
virtualbox ...  
already installed  
complete  
==> Downloading http://download.virtualbox.org/virtualbox/5.0.6/Oracle_VM_VirtualBox_Extension_Pack-5.0.6-103037.vbox-extpack
######################################################################## 100.0%
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%  
Successfully installed "Oracle VM VirtualBox Extension Pack".  
🍺  virtualbox-extension-pack staged at '/opt/homebrew-cask/Caskroom/virtualbox-extension-pack/5.0.6-103037' (16M)

Install Vagrant

Otto still depends on Vagrant for the development environment, so install or upgrade to the latest version:

Run the following command in Terminal to install VirtualBox:

$ brew cask install vagrant
==> Downloading https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4.dmg
######################################################################## 100.0%
==> Running installer for vagrant; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> installer: Package name is Vagrant
==> installer: Upgrading at base path /
==> installer: The upgrade was successful.
🍺  vagrant staged at '/opt/homebrew-cask/Caskroom/vagrant/1.7.4' (6 files, 82M)

Install Otto

Next you’ll need to download and install the binary package for Otto. The current version available is 0.1.1 and can be downloaded from the Otto downloads page. Here are the steps I followed for Mac OS X to install using Cask:

Run the following command in Terminal to install the VirtualBox Extension Pack:

$ brew cask install otto
==> Downloading https://dl.bintray.com/mitchellh/otto/otto_0.1.1_darwin_amd64.zip
######################################################################## 100.0%
==> Symlinking Binary 'otto' to '/usr/local/bin/otto'
🍺  otto staged at '/opt/homebrew-cask/Caskroom/otto/0.1.1' (13M)

Verify that Otto is installed

To verify that Otto is installed properly open a Terminal and execute the following command.

After installing Otto, verify the installation worked by opening a new terminal session and checking that otto is available. By executing otto, you should see help output similar to the following:

$ otto
usage: otto [--version] [--help] <command> [<args>]

Available commands are:  
    build      Build the deployable artifact for the app
    compile    Prepares your project for being run.
    deploy     Deploy the application
    dev        Start and manage a development environment
    infra      Builds the infrastructure for the Appfile
    status     Status of the stages of this application
    version    Prints the Otto version

If the output looks similar Otto is installed and ready for use.