Skip to content

Coder on OS X

Jason Striegel edited this page Jun 19, 2014 · 13 revisions

Caution: This is untested and unsupported, but if you don't have a Raspberry Pi and want to get Coder up and running on your Mac, here's a way.

Developer tools for OS X

Mavericks users: You'll also need to install the full XCode.

All users: Install the XCode command line tools. Grab Apple's developer tools from https://developer.apple.com/downloads/

You need an apple id and password.

  1. Download the "Command Line Tools" package

  2. Run the .dmg you downloaded and follow the instructions.

  3. Open Terminal and run the following:

    sudo xcode-select -switch /usr/bin

Install Node.js

Coder runs on Node.js. So we'll need to install that first.

  1. Go to http://nodejs.org/download/ and get the Max OS X Installer (pkg).
  2. Follow the instructions to install Node.js on your machine.

Install Homebrew

We'll use homebrew to install a few packages. Details at http://brew.sh

To install the brew binary, just paste this into Terminal:

  ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install git

You'll use git to download and fetch updates to the Coder source code.

  brew install git

Install Redis

If you want to have simple database support, you'll also want to install Redis. This is the same key-value database that is installed by default on the Coder image for Raspberry Pi.

  brew install redis
  ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents/
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Install Coder

  1. Get the latest version from git

    cd ~/

    git clone https://github.com/googlecreativelab/coder.git coder-dist

  2. Install Coder's required node packages:

    cd ~/coder-dist/coder-base/

    npm install

  3. Install all the core coder apps into the coder application directory:

    cd ~/coder-dist/coder-apps/

    ./install_common.sh ../coder-base/

You will see some errors here about not being able to stat a media directory. You can ignore that.

Configure Coder to run on localhost

There's a pre-made config file and a special server for running Coder on localhost without https. It's a good way to get up and running with a local development environment.

  1. Replace the default config with the localhost version:

    cd ~/coder-dist/coder-base/

    cp config.js.localhost config.js

  2. Launch the coder localhost daemon.

    node localserver.js

  3. Test it! Make a new tab and go to http://localhost:8080

When you're done, you can kill the server by hitting Ctrl-C in your terminal window.

Start the Coder server when you log in

The Coder server won't start up automatically. You'll have to launch it from the command line when you first log into your Mac. On the bright side, it's easier to see debug logs from the node daemon this way.

In Terminal:

cd ~/coder-dist/coder-base/
node localserver.js