# prebid-server: running header bidding auctions server side in Go

> Prebid Server is the open source, Go implementation of Prebid's server-side half of header bidding, where the auction happens on your own infrastructure instead of in the browser. It is a large, module-based application with a wide adapter surface, and it is meant to be deployed, not imported into your code.

**prebid/prebid-server** — Open-source solution for running real-time advertising auctions in the cloud.

- Repository: https://github.com/prebid/prebid-server
- Website: https://prebid.org/product-suite/prebid-server/
- Stars: 584 · Forks: 974
- Language: Go
- License: Apache-2.0
- Published: 2026-10-22 · Updated: 2026-10-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/prebid-prebid-server

## The auction runs on your infrastructure, not in the browser

Prebid Server is described as an open-source solution for running real-time advertising auctions in the cloud, and it is part of the Prebid ecosystem, integrating with Prebid.js and the Prebid Mobile SDKs to deliver header bidding for any ad format and any type of digital media. The architectural point is the difference between where the auction happens. In the client-side model, the browser collects bids and runs the auction, which means the user's device is doing the work and the data involved stays client side. Moving the auction server side changes the cost profile and the data story, and it is a substantial engineering commitment rather than a script tag. The audience is a publisher or an ad platform team with the infrastructure to run a Go service and the demand partners to bid against.

## Adapters are the plugin surface, and there are a lot of them

The repository layout is the clearest description of how the system works. There is an `adapters/` directory, a `modules/` directory, an `exchange/` directory that holds the auction logic, `endpoints/` for the HTTP surface, and `openrtb_ext/` plus `ortb/` for the OpenRTB protocol types, with `openrtb_ext` extending the upstream `github.com/prebid/openrtb/v20` library. The `adapters/` directory holds one package per demand partner, and the Makefile has a target that runs the tests for a single adapter with `go test github.com/prebid/prebid-server/v4/adapters/$(adapter) -bench=.`, which tells you both that the adapters are separate packages and that each is benchmarked. The `modules/` directory works the same way for bidder modules, and a `build-modules` target runs `go generate modules/modules.go` to produce the file that lists all available modules, so the set of bidders is generated from the tree rather than maintained by hand.

## The GDPR default is a required decision, not a default

One configuration requirement stands out, and it is the first thing an operator meets. When hosting Prebid Server or developing locally, you must set a default GDPR value, because this configuration determines whether GDPR is enabled when no regulatory signal is available in the request, with a value of "0" disabling it by default and "1" enabling it. The README is blunt about the reason: it is required as there is no consensus on a good default. That is a fair reason and an unusual one to find in a README, since most projects pick a default and move on. The mechanism around it is visible in the tree as well, with a `gdpr/` package, a `privacy/` package, and a `privacysandbox/` directory, and the dependency list includes `github.com/prebid/go-gdpr` and `github.com/prebid/go-gpp` for consent signal parsing. A deployment that gets this wrong will process requests under a regime it did not intend.

## Deployment is Docker, Kubernetes, or a compiled binary

The quickest way to host the server is the official Docker image, and if you are running it on Kubernetes you can configure it with environment variables through a pod file or a config map, or use a configuration file embedded in a config map which Prebid Server will read from the path `/etc/config`. For a fork, the README gives the container build command:

```bash
docker build --platform linux/amd64 -t prebid-server .
```

or a standalone binary build:

```bash
go build .
```

There is a detail in the Dockerfile worth knowing. The `BASE_IMAGE` argument allows overriding the base image so the build can pull from an internal mirror when docker.io is unreachable, defaulting to upstream `ubuntu:22.04`. The build stage downloads Go 1.26.2, installs gcc because cgo is used to build native code of some modules, sets `CGO_ENABLED 1` for the same reason, vendors the dependencies, and runs `./validate.sh` unless `TEST` is set to false. The release stage installs `libatomic1` as a runtime dependency for some modules and copies the `static` and `stored_requests/data` directories into the image, which is why the README says to ensure that you deploy the `/static` directory, as Prebid Server requires those files at startup.

## Building from source has three dependencies to get right

