Skip to content
Setup for my osx development stack
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A set of instructions for installing my development stack on OSX (Lion). You may also need root for some of these commands! Run all of these commnds from the root of this repository.

Install the basics

Make sure you have the latest version of XCode, with the command line tools installed. Also be sure the path to the command line tools is in your $PATH variable.

Install homebrew

/usr/bin/ruby -e "$(/usr/bin/curl -fksSL"

Install git

brew install git git-flow

 Update homebrew

brew update

Get the extra homebrew library

git clone git:// /usr/local/LibraryAlt





brew install riak\
riak start


brew install mysql \
&& sudo mkdir -p /Library/LaunchAgents \
&& sudo cp LaunchAgents/homebrew.mxcl.mysql.plist /Library/LaunchAgents/ \
&& sudo launchctl load /Library/LaunchAgents/homebrew.mxcl.mysql.plist \
&& sudo mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp


The Homebrew formula does not create a "postgres" user, as was common up to this point. Out of the box, you authenticate against the DB using the same user account under which you ran brew install. It's perfectly acceptable to leave it that way on your Dev machine. Don't forget to change that if this is a Production environment.

brew rm postgresql --force \
&& brew update \
&& brew install postgresql --without-ossp-uuid \
&& initdb /usr/local/var/postgres \
&& cp /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ \
&& launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist \
&& pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start


brew install redis \
&& sudo mkdir -p /Library/LaunchAgents \
&& sudo cp LaunchAgents/homebrew.mxcl.redis.plist /Library/LaunchAgents/ \
&& sudo launchctl load /Library/LaunchAgents/homebrew.mxcl.redis.plist


brew install memcached \
&& sudo mkdir -p /Library/LaunchDaemons \
&& sudo cp LaunchDaemons/homebrew.mxcl.memcached.plist /Library/LaunchDaemons/ \
&& sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.memcached.plist

Web stack

PHP (with fpm, mysql and other extensions)

brew install /usr/local/LibraryAlt/duplicates/php.rb --with-fpm --with-mysql \
&& brew install gearman-php memcached-php mongo-php xdebug-php xcache-php redis-php imagick-php
&& cp Config/php.ini /usr/local/etc/php.ini \
&& cp Config/php-fpm.conf /usr/local/etc/php-fpm.conf \
&& sudo mkdir -p /Library/LaunchDaemons \
&& sudo cp LaunchDaemons/org.php-fpm.plist /Library/LaunchDaemons/ \
&& sudo launchctl load /Library/LaunchDaemons/org.php-fpm.plist

PHP XDebug (if you don't install it from above)

brew tap josegonzalez/php \
&& brew install josegonzalez/php/xdebug-php

Make sure you add the following to your php ini (usually /usr/local/etc/php.ini)



sudo pear config-set auto_discover 1 \
&& sudo pear install

Make sure you have the following in your path



brew install nginx \
&& sudo mkdir -p /Library/LaunchDaemons \
&& sudo cp -r Config/nginx /usr/local/etc/nginx \
&& sudo cp LaunchDaemons/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/ \
&& sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist


Run the following commands to configure apache (the version that comes preinstalled). Don't forget to enable web sharing!

sudo cp Config/apache/includes.conf /etc/apache2/other/ \
&& sudo cp Config/apache/php.conf /etc/apache2/other/ \
&& sudo cp Config/apache/directory.conf /etc/apache2/other/ \
&& sudo cp Config/php.ini /etc/php.ini \
&& sudo apachectl restart

Node.js (and npm)

brew install node \
&& curl | sh


git clone git:// /tmp/rubygems \
&& OLD_PATH=`pwd` \
&& cd /tmp/rubygems \
&& sudo ruby setup.rb \
&& cd .. \
&& rm -rf rubygems \
&& cd $OLD_PATH


curl -L | bash -s stable \
&& source ~/.rvm/scripts/'rvm' \
&& rvm install 1.9.3 \

Make sure you add the following to your bash profile (usually ~/.profile)

source ~/.rvm/scripts/'rvm'



gem install teleport
Something went wrong with that request. Please try again.