-
Notifications
You must be signed in to change notification settings - Fork 275
Coder on OS X
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.
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.
-
Download the "Command Line Tools" package
-
Run the .dmg you downloaded and follow the instructions.
-
Open Terminal and run the following:
sudo xcode-select -switch /usr/bin
Coder runs on Node.js. So we'll need to install that first.
- Go to http://nodejs.org/download/ and get the Max OS X Installer (pkg).
- Follow the instructions to install Node.js on your machine.
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)"
You'll use git to download and fetch updates to the Coder source code.
brew install git
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
-
Get the latest version from git
cd ~/
git clone https://github.com/googlecreativelab/coder.git coder-dist
-
Install Coder's required node packages:
cd ~/coder-dist/coder-base/
npm install
-
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.
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.
-
Replace the default config with the localhost version:
cd ~/coder-dist/coder-base/
cp config.js.localhost config.js
-
Launch the coder localhost daemon.
node localserver.js
-
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.
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