The README lists the build dependencies carefully, which is unusual and useful. The first is compile-time cgo, because some modules ship native code, and the default is that cgo is enabled, so the environment variable `CGO_ENABLED=1` must not be set to `0`. The second is compile-time too: cgo depends on the C compiler, which is usually `gcc` but can be changed by setting the value of the `CC` environment variable, for example `CC=clang`, and on Ubuntu gcc is installed with `sudo apt-get install gcc`. The third is runtime: some modules require `libatomic`, installed on Ubuntu by running `sudo apt-get install libatomic1`, and since `libatomic1` is a dependency of gcc it is likely already present if you build with gcc and run on the same machine. The developer's own workflow is four commands. You clone the repository, download dependencies with `go mod download`, verify the tests pass with `./validate.sh`, and run the server with `go run .`, and by default Prebid Server attaches to port 8000, confirmed by visiting `http://localhost:8000/` in a browser.

## Packages are not an API, and the README says so directly

There is a section titled Importing Prebid Server, and the content is a warning rather than an instruction. Prebid Server is not currently intended to be imported by other projects, Go Modules is used to manage dependencies which also makes it possible to import Prebid Server packages, and that is not supported. The project offers no guarantees regarding the stability of packages and does not adhere to semantic versioning guidelines. That last clause is a real constraint for anyone planning to build a house service on top of it, and it is better to know it up front. There is a related escape hatch for one specific global. The `Logger` package is described as a global side-effectful dependency that sometimes needs to be swapped to modify the behavior, and it contains an interface definition for unstructured logging with a built-in `glog` implementation providing `Debug`, `Info`, `Warn`, `Error`, and `Fatal`, based on `github.com/golang/glog`.

## Code style and contribution rules are Go conventions with a preference

The code style section asks contributors to follow the recommendations set by Effective Go, notes that many IDEs will format automatically on save, and gives two ways to format manually, either running the bash script or the make step, with `./scripts/format.sh -f true` and `make format`. The one substantive opinion is a preference for small functions with descriptive names instead of complex functions with comments, on the grounds that it makes the code more readable, maintainable, and testable. Error handling has a rule attached. Do not discard errors, and implement appropriate error handling such as gracefully falling back to a default behavior or bubbling up an error. For developers, the README recommends Visual Studio Code with Remote Container Setup for a reproducible environment isolated from the host OS, which it calls a recommendation rather than a requirement, and it notes this is especially useful on Windows since the remote container runs within WSL and gives you the ability to execute bash scripts. The helper scripts themselves are written in bash, which is the one real platform caveat in the development setup.

## Conclusion

Prebid Server fits a publisher or ad platform team that wants to run the auction itself, on its own infrastructure, with server-side latency and its own data, rather than letting a browser-side library handle it. It is the wrong choice if you want to import it as a library, since the README says explicitly that it is not intended to be imported by other projects, and it is the wrong choice if you need only a handful of demand sources, because the deployment surface is substantial. Before adopting it, set the default GDPR value deliberately, because the README says you must, and decide how you will serve the `/static` directory, which the server requires at startup.

## FAQ

### What is Prebid Server and what problem does it solve?

It is an open-source Go application for running real-time advertising auctions in the cloud, part of the Prebid ecosystem and integrating with Prebid.js and the Prebid Mobile SDKs. The auction happens on your own infrastructure rather than in the browser, which is the server-side form of header bidding.

### What must I configure before hosting Prebid Server?

You must set a default GDPR value, because it determines whether GDPR is enabled when no regulatory signal is available in the request, with "0" disabling and "1" enabling it. The README says this is required because there is no consensus on a good default.

### How do I build and run Prebid Server from source?

Prebid Server requires Go 1.26.2 or newer. Clone the repository, run `go mod download`, verify the tests with `./validate.sh`, and start it with `go run .`, which attaches to port 8000 by default. You must not set `CGO_ENABLED=0`, since some modules need cgo, and you need gcc plus the libatomic1 runtime library.

### Can I import Prebid Server packages into my own Go project?

No. The README states that Prebid Server is not currently intended to be imported by other projects, that Go Modules makes it technically possible, and that this is not supported, with no guarantees regarding package stability and no adherence to semantic versioning guidelines.

### How do I deploy Prebid Server on Kubernetes?

You can configure it with environment variables through a pod file or a config map, or use a configuration file embedded in a config map, which the server reads from the path `/etc/config`. You also need to deploy the `/static` directory, because Prebid Server requires those files at startup.

## Sources

- [License: Apache-2.0](https://github.com/prebid/prebid-server/blob/master/LICENSE)
- [prebid/prebid-server on GitHub](https://github.com/prebid/prebid-server)
- [Project website](https://prebid.org/product-suite/prebid-server/)
- [README](https://github.com/prebid/prebid-server/blob/master/README.md)
- [Releases](https://github.com/prebid/prebid-server/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/prebid-prebid-server
