Installing and Setting Up gRPC

1. Installing gRPC Runtime

LanguageInstall CommandLatest (2026)
Gogo get google.golang.org/grpc@latestv1.65+
JavaMaven/Gradle io.grpc:grpc-netty1.64+
Pythonpip install grpcio grpcio-tools1.65+
Node.jsnpm install @grpc/grpc-js1.10+
C++vcpkg/cmake build1.65+
.NETdotnet add package Grpc.AspNetCore2.65+

2. Installing Protocol Buffer Compiler

OSCommand
macOSbrew install protobuf
Ubuntu/Debianapt install -y protobuf-compiler
Windowschoco install protoc
ManualDownload from github.com/protocolbuffers/protobuf/releases
Verifyprotoc --version → libprotoc 27.x+

3. Installing Language-Specific Plugins

LanguagePlugin Install
Gogo install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
PythonBundled in grpcio-tools (python -m grpc_tools.protoc)
JavaGradle/Maven plugin protobuf-gradle-plugin
Node.jsnpm i -D grpc-tools ts-proto
C#Bundled with Grpc.Tools NuGet

4. Setting Up Project Structure

my-service/
├── proto/
│   └── user/v1/user.proto
├── gen/
│   └── user/v1/                ← generated code
├── cmd/server/main.go
├── cmd/client/main.go
├── internal/service/user.go
├── buf.yaml
├── buf.gen.yaml
└── go.mod
      

5. Configuring Go Modules

Example: go.mod for a gRPC service

module example.com/user-service

go 1.22

require (
    google.golang.org/grpc v1.65.0
    google.golang.org/protobuf v1.34.2
)
SettingPurpose
option go_packageRequired in .proto to set import path
replaceUse during local plugin development

6. Verifying Installation

CheckCommandExpected
protocprotoc --versionlibprotoc 27.x
Go pluginwhich protoc-gen-goPath in $GOBIN
gRPC pluginwhich protoc-gen-go-grpcPath in $GOBIN
bufbuf --version1.30+

7. Setting Up IDE Support

IDEPlugin
VS CodeBuf / vscode-proto3 / vscode-go
IntelliJ/GoLandProtocol Buffers (bundled)
Vim/Neovimvim-protobuf

8. Configuring Environment Variables

VariablePurpose
PATHMust include $GOBIN or $GOPATH/bin
GRPC_GO_LOG_VERBOSITY_LEVEL99 = verbose client logs (Go)
GRPC_GO_LOG_SEVERITY_LEVELinfo | warning | error
GRPC_TRACEComma-separated tracers (C-core)
GRPC_VERBOSITYDEBUG | INFO | ERROR

9. Installing Development Tools

ToolInstallPurpose
grpcurlbrew install grpcurlCLI client
ghzbrew install ghzLoad testing
Evansbrew install evansInteractive REPL
grpc-gatewaygo install .../protoc-gen-grpc-gateway@latestREST gateway

10. Setting Up Buf CLI

Example: buf.yaml + buf.gen.yaml

# buf.yaml
version: v2
modules:
  - path: proto
lint:
  use: [STANDARD]
breaking:
  use: [FILE]
# buf.gen.yaml
version: v2
plugins:
  - remote: buf.build/protocolbuffers/go
    out: gen
    opt: paths=source_relative
  - remote: buf.build/grpc/go
    out: gen
    opt: paths=source_relative
CommandPurpose
buf lintStyle + best-practice linting
buf breakingDetect breaking changes vs base
buf generateRun codegen plugins
buf buildCompile to FileDescriptorSet