Web
Article

How I Set Up My Mac Development Machine

By Matthew Setter

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.

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?

Comments
jeb_baxley

Nice article. Thanks for sharing. I tend to use more open source tools myself, but really enjoy Sublime Text as well.

settermjd

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?

jeb_baxley

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.

oddz

You have a similar set-up to me.

  • PHPStorm
  • TexWrangler
  • Adobe Creative Suite
  • Vagrant
  • MySQL Workbench
  • SourcreTree
  • Hangouts
  • Microsoft Office

Using markdown instead of word sounds interesting but also a pain in the arse. I might explore that some. Also, looking into something better than TextWrangler

settermjd

I kept my focus primarily to dev work, as that, and technical writing, is what I do the most. But thanks for mentioning the sys admin aspect; which I overlooked. I'd love to code more with VIM, in contrast, I find that for manipulating text, VIM is second to none.

I know what you mean about Evernote. I think they're ok, but the question sits at the back of your mind, whether you can really trust all of your data to one location. Have you tried Paperwork?

I used to use the GitHub gui, but didn't use it for long. Gitlab, though I've not used it much, is pretty damn good. Thanks again for sharing. Always helpful to know how other people work, and about other tools

settermjd

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.

puslefot

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.

johnhutch

That's... that's so much work. Why not just run a few scripts? The terminal is your friend!

http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac

Also, if you're using vim for MarkDown, why not use it for everything? It can do everything and more that any other standalone editor can do.

And since you're already in the terminal, why bother leaving to use GitK? Just use git right there in the terminal. Hell, install the fugitive vim plugin and use git right from within Vim! And while we're at it, might as well use the terminal to browse your databases as well. No point in opening up some GUI there, either.

Point is, CLI EVERYTHING FOREVER. Except your browser and photo editors. CLI is rubbish at that.

oddz

One reason to use vagrant instead of running php and apache on the same machine is to run multiple versions of php. Another would be installing stuff on a Linux machine is always so much easier. Not to mention you're not clobbering your host machine with dev software installs that could potentially be destructive to the os. I also work on a variety of projects using different versions of software not just php. It is much easier to manage different projects on dedicated vm than it is on a single host machine because upgrading anything has the potential to affect all projects on the machine. With dedicated vm so long as the project is on a different vm installing and/ or upgrading libraries and extensions will have no impact to projects hosted on a different vm.

benhanks040888

For me it's:

Sublime Text 3 for IDE
SourceTree for Git stuff
Sequel Pro for MySQL
Transmit for FTP
Raindrop for Bookmarking
Slicy for slicing images
imageOptim & imageAlpha & JPEGMini for image optimization

johnhutch

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.

lukaswhite

My set-up is pretty similar, by-and-large. But two honourable mentions;

iTerm2 is a really good, drop-in replacement for Terminal; great if you work on the command-line a lot, as I do.

And the app - well, strictly speaking it's a Chrome packaged app - I find myself using almost as much as my trusty editors is Postman. Perfect for testing API's, as well as debugging HTTP requests.

Both are free, which is nice.

settermjd

Lukas, thanks for sharing. iTerm2 and Postman. I don't know how I overlooked these two. Postman is something, in my current project, I can't live without. It's a great app, definitely worth using. I'm not as experienced with iTerm2; but should also give an honourable mention to screen and Terminator; Though I've never gotten Terminator working properly on OS X; yet.

settermjd

Ben, thanks for your input. I used to use Transmit a bit, and definitely found it a well polished application. I've not used Raindrop or Slicy, but will definitely check them out. imageOptim I can't speak of more highly. Great app, does a great job and painless to use.

settermjd

John, thanks for the link - what a wealth of information. I'm coming up to reinstalling my Mac, to see if it gives me a speed boost and drive space saving. I'll definitely be checking out those scripts. I'd heard of it a while ago, but never put time in to investigating it fully. I love the CLI, but a good GUI, depending on what it's meant to do, still has a place. WRT browsers, I believe there's a vim browser, believe it or not.

settermjd

I'm still a bit mixed on installing dev tools in OS X versus just using a VirtualBox or Vagrant VM. Sometimes it feels much cleaner, more efficient and organised to keep everything dev-related in a VM. Thanks for the links to php-version, phpbrew etc. rvm is great, so if these tools can do the same for PHP, I'm up for giving them a try.

Greg_Blass

Nice! You forgot to mention:

Both have become a vital part of my development workflow.

bob_cruickshank

I really like the idea of a single management console for all the different databases, but I can't find the Navicat Lite download. Do you just sign up for a trial and never upgrade?

Just a little direction would help. Thanks

StevenHu

The trial period is limited. See the online link.

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Instant Website Review

Use Woorank to analyze and optimize your website to improve your website to improve your ranking!

Run a review to see how your site can improve across 70+ metrics!

Get the latest in Front-end, once a week, for free.