# Install

Install the published binary, then check the version you have.

## Cargo registry

```bash
cargo install benson --registry gitea --locked
benson --version
```

The Gitea cargo registry is the registry this project publishes to. `--locked` uses the lockfile from the published crate.

## Docker image

The engine image is `gitea.galiath.net/greg-hewett/benson`. A site image starts `FROM` that image, copies the site directory, and runs `benson serve`. The documentation site itself is published as `gitea.galiath.net/greg-hewett/benson-docs`.

```bash
docker run --rm gitea.galiath.net/greg-hewett/benson:latest benson --version
```

Mount a site at the working directory and serve it:

```bash
docker run --rm -p 3000:3000 \
  -v "$PWD:/site" \
  -w /site \
  -e BENSON_SERVER__BIND_ADDR=0.0.0.0:3000 \
  -e BENSON_SERVER__CACHE_DIR=/tmp/site-cache \
  gitea.galiath.net/greg-hewett/benson:latest \
  benson serve
```

After install, create a site with [init](/init/).

