How I Set Up My Mac Development Machine

Two recent articles here on SitePoint talked about how people set up their development environments. Zack Wallace talked about setting up a Windows development environment, and Shaumik Daityari talked about his experience working with Ubuntu Linux.

In this article, I want to talk about how I set up a development environment on Mac OS X. But first, a little bit of background.

I’m a freelance software developer and technical writer. Given that, I need a wide variety of tools on a regular basis, whether they’re for software development, research, writing or experimentation.

--ADVERTISEMENT--

It definitely is demanding having to cover everything from managing code, accessing remote servers and managing databases to writing and reviewing content. However, the great thing about the Mac is that there are so many tools available for it.

The Basic Tools

New Macs come with the iWork suite, Safari, Preview and The Unarchiver, amongst a range of other GUI tools. On the command line, they come with various open source tools, such as SSH, Wget, and cURL. However, these alone aren’t enough. To do proper web development, and technical writing, we need a number of others. Specifically, I regularly use a combination of the following:

These tools are pretty much indispensable on a day-to-day basis.

Dropbox and Google Drive allow me to share files with clients. I could use the in-browser versions, but installing the apps makes syncing even simpler.

And no web development environment would be complete without all of the modern browsers. As Internet Explorer isn’t supported on the Mac, like Zack, I use a range of tools – such as BrowserStack – for testing sites in IE.

Pixelmator and Skitch make it simple to edit and make annotations to images. Pixelmator isn’t free, but isn’t that expensive either. You could use GIMP instead, but I find its interface leaves a lot to be desired.

For making and storing notes, I use Evernote. It’s definitely got that space nailed. And all I need for project management is Wunderlist. With it, I can stay on top of all the work I have to do for each client, as well as keep notes about conversations we’ve had and what I still have to do.

The Editors

But now let’s get in to the more serious stuff: editing. I do two types of editing – content and code – so my discussion of editors will reflect that. Regardless of which one you’re doing, there are several very good editors available for the Mac.

When I write, I write in Markdown format. It lets you write structured content in any text editor, without the need for special software (such as Microsoft Word) which can leave you at the behest of one vendor or another. Using tools such as Pandoc, you can export your content to nearly any other file format.

Writing Apps

The MacVim editor

For writing in Markdown, there are several great native apps available, including MacDown, iA Writer and Writer Pro and Mou. Heck, you could even use TextEdit, though it’s not really well suited to the task. In addition, there are various online Markdown editors, including Gingko, Draft and Bruno Škvorc’s favorite, StackEdit.

I’ve tried and can vouch for all of these, though I don’t use them on a regular basis. For me, the best tool to use is Vim, ideally MacVim. It does take a little bit longer to set up and configure. But once done, it’s amazing. What’s more – it’s free. If you’re keen, or struggling, checkout my Vim configuration repository on GitHub.

Coding Apps

The PhpStorm IDE

Next there’s code. The Mac has a number of code editors available, irrespective of whether you’re a PHP, Python, Ruby, Go, Haskell or C++ developer.

There’s the ever present, excellent quality Sublime Text 3, which I’ve used often and happily attest to. There’s also TextMate 3, which is light, simple and extensible. But for me, my go-to editor of choice is PhpStorm. Based on IntelliJ, it just does so much; and what it doesn’t do natively, there’s likely a plugin for. Having said that, it’s not free. But the price really isn’t that much, especially when you weigh up the benefits.

Version Control

SourceTree version control software

Next, let’s look at version control. Whether I’m writing or coding, I always use version control. And my version control system of choice is Git. To me, that’s a no-brainer. However, you may be equally as comfortable using Mercurial. If you’re using Subversion, OK. But I can’t honestly support CVS.

Using Git as my frame of reference, there are several good tools for Mac to choose from. Firstly, there’s the more simplistic GitX. Open-source and free, and a Mac clone of Linus Torvolds’ GitK, it provides the key functionality required to manage a Git repository and provides a nice built-in diff viewer.

Then there’s the powerhouse SourceTree. If you’re looking for one app that does it all, one actively developed by a large corporate focused on developer tools, Atlassian, then don’t go past SourceTree. I used it for ages (before I committed to Git from the command line) and it’s excellent.

I’ll also give an honorable mention to SmartGit as well.

Of these three, the one that I’ve used the most, and highly recommend, is SourceTree. However, as with MacVim being my text editor of choice, I manage my Git repositories from the command line. (I’m not going to suggest that you should use the command line too. But I will say that it’s worth the investment of time to learn how to use it, as it does help you become a lot more productive. That being said, if you’re not a command line person, SourceTree is the way to go!)

