whatisgithub

What is go-plugin?

hashicorp/go-plugin — explained in plain English

Analysis updated 2026-06-26

5,953GoAudience · developerComplexity · 3/5Setup · moderate

In one sentence

go-plugin is HashiCorp's library for building plugin systems in Go, where each plugin runs as a separate process and communicates via RPC or gRPC. A crash in a plugin cannot take down the main app, used in production by Terraform, Vault, Nomad, and Packer.

Mindmap

mindmap
  root((repo))
    What it does
      Plugin system for Go
      Separate process per plugin
      RPC and gRPC comms
    Tech Stack
      Go
      gRPC
      RPC
      TLS
    Use Cases
      Extend Go apps
      Cross-language plugins
      Crash-safe plugins
    Audience
      Go developers
      Platform builders
    Features
      TLS encryption
      Checksum verification
      Protocol versioning
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a plugin system to your Go application so third-party developers can extend it without touching your core code.

USE CASE 2

Write plugins in languages other than Go by using the gRPC communication layer for cross-language support.

USE CASE 3

Isolate plugin crashes from your main application by running each plugin as a completely separate process.

USE CASE 4

Add TLS encryption and checksum verification to ensure only trusted plugin binaries are loaded by your app.

What is it built with?

GogRPCRPCTLS

How does it compare?

hashicorp/go-pluginnilsherzig/llocalsearchfoxcpp/maddy
Stars5,9535,9555,960
LanguageGoGoGo
Setup difficultymoderatemoderatehard
Complexity3/53/54/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires implementing a Go interface for the behavior to expose and understanding RPC basics, cross-language plugins need additional gRPC setup.

So what is it?

go-plugin is a library from HashiCorp that lets you build plugin systems in the Go programming language. A plugin system means your application can load and run additional pieces of code (plugins) that were written separately, possibly by other developers. This library handles the communication between the main application and each plugin. The way it works is that each plugin runs as a separate process on the same machine, and the main application talks to it over a local network connection using a protocol called RPC. Because the plugin is a separate process, a crash inside a plugin cannot take down the main application. From the perspective of the developer writing the plugin or using it, the experience looks like calling a normal function on a Go interface, and the library handles all the behind-the-scenes communication. Plugins can also be written in other languages, since the library supports a communication format called gRPC which is language-independent. HashiCorp uses this library across several of their well-known open-source tools including Terraform, Vault, Nomad, and Packer. The README states it has run on millions of machines and is considered production-ready. Features described in the README include: automatic forwarding of log output from plugins back to the host application, TLS encryption for communication with plugins, support for checking that a plugin binary matches an expected checksum, the ability to upgrade the host application while a plugin keeps running, and compatibility with terminals that require direct input (TTY). Protocol versioning is also supported so that incompatible plugin versions produce a clear error message rather than silent failures. Using the library requires implementing a Go interface for the behavior you want to expose to plugins, then wrapping it with the client and server code that go-plugin needs to route calls over RPC.

Copy-paste prompts

Prompt 1
I want to add a plugin system to my Go app using go-plugin. Walk me through implementing a Go interface and wrapping it with the client and server code.
Prompt 2
How does go-plugin prevent a plugin crash from taking down the host application, and how can I verify this isolation?
Prompt 3
Show me how to write a go-plugin plugin in Python using the gRPC protocol so a non-Go plugin can talk to a Go host.
Prompt 4
How do I enable TLS encryption and binary checksum verification in go-plugin to ensure only trusted plugins are loaded?
Prompt 5
How does go-plugin protocol versioning work so that incompatible plugin versions produce clear errors instead of silent failures?

Frequently asked questions

What is go-plugin?

go-plugin is HashiCorp's library for building plugin systems in Go, where each plugin runs as a separate process and communicates via RPC or gRPC. A crash in a plugin cannot take down the main app, used in production by Terraform, Vault, Nomad, and Packer.

What language is go-plugin written in?

Mainly Go. The stack also includes Go, gRPC, RPC.

How hard is go-plugin to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is go-plugin for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.