Installing Linux programs on macOS


Linux is a wonderful operating system that has many useful applications and utilities. Most of them are not bundled with macOS, which is a real shame.

If you are a web developer then you may be aware of the web serving applications, such as Nginx and Apache. Between these two web servers, they host some of the largest websites in the world.

macOS currently has Apache 2.4 builtin from when the feature “Web Sharing” was available. However, I would stay away from builtin applications like Apache, because Apple could easily remove it in a future update.

Linux Apps on macOS

If using a Mac computer, then by default installing these Linux applications can be fraught with challenges. You have to compile and install the application that you want. However, you also need to download and install all the dependencies to allow the application to compile.

Steps to Manually Compile an Application

  1. Download a compiler
  2. Download the application source code
  3. Check for any dependencies
  4. Compile and install the dependencies
  5. If those dependencies had dependencies then compile them
  6. Compile and install the application

Any of those steps could cause errors.

Automatically Installing Applications

In the world of Linux, there are package managers that handle the process of installing these applications, as well as all of their dependencies. The package manager for Ubuntu is called APT.

There are a few package managers available for macOS. The package manager that I’m going to talk about is called Homebrew. Homebrew is often abbreviated to brew.

Brew has been described at the missing package manager for the macOS.

With Brew, you have the ability to easily install packages available for Linux, right onto your Mac with one brew command. You will be able to install great programs, like Apache, Nginx, PHP and Python.

Using brew will give you the ability to replace the out-of-date application and commands that Apple supplies with its operating system to the latest version. The original programs will still exist, in case Apple make changes to them. You will have your own version of them installed as well.

Installing HomeBrew

It only takes a couple of terminal commands to have brew installed on your computer.

Installing Brew

Daniel

Whilst building web applications, Daniel also sets up web servers from scratch because he has yet to find the perfect hosting solution. His philosophy is “Why settle, when you can build it better yourself?”

Recent Posts