Managing Homebrew Services

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-elasticsearch

To stop a service you would use the stop command:

Restarting a service is similar, use the restart command:

Cleaning up services

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

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