Simple image for deploying bitwarden-cli.
This repository includes:
- GitHub Actions workflow that builds and publishes to GitHub Container Registry (GHCR) on pushes to
main(and manual dispatch). - A
.dockerignoreto keep the image lean. - An
entrypoint.shthat logs in, unlocks, syncs, and startsbw serve. - A hardened
Dockerfileusing a non-root user andtinifor clean signal handling.
Do not bake secrets into the image. Provide these environment variables at runtime (e.g. via Coolify, Docker Compose, or Kubernetes):
BW_HOST— URL of your vaultwarden (or Bitwarden) server, e.g.https://vault.example.comBW_CLIENTIDBW_CLIENTSECRETBW_PASSWORD— your master password (consider using a secret manager)
Optional: mount a volume to /app/.config for persistent CLI configuration/session state.
The container exposes 8087 and serves Bitwarden CLI endpoints via bw serve.
- Ensure image exists in GHCR:
ghcr.io/<your-user-or-org>/bitwarden-cli:latest. - In Coolify create a new container app using that image.
- Set environment variables (
BW_HOST,BW_CLIENTID,BW_CLIENTSECRET,BW_PASSWORD). - (Optional) Add a volume mapping for persistence: host path →
/app/.config. - Configure health check to hit
http://localhost:8087/status. - Deploy.
- Trigger: push to
mainor manual. - Tags published:
ghcr.io/<owner>/bitwarden-cli:<git-sha>ghcr.io/<owner>/bitwarden-cli:latest
- Uses BuildKit + cache to speed subsequent builds.
docker build -t ghcr.io/olsonbd/bitwarden-cli:dev .
docker run --rm -p 8087:8087 \
-e BW_HOST=https://vault.example.com \
-e BW_CLIENTID=YOUR_ID \
-e BW_CLIENTSECRET=YOUR_SECRET \
-e BW_PASSWORD='correct horse battery staple' \
ghcr.io/olsonbd/bitwarden-cli:dev
curl http://localhost:8087/status