Bencher Self-Hosted
Bencher is open source. It is available as a SaaS, Bencher Cloud, and as a self-hostable set of container images:
- Bencher Console Server
- Bencher API Server
Deployment
The easiest way to deploy Bencher Self-Hosted is using a triptych of bencher
CLI subcommands:
bencher up
: Bring up the Bencher Self-Hosted containers. This is similar to runningdocker compose up
.bencher logs
: View output from the Bencher Self-Hosted containers, ifbencher up
was run with the--detach
flag. This is similar to runningdocker compose logs
.bencher down
: Stop and remove the Bencher Self-Hosted containers, ifbencher up
was run with the--detach
flag. This is similar to runningdocker compose down
.
bencher up
Create and start the Bencher Self-Hosted containers.
This is similar to running docker compose up
.
Service
Select the containers to run.
The possible choices are: all
, api
, and console
.
By default all
is chosen.
Similar to the SERVICE
argument for docker compose up
.
Options
--detach
Run in detached mode.
The containers will be run in the background.
Similar to the --detach
flag for docker compose up
.
--pull <WHEN>
Pull images before running.
The possible choices are: always
, missing
, and never
.
By default always
is chosen.
Similar to the --pull
option for docker compose up
.
--tag <TAG>
Specify the image tag for the containers.
By default the image tag matches the bencher
CLI version.
The most recent bencher
CLI version is v0.4.30
.
--console-port <PORT>
Specify a port number for the Console server container.
By default, port 3000
is used.
Similar to the port only form of the --expose
option for docker run
.
--api-port <PORT>
Specify a port number for the API server container.
By default, port 61016
is used.
Similar to the port only form of the --expose
option for docker run
.
--console-env <KEY_VALUE>
Pass an environment variable to the Console server container.
The expected format is KEY=value
.
This can be useful when working with the Console Server configuration.
Similar to the --env
option for docker run
.
--api-env <KEY_VALUE>
Pass an environment variable to the API server container.
The expected format is KEY=value
.
This can be useful when working with the API Server configuration.
Similar to the --env
option for docker run
.
--console-volume <HOST_CONTAINER>
Pass a mount volume to the Console server container.
The expected format is /host/path:/container/path
.
This can be useful when working with the Console Server configuration.
Similar to the --volume
option for docker run
.
--api-volume <HOST_CONTAINER>
Pass a mount volume to the API server container.
The expected format is /host/path:/container/path
.
This can be useful when working with the API Server configuration.
Similar to the --volume
option for docker run
.
--help
Print help.
bencher logs
View output from the Bencher Self-Hosted containers,
if bencher up
was run with the --detach
flag.
This is similar to running docker compose logs
.
Service
Select the containers to run.
The possible choices are: all
, api
, and console
.
By default all
is chosen.
Similar to the SERVICE
argument for docker compose logs
.
Options
--help
Print help.
bencher down
Stop and remove the Bencher Self-Hosted containers,
if bencher up
was run with the --detach
flag.
This is similar to running docker compose down
.
Service
Select the containers to run.
The possible choices are: all
, api
, and console
.
By default all
is chosen.
Similar to the SERVICE
argument for docker compose down
.
Options
--help
Print help.
Alternatively, you could just use docker compose
to orchestrate the containers.
This is an example docker-compose.yml
file:
HTTPS
In order to setup HTTPS can use Bencher Self-Hosted behind a proxy with HTTPS enabled or use a domain name with a valid SSL certificate.
Host URL
When using Bencher Self-Hosted,
you will need to set the --host
option
to the URL of your Bencher API server
for most bencher
CLI subcommands.
For example, if you were using the bencher run
CLI subcommand
with a Bencher API server at https://api.bencher.example.com
then you could write something like this:
Backups
The easiest way to backup your Bencher Self-Hosted API server is using
the bencher server backup
CLI subcommand.
The user must be an admin on the server to use this subcommand.
bencher server backup
Backup the API server database.
Options
--host <URL>
The Bencher Self-Hosted API server URL.
For example, https://api.bencher.example.com
.
--token <TOKEN>
Either the --token
option or the BENCHER_API_TOKEN
environment variable must be set to a valid API token.
If both are specified, the --token
option takes precedence over the BENCHER_API_TOKEN
environment variable.
--compress
Compress the database backup with gzip
.
This operation runs first.
--data-store <DATA_STORE>
Save the database backup to this data store. This operation runs second.
Supported data stores:
aws_s3
: Backup to AWS S3
Use the database.data_store
section of the API server configuration
to setup the data store for your Bencher Self-Hosted API server.
--remove
Remove the local copy of the database backup. This operation runs third.
Disaster Recovery
In order to prevent data loss in between backups, Bencher offers a built-in disaster recovery solution. This feature requires an active Bencher Plus license.
Supported replication schemes:
file
: Replicate to a local file pathsftp
: Replicate over SFTPs3
: Replicate to any S3 compatible blob storageabs
: Replicate to Azure Blob Storagegcs
: Replicate to Google Cloud Storage
Use the plus.disaster_recovery
section of the API server configuration
to setup disaster recovery for your Bencher Self-Hosted API server.