tePersonal macOS Workspace Setup

Nenad Novaković
HackerNoon.com
11 min readJul 2, 2018

--

This is my personal macOS workspace setup for web development. If you’d like to install latest technologies and stay up to date, follow my guide and you will enjoy using your macOS computer more than ever.

This post will remain updated, as this guide is based on personal preference.

Tested and working on macOS High Sierra, version 10.13.5.

Introduction

I will assume that you have a clean macOS installation. Together, we will go through every step and installation process. There won’t be mistakes! If you’re not interested in learning, feel free to copy and paste the commands, as you go through this article.

Installations

The order is very important, so follow along every step, unless you know what you’re doing.

Xcode

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

We must begin with Xcode, but we do not need complete application.
Instead, we will install command line tools only.

Installation

Ta-da

We’re done with it. There’s nothing further for this one. Move on to the next…

Homebrew

Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system.
Source: Wikipedia

Installation

Repositories

Upgrade and update

Ta-da

We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.

HINT — to learn more about each command and its use, enter brew help [COMMAND] command, and it will display all details about specific command and each flag it has… If you’d like to learn more, see complete list of commands.

Homebrew Cask

Extends Homebrew and brings its elegance, simplicity, and speed to the installation and management of GUI macOS applications.
Source: GitHub Repository

Installation

List of applications and installation
I strongly suggest you to make your own personal list. Here’s mine…

Ta-da

We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.

Mas CLI

A simple command line interface for the Mac App Store. Designed for scripting and automation.
Source: GitHub Repository

Installation

List of applications and installation
I strongly suggest you to make your own personal list. Here’s mine…

Ta-da

We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.

Z Shell

A Unix shell that can be used as an interactive login shell and as a powerful command interpreter for shell scripting.
Source: Wikipedia

Installation
We will install a couple of extensions along with a shell.

Since we’re still at installing stage, it might be a good idea to install Oh My Zsh as well!

It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…

Configuration
Instead of editing the .zshrc file, we will make our own and then point it as a source to the main configuration file.

Create a file and open it in the Editor:

touch ~/.my-zshrc && bash -c 'exec env ${EDITOR:=nano} ~/.my-zshrc'

Copy/Paste the following content:

Append the source of our custom configuration file into the main Z Shell configuration file:

Aliases
This is completely optional. I use a bunch of aliases personally and I find them highly useful.

Create a file and open it in the Editor:

Copy/Paste the following content:

Functions
I do not use these as often, but they come handy from time to time.

Create a file and open it in the Editor:

Copy/Paste the following content:

Ta-da

We’re done with it. There’s nothing further for this one. Move on to the next…

Sublime Text

A proprietary cross-platform source code editor with a Python application programming interface.
Source: Wikipedia

Package Control
Here’s the Installation Code, but I think it is no longer required.
Instead, open Sublime Text, press cmd + shift + p and type “Install”. It should show “Install Package Control”.

Packages
I have my curated list of packages, but of course I do not want to install them manually each time I reinstall my macOS.

To automatically install a list of packages, follow this path:

User Settings will open up… Replace the existing content with the following:

Restart the application and give it some time to install specified packages.

Configuration
To setup preferences, first install a desired font. My personal preference is one of the following: Operator Mono or Fira Code.

After that, open Preferences > Settings or with a shortcut cmd + , and replace the contents in the right pane with the following. Make sure to replace font_face with the one that you installed on the system.

Ta-da

We’re done with it. There’s nothing further for this one. Move on to the next…

Apache

A free and open-source cross-platform web server, released under the terms of Apache License 2.0.
Source: Wikipedia

Apache is already bundled in macOS. However, it is not the latest version and it’s always the best to keep all our workspace dependencies within Homebrew.

Across the configuration, you will need to replace all dvlden occurrences with your system username. Type whoami in the terminal to see your username, if you don’t know it already.

Stop and unload system-bundled version

Installation

Configuration

Open configuration file in the Editor:

Here’s the table of contents. I hope I made it clear enough…

Configuration of dynamic virtual hosts

Open configuration file in the Editor:

Replace the file contents with the following:

When we setup our DNSMasq below, we will be able to have automatic dynamic virtual hosts.

Every folder that we make in our ~/Sites directory, should be lowercase with hyphens, for readability. Think of the folder names as domain names, without TLD. Each folder will be automatically accessible. Use .test for static websites and use .public for dynamic sites. If you’re using an PHP Framework like Laravel, this will be very handy. It’s like Laravel Valet!

Restart

Start a daemon

Ta-da

We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.

DNS Masq

It provides Domain Name System forwarder, Dynamic Host Configuration Protocol server, router advertisement and network boot features for small computer networks, created as free software.
Source: Wikipedia

We’re going to use this along with our dynamic virtual hosts configuration. This package will then redirect our specified TLD’s to a localhost.

Installation

Configuration

Start a daemon

Add resolvers

Restart a daemon

Test it

You should be able to find the following section in your output.

PHP

A server-side scripting language designed for Web development, but also used as a general-purpose programming language.
Source: Wikipedia

PHP is already bundled in macOS. However, it is not the latest version and it’s always the best to keep all our workspace dependencies within Homebrew.

Installation

Installation of Composer
Since we’re using PHP, we are definitely going to need Composer.

Configuration

Open configuration file in the Editor:

Here’s the table of contents. I hope I made it clear enough…

Feel free to tweak the post and upload size for your needs…
You can find the timezones here: List of Supported Timezones

Ta-da

We’re done with it. There’s nothing further for this one. Move on to the next…

MySQL

An open-source relational database management system. Its name is a combination of “My”, the name of co-founder Michael Widenius’s daughter, and “SQL”, the abbreviation for Structured Query Language.
Source: Wikipedia

Installation

Start a daemon

Configuration (optional)

By default MySQL is installed with a user root and no password. If you want to configure that, go ahead.

Node JS

An open-source, cross-platform JavaScript run-time environment that executes JavaScript code server-side.
Source: Wikipedia

Installation

NPM

A package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js.
Source: Wikipedia

Node JS is bundled with NPM, so it will install it along with it… There’s nothing for us to do here, except to optionally install some global packages.

Global Packages Installation
If you are using Vue JS and perhaps want to use one epic package to keep your project dependencies up to date, check NPM Check Updates.

Ta-da

We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.

To learn more about each command and its use, enter npm help [COMMAND] command, and it will display all details about specific command and each flag it has... If you'd like to learn more, see complete list of commands.

Git

A version control system for tracking changes in computer files and coordinating work on those files among multiple people.
Source: Wikipedia

Installation

Configuration

Make sure to replace name and email with your personal details.

I’m using https as authentication, so I’ll add the following extra line to a configuration.

If you are using ssh authentication, you can set it up this way:

Ta-da

We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.

To learn more about each command and its use, enter git help [COMMAND] command, and it will display all details about specific command and each flag it has... If you'd like to learn more, see complete list of commands.

Final Notes

This might be a good place for me to throw in my “.dot files”.
If you’re interested in writing your own Shell to automate all of this process that I written and more, feel free to check this GitHub Repository.

Try it out if you want (on clean macOS installation), but I strongly suggest you to take a look at all of the files first and then maybe write your own.

Until next time

If you enjoyed this and learned something new, please share some love.
To do so, tap the clap icon 👏 or hold it for more claps! 👏👏👏

Much appreciated. You’re the best!

If you are considering to follow me:
Instagram, Twitter, Medium, GitHub

--

--

Nenad Novaković
HackerNoon.com

Hi, my name is written above, but the artist within me is called dvL. I'm full-stack developer & designer, but also more than "just" that… 💻 🤘