The Server

For servers, I take one of two options. I either use built-in servers, such as those with Ruby and PHP, and run without the overhead of much additional software, or I run up a virtual machine. I’ve used VirtualBox and Ubuntu Linux for this, but increasingly I create my own using Ansible and Vagrant.

There’s a whole series of tools that you can call on, and by default there are lots of language libraries and extensions that don’t come with binaries installed on the Mac, and even the versions that are installed may not be new enough. To get around this, I use Homebrew, one of two excellent package managers for the Mac.

Homebrew works similarly to APT and yum on Linux, in that you can search a package repository and install, upgrade, and configure packages using it. For a good understanding of how it works and what it offers, check out Homebrew’s online documentation.

The Database

The Navicat Lite database tool

For database work, I mostly use MySQL. I guess you could put that down to my PHP heritage. But I also regularly work with both PostgreSQL and SQLite as well. To install any of these databases, you can download them from their respective vendors, via the links.

Whilst I’d like to think of myself as a hardcore command line guru, I’m not when it comes to databases. For that I’ve been using Navicat Lite for some years. It’s an excellent tool that provides uniform access to a wide number of databases.

Navicat not only supports MySQL, PostreSQL and SQLite, but also Oracle and SQLServer. It allows for painless creation of any schema element, creating and running queries by hand, searching, creating and updating records – everything you’d expect from a database management tool.

Outside Access

For outside access, I regularly use the SSH library of tools, whether that’s SSH-ing to a remote server, or copying files to or from my development environment. In addition to that, I also regularly use cURL and Wget for grabbing files and for running requests against APIs and performing website interaction.

But if you’re not so command line inclined, there are some really good GUI tools. There’s the venerable FileZilla, as well as the more slick looking Cyberduck and Transmit. Each of these three tools will allow you to manage files remotely with just your mouse.

Wrapping It Up

And that’s how I get my environment set up with all the tools I need. I admit that I do use the command line and command line-type tools quite heavily. But I’ve also covered a number of GUI tools that you can use in their place as well, if that’s your preferred style.

Despite the derisive comments people often make about the Mac, be in no doubt – there is an abundance of software available for it. And because of its BSD heritage, it has access to the open source and Posix-compliant tools as well. So no matter which way you go, you have a wide array of tools at your disposal when working and developing on the Mac.

So, how does my setup compare with yours?

Replies

  1. Thanks for your feedback @jeb_baxley. I do, for the most part myself. But I like a mix of whatever works best for me, or whatever combination I feel most comfortable and productive with. What other tools do you use?

  2. I do more than just dev work. I also do sys admin work. So a lot of the tools that I use are for that as well.

    For a VM I like virtualbox - it's simple enough and does what I need from it

    I use VIM on the cli and SublimeText for working on anything that involves text - be it coding or configuring a system.

    For version control, git is awesome. I like to use the gui from github on the mac - as it just makes it easier to deal with. I have setup a gitlab repo at work for and on that I use the cmli with the .ssh/config setup to make it easier.

    I did like Evernote - but started to worry about what I put in there. So I stopped using it and moved to Zimwiki for my documentation. I don't really have a notes workflow at the moment. Right now, I'm using a cron job to sync my zimwiki files back to a gitlab installation for backup and version control.

    For databases, I usually cli it - but have used workbench from mysql. On my mac, i use Sequel Pro - it's fantastic.

  3. Hi @oddz, thanks for your feedback. I'm not much of a designer, so don't use the Adobe suite much. I can't recommend VIM enough for manipulating any kind of text. But I must say, it definitely has an initially steep learning curve. There's a range of Markdown editors, each with varying pros and cons. If you get hooked on the format, there's no going back. It, along with Pandoc, is just so flexible.

  4. Quite similar to my setup, I just want to give a thumbs up for Coda. As you, I use PhpStorm, but for HTML and CSS, Coda is where I go. Also, Sequel Pro is on my list. If there are someone out there dabbling in MySQL, seriously give Sequel Pro a try. Awesome program.

  5. You can just use a php version manger like php-version, phpbrew, or phpenv -- just like you would managing ruby versions with rvm. Granted, I've been meaning to check out vagrant to see how it could improve my workflow, but I, for one, like having my machine be my server. For one, I have a dedicated IP (or you could just use dyndns) so I can easily SSH into my home dev machine from anywhere, make changes, and see them reflected on the web. I'm not sure if this sort of flexibility is available with a virtual machine solution.

15 more replies