Running Chroma¶
Local Server¶
Article Link
This article is also available on Medium Running ChromaDB — Part 1: Local Server.
Chroma CLI¶
The simplest way to run Chroma locally is via the Chroma cli.
Prerequisites:
- Python 3.9+ (for
pip,pipx, oruv) - Download Python | Python.org - Node.js (for
npm,pnpm,bun, oryarn) - Download Node.js | nodejs.org curl(or Windows PowerShell) for standalone CLI install script
Install Chroma CLI with any of the following:
Python¶
JavaScript (Global)¶
Standalone Installer¶
--host The host to bind to, by default localhost. Use 0.0.0.0 to expose it on your local network.
--port The port on which to listen to, by default this is 8000.
--path The path where to persist your Chroma data locally.
Target Path Install
It is possible to install Chroma in a specific directory by running pip install chromadb -t /path/to/dir.
To run Chroma CLI from that install location, execute:
/path/to/dir/bin/chroma run --path ./my_chroma_data
For advanced 1.x server settings (YAML config and CHROMA_ overrides), see
Chroma Configuration.
Optional: CLI with YAML config (collapsed)
Docker¶
Running Chroma server locally can be achieved via a simple docker command as shown below.
Prerequisites:
Options:
-p 8000:8000specifies the port on which the Chroma server will be exposed.-vspecifies a local dir which is where Chroma will store its data so when the container is destroyed the data remains. For current Chroma server images, mount/datato persist DB files.chromadb/chroma:1.5.3indicates the Chroma release version.
Current v1.x Images
Legacy environment variables such as IS_PERSISTENT, PERSIST_DIRECTORY, and ANONYMIZED_TELEMETRY
are from older server configuration flows and should not be used in the default v1.x Docker run setup.
Optional: Docker with YAML config file (collapsed)
Docker Compose¶
Chroma server can also be run with Docker Compose by creating a docker-compose.yaml.
Prerequisites:
services:
chromadb:
image: chromadb/chroma:1.5.3
volumes:
- ./chroma-data:/data
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v2/heartbeat"]
interval: 30s
timeout: 10s
retries: 3
The above will create a container with Chroma 1.5.3, expose it on local port 8000, and persist data in
./chroma-data relative to where docker-compose.yaml is run.
Optional: Docker Compose with YAML config file (collapsed)
Versioning
When running Chroma with docker compose try to pin the version to a specific release. This will ensure intentional upgrades and avoid potential issues (usually with clients).
Minikube With Helm Chart¶
KinD Alternative
This deployment can also be done with KinD, depending on your preference.
A more advanced approach to running Chroma locally (but also on a remote cluster) is to deploy it using a Helm chart.
Community-Maintained Chart
The chart used here is not a first-party Chroma chart and is maintained by a core contributor.
Prerequisites:
- Docker - Overview of Docker Desktop | Docker Docs
- Install minikube - minikube start | minikube (k8s.io)
- kubectl - Install Tools | Kubernetes
- Helm - Helm | Installing Helm
Once you have all of the above, running Chroma in a local minikube cluster is quite simple.
Create a minikube cluster:
Get and install the chart:
helm repo add chroma https://amikos-tech.github.io/chromadb-chart/
helm repo update
helm install chroma chroma/chromadb \
--set image.tag="1.5.3"
Auth values for Chroma >= 1.0.0
Chart values under chromadb.auth.* are legacy and ignored.
Use network-level controls (private networking, ingress auth, API gateway, mTLS) when needed.
The first step to connect and start using Chroma is to forward your port:
The command returns a local URL such as http://127.0.0.1:61892.
Driver-specific behavior
On some setups (for example Docker driver on macOS), this command runs a local tunnel in the foreground. Keep that terminal open while you use the URL.
Test it out (pip install chromadb):
import chromadb
client = chromadb.HttpClient(host="http://127.0.0.1:61892")
client.heartbeat() # public endpoint
client.get_version() # public endpoint
client.list_collections() # expected to work in this local chart setup
For more information about the Helm chart, see amikos-tech/chromadb-chart or Artifact Hub.