> ## Documentation Index
> Fetch the complete documentation index at: https://warden.buildlab.in/llms.txt
> Use this file to discover all available pages before exploring further.

# go install

> For people with access to the private source repository.

> [!WARNING]
>
> **This route needs access to the private source repository.** Warden's source is not
> public, so the Go module proxy cannot serve it and `go install` fails for anyone without
> a GitHub account that can read the repository. If you are installing Warden to use it,
> [Homebrew](https://warden.buildlab.in/install/homebrew.md) or [the container image](https://warden.buildlab.in/install/docker.md) are the routes
> that work — both serve public artefacts built from that private source.
>
> With access, tell Go to bypass the public proxy and authenticate to GitHub:
>
> ```bash theme={null}
> export GOPRIVATE=github.com/Abhishek-Mallick/*
> git config --global url."git@github.com:".insteadOf "https://github.com/"
> ```

```bash theme={null}
go install github.com/Abhishek-Mallick/Warden/cmd/warden@latest
go install github.com/Abhishek-Mallick/Warden/mcp/warden-mcp@latest
```

Both land in `$(go env GOPATH)/bin`. Put that on your `PATH`.

## You need a C toolchain

> [!WARNING]
>
> `CGO_ENABLED=1` is required, and so is a C compiler. Warden links **PostgreSQL's own parser** (`pg_query_go`) rather than approximating SQL with regular expressions, and that parser is C. With cgo disabled the build fails.

| Platform | What to install |
| - | - |
| macOS | `xcode-select --install` (Command Line Tools) |
| Debian / Ubuntu | `sudo apt-get install build-essential` |
| Fedora / RHEL | `sudo dnf install gcc make` |
| Alpine | `apk add build-base` |

This is also why there is no `GOOS=windows` build and why cross-compiling is awkward: every target needs a toolchain for that target. Releases are built on native runners for exactly this reason.

## Pinning a version

```bash theme={null}
go install github.com/Abhishek-Mallick/Warden/cmd/warden@v0.1.0
```

`@latest` resolves to the newest tagged release that the proxy — or, for a private module, your own git access — can see. With no tags yet, use `@main` to track the branch:

```bash theme={null}
go install github.com/Abhishek-Mallick/Warden/cmd/warden@main
```

## Checking it worked

```bash theme={null}
warden version
```

A binary built this way reports the version stamped by the module proxy rather than a release's own version string; `warden version` printing `dev` means it came from a branch build rather than a tag.

> [!NOTE]
>
> `go install` gives you the two executables and nothing else — no policy examples, no compose stack, no certification fixtures. For those, [clone the repository](https://warden.buildlab.in/install/source.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.