This guide is intended to be used as a reference for setting up your dev environment on macOS.

X code

Xcode is an integrated development environment for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iOS, iPadOS, watchOS and tvOS.

Download and install it from the App Store or from Apple's Website..

Install Xcode command line tools.

  
    xcode-select --install
  

Homebrew

The missing package manager for macOS.

Installation

Make sure you have the Xcode command line tools installed. Then install Homebrew with the following command.

  
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  

Path Setup

In order for programs installed via Homebrew to be executable, you'll need to add your Homebrew installation location to your $PATH. This should be done automatically. If it's not you can do the following:

Change your path by adding /usr/local/bin to your PATH environment variable. This can be done on a per-user basis by adjusting PATH in your ~/.bash_profile or if your using zsh you should also do this to ~/.zshrc

  
    echo 'PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
  

Then, either restart your terminal session or re source your profile ex:

  
    source ~/.zshrc
  

Check that everything works:

  
    brew doctor
  

If everything is ok you'll see Your system is ready to brew.

iTerm2

iTerm2 is an open source replacement for Apple's Terminal. It's highly customizable and comes with a lot of useful features.

Installation

Either download and install it from iterm2.com or with brew

  
    brew install --cask iterm2
  

ZSH

The Z Shell (zsh) is a Unix shell that is built on top of bash with additional features. I highly recommend installing a framework like Oh My Zsh. It makes dealing with configuration, plugins and themes alot easier.

Install with Homebrew (newer macOS already comes with zsh as the default shell):

  
    brew install zsh
  

Oh My Zsh

Oh My Zsh is an open source, community-driven framework for managing zsh. It comes with a bunch of features out of the box and improves your terminal experience.

Install

  
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  

If for w/e reason the install script does not set zsh as your default shell you can do it manually with this command:

  
    chsh -s $(which zsh)
  

Configuration

To customize edit your profile

  
    nano ~/.zshrc
  

Make your changes. I like to change the default theme to pygmalion, and add a few plugins like git, brew, macos. You can find more themes and plugins on the official wiki.

To apply your new changes either restart your terminal session or

  
    source ~/.zshrc
  

Git

Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

Installation

  
    brew install git
  

Git Config Setup

  
    git config --global user.name "Your Name Here"
    git config --global user.email "Your Email Here"
    git config --global core.editor "nano"
  

PostgreSQL

PostgreSQL is an open source relational database management system (RDBMS). It is the default database for macOS server.

Installation

  
    brew install postgres
  

You can check the installed version with:

  
    postgres -V
  

To start the server use:

  
    brew services start postgresql
  

To stop the server use:

  
    brew services stop postgresql
  

To restart the server use:

  
    brew services restart postgresql
  

To start the console:

  
    psql
  

Other

Other stuff you might want to install includes: