Overview
ChromaDB runs in-process (ephemeral or persistent), as a server reached over HTTP, or as Chroma Cloud. Pick by how many processes touch the data. A persistent client stores everything under one directory: chroma.sqlite3 plus segment files. Use PersistentClient when one process owns the directory and server mode for shared access, put authentication and TLS in front of any server, and back up the directory with writes stopped.
Use PersistentClient when one process owns the directory
import chromadb
client = chromadb.PersistentClient(path="/data/chroma") # default path is .chromaThe path must be writable and, in containers, on a volume. Chroma’s documentation does not describe sharing one directory between processes, so give each directory a single owning process. For multi-worker web servers (Gunicorn, uvicorn workers) or several services, run a server and connect with HttpClient; each worker then holds a connection, not the files.
Run server mode for shared access
chroma run --path /db_pathdocker run -d --name chroma -p 8000:8000 -v ./chroma-data:/data chromadb/chroma:<tested-version>client = chromadb.HttpClient(host="chroma", port=8000) # AsyncHttpClient for async code- The container’s data directory is
/datasince Chroma 1.0 (it was/chroma/chroma). Mount a volume there. - Pin the image to a tested version instead of
latest, so a restart cannot upgrade the server. - Since 1.0, configuration is a YAML file mounted at
/config.yaml(or passed aschroma run ./config.yaml); environment-variable configuration is deprecated. chroma runlistens onlocalhostby default. Pass--host 0.0.0.0only when another machine must reach it, and then secure it as below.- Put the container on the same Docker network as the app so the hostname resolves.
Put authentication and TLS in front of the server
Chroma 1.0 removed its built-in authentication. The old CHROMA_SERVER_AUTH_* token settings no longer apply, so do not rely on them. Terminate TLS and enforce a token at a reverse proxy (Caddy, nginx), keep port 8000 on a private network, and store credentials per secrets-and-env.
Treat any internet-reachable server as hostile: CVE-2026-45829
CVE-2026-45829 (CVSS 10.0, published 2026-05-18) is a pre-authentication remote code execution flaw in the Python FastAPI server of ChromaDB 1.0.0 and later. A crafted request to the collection-creation endpoint names a malicious Hugging Face model with trust_remote_code enabled, and the server runs that code before any auth check. As of 2026-10-01 no patched release is confirmed; the newest PyPI release is 1.5.9 (2026-05-05), which predates the disclosure.
Apply every mitigation:
- Keep the server off the public internet, with no inbound path from outside the private network.
- Run the Rust server (
chroma runor the official Docker image); reports describe the Python FastAPI server as the affected component. - Disable
trust_remote_codewhere it is not required and restrict which model repositories the server may fetch. - Treat an internet-reachable Chroma server as compromised until proven otherwise, and rotate every secret in its environment.
Back up the data directory with writes stopped
Take a filesystem or volume snapshot while no writes are in flight, since the store is SQLite plus segment files.
docker stop chroma
docker run --rm -v chroma_data:/source -v /backup:/dest alpine \
tar czf /dest/chroma-$(date +%Y%m%d).tar.gz -C /source .
docker start chromaBack up before every upgrade or re-embedding. To move collections between a local server and Chroma Cloud, use the CLI instead of copying files.
chroma copy --from-local --to-cloud --path ./chroma-data --collections docs_supportchroma copy also supports --from-cloud, --to-local, --host, and --all. To move vectors to another database, see chromadb-scale-limits. For the collection layout that decides what you back up, see chromadb-collections.