Chroma
What is Chroma?
Chroma is a lightweight open-source vector database with a simple HTTP API, handy for semantic-search and RAG (retrieval-augmented generation) prototypes where you want something simpler to operate than Weaviate or Qdrant.
Start Chroma
- Laradock CLI
- Docker Compose
./laradock start chroma
docker compose up -d chroma
Your data is created on first start and kept between restarts, in the chroma Docker volume.
Stop Chroma
Stopping just pauses the container; your data is safe:
- Laradock CLI
- Docker Compose
./laradock stop chroma
docker compose stop chroma
To delete the container entirely (the data in the chroma volume is still untouched):
- Laradock CLI
- Docker Compose
./laradock remove chroma
docker compose rm -sf chroma
Configuration
All settings live in chroma/defaults.env and can be overridden by adding the same line to your own .env:
| Variable | Default | What it does |
|---|---|---|
CHROMA_VERSION | latest | Image tag from the chromadb/chroma Docker Hub image. |
CHROMA_HOST_PORT | 8001 | Host-side port mapped to the Chroma HTTP API (container port 8000). |
Data persists in the chroma named Docker volume at /data across restarts, it is not a DATA_PATH_HOST bind mount like the SQL databases, so you won't find it as a plain folder on your host.
Change the Chroma version
Set the version in your .env:
CHROMA_VERSION=0.5.20
Then apply the change:
- Laradock CLI
- Docker Compose
./laradock rebuild chroma
docker compose build chroma
Then start it again to pick up the new image: ./laradock start chroma. Your collections live in the chroma volume, separate from the image, so a version bump doesn't touch them by itself, but Chroma has changed its on-disk storage format across major versions before. Back up before jumping multiple major versions, just in case.
Connect
The API is at http://localhost:8001 from your host. Heartbeat check: /api/v2/heartbeat. From another container, use http://chroma:8000, note the internal port is 8000, different from the host-mapped 8001.
Backup and restore
Chroma's data lives in the chroma Docker-managed volume, not a DATA_PATH_HOST folder, so back it up by mounting that volume into a throwaway helper container instead of copying files directly off your host.
Export (back up) everything to a .tar.gz on your host (Chroma must be running so its container can be found):
docker run --rm --volumes-from "$(docker compose ps -q chroma)" -v "$(pwd):/backup" alpine tar czf /backup/chroma-backup.tar.gz -C /data .
Restore (import) into a Chroma container whose /data is empty (for example right after starting completely fresh):
docker run --rm --volumes-from "$(docker compose ps -q chroma)" -v "$(pwd):/backup" alpine sh -c "cd /data && tar xzf /backup/chroma-backup.tar.gz"
For a perfectly consistent snapshot under active writes, stop Chroma first (./laradock stop chroma), back up, then start it again; for casual prototype use it's fine to back up while it's running.
Reset all collections (wipe data, keep the container)
Chroma has a built-in reset endpoint that deletes every collection without recreating the container, but it's disabled by default. Enable it in chroma/defaults.env or override it in your own .env:
ALLOW_RESET=TRUE
Apply the setting:
- Laradock CLI
- Docker Compose
./laradock restart chroma
docker compose restart chroma
Then call the reset endpoint:
curl -X POST http://localhost:8001/api/v2/reset
This deletes every collection immediately, with no confirmation prompt. Set ALLOW_RESET back to FALSE (or remove the override) afterward if you don't want the endpoint reachable.
Start completely fresh (wipe all data)
To throw away every collection and start Chroma from a clean, empty volume (⚠️ this permanently deletes everything in the chroma volume, back up first if you need anything):
- Laradock CLI
- Docker Compose
./laradock stop chroma
./laradock remove chroma
docker volume rm $(docker volume ls -q --filter label=com.docker.compose.volume=chroma)
./laradock start chroma
docker compose stop chroma
docker compose rm -sf chroma
docker volume rm $(docker volume ls -q --filter label=com.docker.compose.volume=chroma)
docker compose up -d chroma
If you run more than one Laradock project on the same machine, also filter by --filter label=com.docker.compose.project=<your-project-name> so you don't delete a different project's chroma volume by mistake.
Talk to this Chroma from another Laradock project
Each Laradock project is its own isolated Docker network by default, so a second project's containers can't reach this Chroma by container name out of the box. Easiest fix: use the published port (CHROMA_HOST_PORT) and have the other project connect to your host machine's address instead of chroma, for example http://host.docker.internal:8001 (Docker Desktop). Make sure the two projects use different CHROMA_HOST_PORT values if they're both running at once.
Common issues
- Confusing host vs container port. The container listens on
8000internally;CHROMA_HOST_PORT(8001) is only the host-side mapping. From other containers, always use port8000. - Data disappeared after recreating the container. Data lives in the
chromanamed volume; runningdocker compose down -v(which removes named volumes) rather than./laradock remove chromawipes it. - Port already in use on your host. Change
CHROMA_HOST_PORTin.envand restart:./laradock start chroma. - App can't connect but the container is running. Use the container name
chroma, notlocalhost, from inside another container. /api/v2/resetreturns an error. The reset endpoint is disabled unlessALLOW_RESET=TRUEis set (see Reset all collections above), and requires a restart after changing it.
Comparing vector databases? See Qdrant and Weaviate. New to Laradock? Start with Getting Started.