Skip to content


The eBPF Library for Go



ebpf-go is a Go library for working with eBPF. It does not depend on C, libbpf, or any other Go libraries other than the standard library, making it an excellent choice for writing self-contained, portable tools that run on a variety of architectures.

This documentation aims to provide a central resource for learning how to build Go applications that use eBPF.


To add ebpf-go as a dependency to an existing Go module, run this from within the module's directory:

go get

Target Audience

This documentation assumes familiarity with the basic concepts and terminology of eBPF, as well as a basic understanding of the Go toolchain and how to write idiomatic Go code.

For a high-level understanding of what eBPF is and how it works, please see the eBPF introduction at


Discover projects using ebpf-go here. The repository contains an examples/ directory with minimal demo applications that can be tested on any supported Linux machine.

Last updated 2023-10-04