How to Install the Protocol Buffer Compiler on Mac OS

Before using protocol buffers on your system, you need to set up the Protocol Buffers compiler or protoc. This tutorial covers the command for installing the Protocol Buffers compiler on mac OS.

How to Install the Protocol Buffer Compiler on Mac OS

Protocol Buffers, commonly known as protobufs are a free and open-source cross-platform data format used to serialize structured data. It helps develop programs to communicate with each other over a network or store data. Think of formats such as XML, JSON, Pickle, etc.

Protocol Buffers, however, are much faster and provide a much more compact data storage; they are optimized via automatically generated classes for a wide range of programming languages.

You often encounter protocol buffers when working with tools such as gRPC. They are also used internally by Google cloud and other applications.

Install Protocol Buffer Compiler using Homebrew

As you guessed, we can install the Protocol Buffer compiler using the Homebrew command:


brew install protobuf


Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/cask-fonts).
==> New Formulae
[email protected]

You have 12 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

==> Downloading
Already downloaded: /Users/csalem/Library/Caches/Homebrew/downloads/b14adda1b60aed4c5ad02d56334c662c6bf85995bdaa45c069bd7ccf6ef16439--protobuf-21.9_1.bottle_manifest.json
==> Downloading
Already downloaded: /Users/csalem/Library/Caches/Homebrew/downloads/e0884d5da59489325249368acbe8cc2b44e442d1cbcd9cd1c0c45649aa97d2cf--protobuf--21.9_1.arm64_ventura.bottle.tar.gz
==> Pouring protobuf--21.9_1.arm64_ventura.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
==> Summary
🍺  /opt/homebrew/Cellar/protobuf/21.9_1: 333 files, 20.4MB
==> Running `brew cleanup protobuf`...

Once installed, check the protocol buffer compiler version:

protoc --version

Expected output:

libprotoc 3.19.1

Ensure the installed version is version 3.0+.


If you enjoy our content, please consider buying us a coffee to support our work:

Table of Contents
Great! Next, complete checkout for full access to GeekBits.
Welcome back! You've successfully signed in.
You've successfully subscribed to GeekBits.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.