Managing Homebrew Services

August 5th, 2016

Warning: This post is 7 years old. Some of this information may be out of date.

If you're using a Mac for developmement you probably use Homebrew to install software dependencies for your web applications (and if you're not, you should). Homebrew is easy to use and makes installing services such as MySQL, Elasticsearch, and Beanstalkd a breeze. Managing Homebrew services is also a cinch. Here's how.

Listing Services

You can get a list of all installed services and their current status by running brew services list:

Brew services List

Starting, Stopping, and Reloading Services

To start a service you would use brew services start <servicename>. For example, to start Elasticsearch you would enter brew services start elasticsearch:

Brew Services Start

To stop a service you would use the stop command:

    brew services stop elasticsearch

Restarting a service is similar, use the restart command:

    brew services restart elasticsearch

Cleaning up services

Homebrew also provides a command to help cleanup any unused services:

    brew services cleanup

When I ran this on my machine it told me that Beanstalkd was a stale service and it removed the plist for that service.